Skip to main content

Asynchronous Python client for the Photoprism REST API

Project description

aiophotoprism

Asynchronous Python client for the Photoprism

Warning: Photoprism API is not stable yet, use on your own risk

NOTE: The package is in active development. Not all features of the API are implemented.

Installation

pip install aiophotoprism

Usage

import asyncio

from aiophotoprism import Photoprism

async def main():

  async with Photoprism("username", "password") as client:
    # interact with the client here
    pass

if __name__ == "__main__":
  asyncio.run(main())

Photoprism

Photoprism is the entrypoint class, it acts as an async context manager and provides access to API endpoints.

Initialization

    def __init__(
        self,
        username, # your username
        password, # your password
        url="http://127.0.0.1:2342", # A base URL of the server, https://syncthing.example.com:443/something is also possible
        timeout=DEFAULT_TIMEOUT, # Timeout in seconds
        verify_ssl=True, # Perform SSL verification
        loop=None, # event loop
        session=None # client session,
    )...

Photos

Returns list of photos.

await client.photos(count=50)

Config

Returns Photoprism instance config.

await client.config()

Index

Forces the Photoprism instance to index photos. Complete scan is not supported.

await client.index()

License

MIT License

Copyright (c) 2021 Gleb Sinyavskiy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiophotoprism-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

aiophotoprism-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file aiophotoprism-0.1.1.tar.gz.

File metadata

  • Download URL: aiophotoprism-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for aiophotoprism-0.1.1.tar.gz
Algorithm Hash digest
SHA256 56c848906a714e2ab3a91c62ce25be80b0c7ac85ba9af0d5537f0d9fbed6560d
MD5 fac62867947ec7a02bb724c7bc2efb12
BLAKE2b-256 5f61702dd2bae02533a1dd9d21d46da0e1dae981c3c8c727cdf889a08307adcb

See more details on using hashes here.

Provenance

File details

Details for the file aiophotoprism-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aiophotoprism-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for aiophotoprism-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f689187570fd48cf5c7a54c8f6b29607feca6fe66090361d637c21071601073
MD5 29cf74b7ff8fb5b1158adcbcff592025
BLAKE2b-256 fc5e81524e908e7ebe7b39f5a6e9c314bbc78e6060ffbc8645d6d1d302c4131e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page