Skip to main content

API for the ekey bionyx system - Python

Lint & Test codecov PyPI - Version

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())

Metadata

Release files for ekey-bionyxpy 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ekey-bionyxpy 1.0.1
File Size Uploaded
ekey_bionyxpy-1.0.1.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ekey-bionyxpy 1.0.1
File Interpreter ABI Platform
ekey_bionyxpy-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / ekey_bionyxpy-1.0.1.tar.gz

Download URL ekey_bionyxpy-1.0.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c5e86e646d7c18403b522ae1edbe2e35377f9d9f4463cd9ed3260949b9148a5e
BLAKE2b-256 checksum
How to use checksums
1a96bbf3110d00f28e3b9e626069cee5fd05b0cf6694e46a421b1641bcb23b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ekey_bionyxpy-1.0.1-py3-none-any.whl

Download URL ekey_bionyxpy-1.0.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a10fbe1b1d5eb328877e8cb72f2bce5489f4d24e08c5ad619b7169d1bf4332b9
BLAKE2b-256 checksum
How to use checksums
72e1f577c94e3eb3ca1283ac71a9f1b02f1fcd323f112e5949c11a626ae31688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page