Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

CSJ for Python

Project description

CSJ Parser for Python

N|package Build Status

Comma Separated JSON (CSJ) is a CSV like file format designed for stream processing where each cell is valid JSON. This makes it very similar to CSV, but without the problems that CSV has.

For more information, please visit


CSJ Parser requires Python 3.5 or later to run. CSJ Parser can be installed using pip:

$ pip install csj-parser

If you want the latest release, you can install from git:

$ pip install git+


Convert JSON to CSJ

from csj_parser.csj import Csj

json_list = [
        "key1" : "value1",
        "key2" : ["item1", "item2", "item3"],
        "key3" : {"key" : "value"}
        "key1" : 10,
        "key2" : None,
        "key3" : None

# This function returns a string of data in CSJ format
def convert_json_to_csj(json_dict):
    csj_string = Csj.from_dicts(json_dict)
    return csj_string


"value1",["item1","item2","item3"], {"key":"value"}

Convert CSJ to JSON

from csj_parser.csj import Csj

csj_str = '''"key1","key2","key3"\n"value1","value2","value3"\n"value4","value5","value6"\n'''

# This function returns a dictionary of data in JSON format
def convert_csj_to_json(csj_string):
    json_dict = Csj.to_dict(csj_string)
    return json_dict


[{'key1': 'value1', 'key2': 'value2', 'key3': 'value3'},{'key1': 'value4', 'key2': 'value5', 'key3': 'value6'}]

Project details

Download files

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

Files for csj-parser, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size csj_parser-0.0.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page