Skip to main content

JsonDecoder for ndjson

Project description


Support for ndjson. Plain and simple.


  • familiar interface

  • very small

  • no dependencies

  • works as advertised

  • has tests


ndjson exposes the same api as the builtin json and pickle packgages.

import ndjson

# load from file-like objects
with open('data.ndjson') as f:
    data = ndjson.load(f)

# convert to and from objects
text = ndjson.dumps(data)
data = ndjson.loads(text)

# dump to file-like objects
with open('backup.ndjson', 'w') as f:
    ndjson.dump(items, f)

It contains JSONEncoder and JSONDecoder classes for easy use with other libraries, such as requests:

import ndjson
import requests

response = requests.get('')
items = response.json(cls=ndjson.Decoder)


This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.


0.2.0 (2019-08-01)

  • Add support for 3.7

  • Remove support for 3.4

0.1.0 (2018-05-17)

  • First release on PyPI.

Project details

Download files

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

Source Distribution

ndjson-0.2.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

ndjson-0.2.0-py2.py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page