Skip to main content

No project description provided

Project description

API for the ekey bionyx system - Python

Lint & Test codecov

Overview

The ekey_bionyxpy library can be used to interact with the API of the ekey bionyx biometric systems. All the current functions of the API are mapped. The library is written to completely take advantage of async code in Python.


Features

  • Get all systems attached to the user
  • Get all webhooks added by the integration
  • Add new webhooks
  • Update existing webhooks

Enabling the API

The system must be setup in the online mode. In your app please enable the API by following the picture Erklärung

After the API is enabled you can use the library by first implementing AbstractAuth with your custom token handling.

In the example a token manager is used. You can however use any mechanism you like to retieve an access token.

from ekey_bionyxpy import AbstractAuth

class Auth(AbstractAuth):
    def __init__(self, websession: ClientSession, host: str, token_manager):
        """Initialize the auth."""
        super().__init__(websession, host)
        self.token_manager = token_manager

    async def async_get_access_token(self) -> str:
        """Return a valid access token."""
        if self.token_manager.is_token_valid():
            return self.token_manager.access_token

        await self.token_manager.fetch_access_token()
        await self.token_manager.save_access_token()

        return self.token_manager.access_token

Once the Authentication is dealt with you can use the lib like so:

async def main() -> None:
    async with aiohttp.ClientSession() as session:
        # Aquire token manager here
        auth = Auth(
            session,
            "https://api.bionyx.io/3rd-party/api",
            token_manager,
        )
        api = BionyxAPI(auth)
        systems = await api.get_systems()
        webhooks = await systems[0].get_webhooks()


asyncio.run(main())

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

ekey_bionyxpy-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ekey_bionyxpy-0.0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file ekey_bionyxpy-0.0.3.tar.gz.

File metadata

  • Download URL: ekey_bionyxpy-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for ekey_bionyxpy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 49be38115462c0f2df59a9fd934576567dd5dbd2bf4a21086b3592541f77f826
MD5 5021df219030839f7dcf20c852917b72
BLAKE2b-256 d393c148b1d7bb0dfebabc1d1cfe7cd00eb88422d0d931740c1d0d1c66272070

See more details on using hashes here.

File details

Details for the file ekey_bionyxpy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ekey_bionyxpy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for ekey_bionyxpy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e9abb08896bb8d9cfb6561af4c6de131a69503ffe8afaaaa5ad26d41d9a90694
MD5 720a85cca57f1e06c412e1175ffcc741
BLAKE2b-256 33c1aead9e7acfda716be57e2bbb3338709d5d7ae88b7656c3404f61b3b0582e

See more details on using hashes here.

Supported by

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