Skip to main content

Encoding and decoding Python data structrues using portable JData-annotated formats

Project description

JData for Python - a lightweight and portable data annotation method

Build Status

The JData Specification defines a lightweight language-independent data annotation interface targetted at storing and sharing complex data structures across different programming languages such as MATLAB, JavaScript, Python etc. Using JData formats, a complex Python data structure can be encoded as a dict object that is easily serialized as a JSON/binary JSON file and share such data between programs of different languages.

How to install

This package can also be installed on Ubuntu (Debian package is currently under review) via

sudo add-apt-repository ppa:fangq/ppa
sudo apt-get update
sudo apt-get install python-jdata python3-jdata


  • bjdata: PIP: run pip install bjdata see
  • numpy: PIP: run pip install numpy or sudo apt-get install python-numpy
  • backports.lzma: PIP: run pip install backports.lzma (needed for Python 2.7)

Replacing pip by pip3 if you are using Python 3.x. If either pip or pip3 does not exist on your system, please run

    sudo apt-get install python-pip python3-pip

One can also install this module from the source code. To do this, you first check out a copy of the latest code from Github by

    git clone
    cd pyjdata

then install the module to your local user folder by

    python install --user

or, if you prefer, install to the system folder for all users by

    sudo python install

Please replace python by python3 if you want to install it for Python 3.x instead of 2.x.

How to use

The PyJData module is easy to use. You can use the encode()/decode() functions to encode Python data into JData annotation format, or decode JData structures into native Python data, for example

import jdata as jd
import numpy as np

One can further save the JData annotated data into JSON or binary JSON (UBJSON) files using the function, or loading JData-formatted data to Python using jdata.load

import jdata as jd
import numpy as np

To see additional data type support, please run the built-in test using below command

python -m unittest discover -v test

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jdata, version 0.3.6
Filename, size File type Python version Upload date Hashes
Filename, size jdata-0.3.6.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page