Skip to main content

Convert json array data to csv.

Project description

python-json2csv

Convert json array data to csv.

Note: zencore-json2csv rename to python-json2csv

Install

pip install python-json2csv

Usage

E:\>json2csv --help
Usage: json2csv [OPTIONS]

Options:
-f, --file FILENAME     Input file name, use - for stdin.
--file-encoding TEXT    Input file encoding.
-o, --output FILENAME   Output file name, use - for stdout.
--output-encoding TEXT  Output file encoding.
-k, --keys TEXT         Output field names. Comma separated string list.
-p, --path TEXT         Path of the data.
--help                  Show this message and exit.

Examples

Example 1

INPUT:

[
    [1,2,3],
    [2,3,4]
]

OUTPUT:

1,2,3
2,3,4

COMMAND:

cat input.txt | json2csv -o output.txt

Example 2

INPUT:

[
    {"f1": 11, "f2": 12, "f3": 13},
    {"f1": 21, "f3": 23, "f2": 22}
]

OUTPUT:

11,12,13
21,22,23

COMMAND:

cat input.txt | json2csv -o output.txt -k f1,f2,f3

Example 3

INPUT:

{
    "data": {
        "list": [
            [1,2,3],
            [2,3,4],
        ]
    }
}

OUTPUT:

1,2,3
2,3,4

COMMAND:

cat input.txt | json2csv -o output.txt -p data.list

Releases

v0.2.0 2019-11-05

  • Rename from zencore-json2csv to python-json2csv.
  • Fix console application install method in setup.py.

v0.1.1 2018-02-27

  • Simple json2csv console utils released.

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

zencore-json2csv-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file zencore-json2csv-0.2.0.tar.gz.

File metadata

  • Download URL: zencore-json2csv-0.2.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for zencore-json2csv-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a42aa10c96c81befefeb8741e8a92751b3771007eadd79e40d5d4817fbc717b2
MD5 02440fd5e2f7b41e5ddcd8ec83b6888f
BLAKE2b-256 8fdcbab499cbd96d5a5d10c6b206bf4e90b53fe3f5112b0071e8af004e774295

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