AHBicht Functions Python Client
This repository contains a lightweight client for an AHBicht powered backend by Hochfrequenz.
It does not duplicate the core AHBicht logic but provides a PackageResolver
that accesses a database (via a REST API) that stores PackageKeyConditionExpressionMappings.
The database is maintained by Hochfrequenz.
Internally this client uses and requires aiohttp.
How to use the Client
- Install using pip:
pip install ahbichtfunctionsclient
Then call it
import asyncio
from ahbicht.mapping_results import PackageKeyConditionExpressionMapping, ConditionKeyConditionTextMapping
from ahbichtfunctionsclient import HochfrequenzPackageResolver
from maus.edifact import EdifactFormat, EdifactFormatVersion
async def retrieve_package_key_condition_expression_mapping():
# for a documentation about the purpose of a package resolver, you should read the ahbicht docs
package_resolver = HochfrequenzPackageResolver(EdifactFormatVersion.FV2204, EdifactFormat.UTILMD)
# the following data are just hardcoded to provide you a minimal working example
package_mapping = await package_resolver.get_condition_expression("10P") # this does an HTTP GET request
assert isinstance(package_mapping, PackageKeyConditionExpressionMapping) # the result is ahbicht compatible
async def retrieve_condition_key_condition_text_mapping():
condition_resolver = HochfrequenzPackageResolver(EdifactFormatVersion.FV2204, EdifactFormat.UTILMD)
# the following data are just hardcoded to provide you a minimal working example
condition_mapping = await condition_resolver.get_condition_expression("56") # this does an HTTP GET request
assert isinstance(condition_mapping, ConditionKeyConditionTextMapping) # the result is ahbicht compatible
async def minimal_working_example():
await retrieve_condition_key_condition_text_mapping()
await retrieve_package_key_condition_expression_mapping()
loop = asyncio.get_event_loop()
loop.run_until_complete(minimal_working_example())
Production Readiness
This AHBicht client has a 100% code coverage, is linted, statically type checked and PEP561 compatible. It relies on a Hochfrequenz API which is, as of today (2022-03-17), free to use. Hochfrequenz does not give any guarantees regarding the stability or uptime of the API. Also at one point it might require authorization.
How to use this Repository on Your Machine (for development)
Please follow the instructions in our Python Template Repository. And for futher information, see the Tox Repository.
You can also check out our MIG AHB Utility Stack (MAUS) and AHBicht repositories.
Contribute
You are very welcome to contribute to this template repository by opening a pull request against the main branch.
Metadata
Release files for ahbichtfunctionsclient 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ahbichtfunctionsclient-0.0.5.tar.gz | 11.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ahbichtfunctionsclient-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / ahbichtfunctionsclient-0.0.5.tar.gz
| Download URL | ahbichtfunctionsclient-0.0.5.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68e6b6ff94a4b4dde4c4b574c4f773e1b0dc9c132a0a61050712ea8b07fabac1
|
|
BLAKE2b-256 checksum How to use checksums |
1bb3b019a8027e28cfce41d018b08e40170708b56d23c8a0b664701b179cf0be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / ahbichtfunctionsclient-0.0.5-py3-none-any.whl
| Download URL | ahbichtfunctionsclient-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67def99deca641883b2b2c81516c02878eb6e9918ff2af35f68343d0d897f871
|
|
BLAKE2b-256 checksum How to use checksums |
abfbfeee804fce9561bc2888d0a757cd6830d6783d7e9fd0d1504a58b34714f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for ahbichtfunctionsclient 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.