Interact with the bionyx third party API of the ekey biometric systems.
Project description
API for the ekey bionyx system - Python
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ekey_bionyxpy-1.0.1.tar.gz.
File metadata
- Download URL: ekey_bionyxpy-1.0.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5e86e646d7c18403b522ae1edbe2e35377f9d9f4463cd9ed3260949b9148a5e
|
|
| MD5 |
6f91b7c5dcaf8f2a805e58691e083d50
|
|
| BLAKE2b-256 |
1a96bbf3110d00f28e3b9e626069cee5fd05b0cf6694e46a421b1641bcb23b37
|
File details
Details for the file ekey_bionyxpy-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ekey_bionyxpy-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a10fbe1b1d5eb328877e8cb72f2bce5489f4d24e08c5ad619b7169d1bf4332b9
|
|
| MD5 |
1dc7b63743a027886056d6c5d21049b4
|
|
| BLAKE2b-256 |
72e1f577c94e3eb3ca1283ac71a9f1b02f1fcd323f112e5949c11a626ae31688
|