canonicaljson-rs
################
Python package leveraging our Canonical JSON implementation in Rust.
In order to validate content signatures of our data, Canonical JSON gives us a predictable JSON serialization.
And Rust allows us to reuse the same implementation between our server in Python (this package) and our diverse clients (Rust, Android/iOS, JavaScript).
Usage
.. code-block ::
pip install canonicaljson-rs
.. code-block :: python
>>> import canonicaljson
>>>
>>> canonicaljson.dumps({"héo": 42})
'{"h\\u00e9o":42}'
canonicaljson.dumps(obj: Any) -> str
canonicaljson.dump(obj: Any, stream: IO) -> str
Development
We rely on a specific Python builder that automates everything around Rust bindings.
.. code-block ::
pip install maturin
In order to install the package in the current environment:
.. code-block ::
maturin develop
Run tests:
.. code-block ::
pytest
Release
- Create a release on Github on https://github.com/mozilla-services/python-canonicaljson-rs/releases/new
- Create a new tag
vX.Y.Z
(This tag will be created from the target when you publish this release.) - Generate release notes
- Publish release
See Also
Other specs:
License
- Mozilla Public License 2.0