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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file tojson-0.1.0.tar.gz.

File metadata

  • Download URL: tojson-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.5.0

File hashes

Hashes for tojson-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c26641d946c80015697d4d3e93c2f8c4c4743b9bbb8762daad72f0e2c837a4ef
MD5 76c3d991a5ed0c8f5ccec094fc2caf89
BLAKE2b-256 2ea01fa3b1bce6bbd7c5c5b12d80b515603f4787a1dc68e63de4781df838a2c9

See more details on using hashes here.

File details

Details for the file tojson-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tojson-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.5.0

File hashes

Hashes for tojson-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7009231daf99ddf9358af2fd8aec7afd829713bcec8da141d70334487fbec5c
MD5 f8684855faed17fb625a41ed763ab811
BLAKE2b-256 0ac9dadd71c6ea8de971ec437d73ac43943456a887508130c52b17b25deca7de

See more details on using hashes here.

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