Skip to content

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.

License

Notifications You must be signed in to change notification settings

ckmishra8/pyjsonlines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyjsonlines

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages