Type-aware json serialiser and deserialiser.
This library provides a custom JSON serialiser and deserialiser based on the ones in the standard python library but capable of
understanding a wider range of python types including the
mediatimestamps.timestamp type and the
uuid.UUID type, and
- A working Python 3.6+ installation
- The tool tox is needed to run the unittests, but not required to use the library.
# Install from pip $ pip install mediatimestamp # Install via apt-get $ apt-get install python-mediatimestamp python3-mediatimestamp # Install directly from source repo $ git clone firstname.lastname@example.org:bbc/rd-apmm-python-lib-mediajson.git $ cd rd-apmm-python-lib-mediajson $ pip install -e .
import mediajson import mediatimestamp # Encode some json from a mediatimestamp.Timestamp object print(mediajson.dumps(mediatimestamp.Timestamp.get_time()))
The API is well documented in the docstrings of the module mediajson, to view:
To run the unittests for this package in a virtual environment follow these steps:
$ git clone email@example.com:bbc/rd-apmm-python-lib-mediajson.git $ cd rd-apmm-python-lib-mediajson $ make test
Debian and RPM packages can be built using:
# Debian packaging $ make deb # RPM packageing $ make rpm
This repository includes a Jenkinsfile which makes use of custom steps defined in a BBC internal library for use on our own Jenkins instances. As such it will not be immediately useable outside of a BBC environment, but may still serve as inspiration and an example of how to implement CI for this package.
We use Semantic Versioning for this repository
The code in this repository was previously released as part of the nmos-common library (https://github.com/bbc/nmos-common/). For contributing wok please see the file CONTRIBUTING.md in this repository.
Please ensure you have run the test suite before submitting a Pull Request, and include a version bump in line with our Versioning policy.
- James Weaver (firstname.lastname@example.org)
- Philip deNier (email@example.com)
- Sam Nicholson (firstname.lastname@example.org)