Skip to main content

A CLI tool to export CSV files to JSON format

Project description

CSV2JSON

🚀 A CLI tool to export CSV files to JSON format.

Supported Python versions PEP8

Requirements

⬇️ Installation

pip install tojson

⌨️ Usage

➜ csv2json --help  # You can also use the alias `tojson` or `csvtojson`

usage: csv2json [-h] [-o {dict,list,series,split,records,index}] [-i INDENT]
                [-c]
                path [path ...]

positional arguments:
  path                  Path to a single file/directory or multiple
                        files/directories

options:
  -h, --help            show this help message and exit
  -o {dict,list,series,split,records,index}, --orient {dict,list,series,split,records,index}
                        The type of the values of the dictionary
  -i INDENT, --indent INDENT
                        JSON output indentation
  -c, --compress        Compress the output

📕 Examples

csv2json foo.csv
# Orient as list 
csv2json foo.csv -o list
# Compressed output and use zero indentation (minified)
csv2json foo.csv -c -i 0

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

tojson-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

tojson-0.1.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded 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