Base library for enochecker libs
Project description
enochecker_core
This package provides dataclasses and enums adhering to the specification.
Since the specification defines keys in camel case, whereas this package follows python naming convention and has keys in snake case, the keys need to be transformed when sending/receiving them over the wire. The recommended way is to use the jsons
(not json
) package.
Example:
>>> from enochecker_core import CheckerTaskResult, CheckerResultMessage
>>> import jsons
>>> jsons.dumps(CheckerResultMessage(result=CheckerTaskResult.OK, message="some message"), use_enum_name=False, key_transformer=jsons.KEY_TRANSFORMER_CAMELCASE)
'{"message": "some message", "result": "OK"}'
>>> jsons.loads('{"message": "some message", "result": "OK"}', CheckerResultMessage, key_transformer=jsons.KEY_TRANSFORMER_SNAKECASE, strict=True)
CheckerResultMessage(result=<CheckerTaskResult.OK: 'OK'>, message='some message')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
enochecker_core-0.10.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for enochecker_core-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad6eb7d0a964d0e3d679f7d699c594e8a7be03af552dcf62356de7d16aad2ed |
|
MD5 | d236695ab3908fae677286be924ee926 |
|
BLAKE2b-256 | 10d016dbf5b955b86279610673b0b10e3e24dda53b4df678fed291248219377c |