Skip to main content

Convert tabular data files with Tablib.

Project description

tublub

Convert or view tabular data files — CSV, JSON, XLSX, YAML, and more — from the command line.

tublub is a thin wrapper around Tablib. Tablib reads and writes plenty of formats, but it won't open the files for you — you have to know which ones need binary mode, special newline handling, and so on. tublub bakes that per-format knowledge in, so you just point it at a file and it works.

$ tublub --list
Available formats: json xlsx xls yaml csv tsv ods dbf html jira latex rst sql cli

$ tublub input.json
Username |Identifier|First name|Last name
---------|----------|----------|---------
booker12 |9012      |Rachel    |Booker
grey07   |2070      |Laura     |Grey
jenkins46|9346      |Mary      |Jenkins
johnson81|4081      |Craig     |Johnson
smith79  |5079      |Jamie     |Smith

$ tublub input.json output.xlsx

$ file output.xlsx
output.xlsx: Microsoft Excel 2007+

$ tublub input.json --format csv
Username,Identifier,First name,Last name
booker12,9012,Rachel,Booker
grey07,2070,Laura,Grey
jenkins46,9346,Mary,Jenkins
johnson81,4081,Craig,Johnson
smith79,5079,Jamie,Smith

$ tublub -o book.xlsx sales.csv users.json regions.tsv
Saved 'book.xlsx', 3 sheets (xlsx)

With -o, all positional arguments are inputs. Two or more inputs become sheets in a single Databook (XLSX, ODS, JSON, YAML, ...); sheet names default to each input file's stem.

To inspect a multi-sheet input without converting it, use --list-sheets:

$ tublub --list-sheets book.xlsx
[0] people  2 rows x 2 cols
[1] cities  2 rows x 2 cols

Single-sheet formats (CSV, TSV, ...) print one row, using the file stem as the title.

News and Changes

Please see the changelog for more details.

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

tublub-0.5.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tublub-0.5.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file tublub-0.5.0.tar.gz.

File metadata

  • Download URL: tublub-0.5.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tublub-0.5.0.tar.gz
Algorithm Hash digest
SHA256 74fe7d1af801ca452ad84e9b627367a6f64ef9923ac5dccc055d5b6090b59316
MD5 5300b887d8fe28ab70369c844248cc1d
BLAKE2b-256 2d7206ab00d60e7166076803152d36af6ad2aae8f2f6d924e779249cd1b21f74

See more details on using hashes here.

Provenance

The following attestation bundles were made for tublub-0.5.0.tar.gz:

Publisher: python-publish.yml on harkabeeparolus/tublub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tublub-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: tublub-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tublub-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36c626cf41384f3e4b286b42feb86773bbb21066cdd61f4365e6c91c098a6af3
MD5 ad2ec7534e546c4ca6cb3169dc9f8907
BLAKE2b-256 c51f710d0e992cb23117038d0c2b1e1bab916639212a2dae53eac569aa577a87

See more details on using hashes here.

Provenance

The following attestation bundles were made for tublub-0.5.0-py3-none-any.whl:

Publisher: python-publish.yml on harkabeeparolus/tublub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page