Photoprysm

https://img.shields.io/pypi/v/photoprysm.svg Documentation Status

A Python client for interacting the the Photoprism REST API.

Features

  • Made to work with the popular Requests package

  • Session management for both Users and Clients

Quickstart

To start, you need a User or Client instance.

>>> import photoprysm
>>> user = photoprysm.User('username', 'password')
>>> server_api = photoprysm.get_api_url('localhost:2342')

You can either login with the User or Client handle and log out later…

>>> session = user.login(server_api)
>>> # Do some stuff
>>> user.logout()

Or you can use the context manager so that it will log out automatically when you are done.

>>> with photoprysm.user_session(user, server_api) as session:
>>>     # Do some stuff
>>> # Logged out

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.