Metadata-Version: 2.0
Name: ndjson
Version: 0.1.0
Summary: JsonDecoder for ndjson
Home-page: https://github.com/rhgrant10/ndjson
Author: Robert Grant
Author-email: rhgrant10@gmail.com
License: GNU General Public License v3
Keywords: ndjson
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6

======
ndjson
======

Support for ndjson. Plain and simple.

.. image:: https://img.shields.io/pypi/v/ndjson.svg
        :target: https://pypi.python.org/pypi/ndjson

.. image:: https://img.shields.io/travis/rhgrant10/ndjson.svg
        :target: https://travis-ci.org/rhgrant10/ndjson

* Free software: GNU General Public License v3


Features
--------

* familiar interface
* very small
* no dependencies
* works as advertised
* has tests


Usage
-----

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

.. code-block:: python

    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``:

.. code-block:: python

    import ndjson
    import requests

    response = requests.get('https://example.com/api/data')
    items = response.json(cls=ndjson.Decoder)


Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2018-05-17)
------------------

* First release on PyPI.


