Bidirectional CSV ↔ JSON converter with nested JSON support
Project description
csvjson
Bidirectional CSV ↔ JSON converter with nested JSON support — zero dependencies, pure Python.
Install
# Recommended: uv tool install (isolated, globally available)
uv tool install csvjson
# Or: pip
pip install csvjson
Usage
Interactive mode
csvjson
File mode
# CSV → JSON
csvjson csv2json input.csv
csvjson csv2json input.csv -o output.json
# JSON → CSV
csvjson json2csv input.json
csvjson json2csv input.json -o output.csv
Nested JSON via dot-notation
CSV headers with dots become nested JSON — and flatten back automatically.
Input CSV:
name,address.city,address.zip,scores.math
Alice,NYC,10001,95
Bob,LA,90001,88
Output JSON:
[
{ "name": "Alice", "address": { "city": "NYC", "zip": 10001 }, "scores": { "math": 95 } },
{ "name": "Bob", "address": { "city": "LA", "zip": 90001 }, "scores": { "math": 88 } }
]
Type coercion
| CSV value | Python type |
|---|---|
42 |
int |
3.14 |
float |
true / false |
bool |
| empty | None |
| anything else | str |
Publish to PyPI
uv build # creates dist/
uv publish # uploads to PyPI (needs PYPI_TOKEN)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nyaf_csvjson-1.0.0.tar.gz
(4.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nyaf_csvjson-1.0.0.tar.gz.
File metadata
- Download URL: nyaf_csvjson-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27ebec30c7386cad33c342edd7d3d60c6db1f7a8d4da8b0111f1623c421e7d63
|
|
| MD5 |
9b0313f01a99deba2dfc63fc8bb639ef
|
|
| BLAKE2b-256 |
694c3e5b1c3d20cc058d245b90afa976cc2a805a96eac18e0721d89e032d433a
|
File details
Details for the file nyaf_csvjson-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nyaf_csvjson-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b6b0431766ea67bf60505009edba49009daf66fa0cb6a160f9a113b5f9b3893
|
|
| MD5 |
d34e22ee3d05332bed502624e1dad2ec
|
|
| BLAKE2b-256 |
e237774855c834726d2ef3d042f5e7bb8710641cd1e6ef1afffdde2c8cd5a314
|