Skip to main content

Library to convert Json to Jsonlines or ndjson and Jsonlines or ndjson to Json.

Project description

A Python library to convert Json to Jsonlines and Jsonlines to Json. This library is helpful to convert ndjson to Json and vice versa too.

Installation

User can install pyjsonlines either via the Python Package Index (PyPI) or from source.

Install using pip

pip install pyjsonlines

How to use

This library contains two APIs to convert data:

  1. json2jsonl(in_take, file=None)

  2. jsonl2json(in_take, file=None)

json2jsonl(in_take, file=None)

User should use this API incase to convert Json to Jsonlines or ndjson. User has to pass valid Json to this API, which is passed to in_take argument. User can either pass a Json file or Json object to convert to Jsonlines. The other argument, file is optional. It’s required when user wants to store the converted Jsonlines or ndjson data to a file. Full path of file along with name is suggested to pass.

jsonl2json(in_take, file=None)

User should use this API incase to convert Jsonlines or ndjson to Json. User has to pass valid Jsonlines to this API, which is passed to in_take argument. User can either pass a Jsonlines file or Jsonlines object to convert to Json. The other argument, file is optional. It’s required when user wants to store the converted Json data to a file. Full path of file along with name is suggested to pass.

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

pyjsonlines-2.0.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file pyjsonlines-2.0.1.tar.gz.

File metadata

  • Download URL: pyjsonlines-2.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pyjsonlines-2.0.1.tar.gz
Algorithm Hash digest
SHA256 4c998c05b1c02eff9f70761db9fbd3c21ce70981795dbce68d38fd32f496be39
MD5 b119cca96a83c28464992d61d0bad075
BLAKE2b-256 5953ed9a24e2a72f1103c7cbdb00f7d414a6286f6580ce1b90100ea9d9c60513

See more details on using hashes here.

Supported by

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