Skip to main content

# JData for Python - a lightweight and portable data annotation method

The [JData Specification](https://github.com/fangq/jdata/) 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

If you download a local copy via git clone or github download, after unzipping the package, you can

## 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 a={'str':'test','num':1.2,'list':[1.1,[2.1]],'nan':float('nan'),'np':np.arange(1,5,dtype=np.uint8)} jd.encode(a) jd.decode(jd.encode(a)) d1=jd.encode(a,{'compression':'zlib','base64':1}) d1 jd.decode(d1,{'base64':1}) `

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

` import jdata as jd import numpy as np a={'str':'test','num':1.2,'list':[1.1,[2.1]],'nan':float('nan'),'np':np.arange(1,5,dtype=np.uint8)} jd.save(a,'test.json') newdata=jd.load('test.json') newdata `

Download files

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

Source Distribution

jdata-0.2.3.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file jdata-0.2.3.tar.gz.

File metadata

  • Download URL: jdata-0.2.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.9.1

File hashes

Hashes for jdata-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b9bfa137030a3629380d6f43234bb155cb73e430eb153694dbf2e52b54f3514b
MD5 ee0bc8c6b8e867614ee3b3167ce96d68
BLAKE2b-256 e6ce742a2de81927b76899be05099d663d8b643a892581e42c9edd92d66119df

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.7

2 files

0.3.6

1 file

0.3.5

1 file

0.3.0

1 file

0.2.5

1 file

0.2.4

1 file

This release

0.2.3 This release

1 file

0.2.2

1 file

0.2.1

1 file

0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page