DataBridge CLI
python >= 3.10 · 0 runtime dependencies · MIT · v0.1.1
A local CSV/JSON toolkit built around explicit terminal commands. Validate the shape of a table, inspect columns, convert formats and export Markdown without a spreadsheet application.
A terminal-first workflow
$ python -m databridge validate examples/inventory.csv
{
"valid": true,
"rows": 3,
"columns": [
"item",
"quantity",
"location"
]
}
Input → Inspect → Transform → Export
The output of a successful validation is JSON. CSV data stays text, preserving values such as leading zeros. Conversion and export work offline with the Python standard library. DataBridge is deliberately not a general-purpose application control framework.
Quick start
Clone the repository and run from the checkout with Python 3.10 or later:
python -m databridge --help
python -m databridge validate examples/inventory.csv
python -m databridge summary examples/inventory.csv
python -m databridge convert examples/inventory.csv --to json
python -m databridge select examples/inventory.csv --column location --column item --to csv
python -m databridge markdown examples/inventory.csv
Optional installation with available setuptools/build dependencies: python -m pip install . then use databridge instead of python -m databridge. Running from checkout needs no package installation or network.
Command reference
| Command | Function | Output |
|---|---|---|
validate |
Check UTF-8, table shape and supported scalar cells | JSON shape report |
summary |
Count rows, columns, missing values and field types | JSON summary |
convert --to csv/json |
Convert a complete table | CSV or JSON |
select --column NAME ... --to csv/json |
Select/reorder explicit columns | CSV or JSON |
markdown |
Escape values into a Markdown table | Markdown |
Conversion, selection and Markdown accept --output PATH (new file only) and --dry-run. Dry runs compute the output size without writing; validation reports data shape rather than schema or business-rule validity. Input format is inferred by extension or set by --input-format csv/json; --delimiter changes CSV parsing and CSV output delimiter (must be one non-newline character, not the quote character).
Example dry run:
python -m databridge convert examples/inventory.csv --to json --output inventory.json --dry-run
Example output:
{
"valid": true,
"dry_run": true,
"rows": 3,
"columns": ["item", "quantity", "location"],
"output_bytes": 249,
"writes": 0
}
The byte count varies with data; run the command for the exact count.
Behavior and limitations
- Only UTF-8 regular input files and explicitly named output paths; no network, external commands or plugins.
- Maximum input 16 MiB, 100,000 rows, 256 columns; processing is in memory.
- CSV requires unique nonblank headers and uniform row width; all CSV data is text to preserve leading zeros and avoid accidental type coercion.
- JSON requires a nonempty array of records with matching keys and primitive scalar values; nested data, duplicate keys and nonfinite numbers are rejected.
- Conversion to CSV represents null as empty text and numbers/booleans as strings. A header-only CSV produces an empty JSON array that cannot be reimported with header metadata.
- Missing means null or empty string. Markdown line breaks become spaces; escaped text is not a rendered HTML guarantee. Treat data from untrusted sources as untrusted if opening in other applications, including spreadsheet programs.
- A supplied output path is created exclusively and cannot overwrite existing files. Input and output paths are explicit. There is no automatic discovery of personal files.
- Reports and errors are JSON; invalid data/I/O errors are sent to stderr with exit code 1. CLI argument errors use argparse and exit code 2.
Development
python -m pip install ".[test]"
ruff check databridge tests
black --check databridge tests
python -m unittest discover -s tests -v
The tests exercise the parsers, Unicode, malformed records, selection, Markdown escaping, the real CLI, and non-overwriting dry runs. A property test exercises quoted Unicode CSV round trips across delimiters (75 generated inputs); 13 local tests, Ruff and Black passed on Linux/Python 3.12. CI runs the same checks across configured Python/OS combinations; consult actual remote results.
Acknowledgement
The idea of predictable command-oriented interfaces was inspired by HKUDS/CLI-Anything. This independently written project uses no source code or assets from that repository and has a narrower local data scope. Original code and original logo are under the MIT License.
Distribution
A release workflow is prepared for future PyPI Trusted Publishing and requires explicit dispatch with publishing enabled plus configured publisher authorization. The package is not yet published; use the source installation above.
Metadata
Release files for databridge-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| databridge_cli-0.1.1.tar.gz | 14.0 kB | With provenance | Details for databridge_cli-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| databridge_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for databridge_cli-0.1.1-py3-none-any.whl |
Total release size: 23.5 kB
Release files / databridge_cli-0.1.1.tar.gz
| Download URL | databridge_cli-0.1.1.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d7510c71aa5d3e5fbe7b0eed82f4e008b2b1332e72307f65a6c8addb876e92e
|
|
BLAKE2b-256 checksum How to use checksums |
c5367e04e830bf21ad673cb9ca9d332f2868fc3729c677ceddd231f9a728f31e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / databridge_cli-0.1.1-py3-none-any.whl
| Download URL | databridge_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1881aa26c8cc51d774e3b75b9bf45d7f97462e870ba8fc830b71c97893ec0a45
|
|
BLAKE2b-256 checksum How to use checksums |
77a87cae13a604ac0811d26617173569d21ff60f8d83b7dbe877cb3515bdbd4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for databridge-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for databridge_cli-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.