Skip to main content

tablify-csv

Build Status

CLI tool to convert data in a CSV file into an HTML table with basic formatting.

The tool lets you:

  • Specify column headings to be displayed on the final HTML table
  • Assign class names to any column (assign to td tags that fall under a given column)
  • Save the output (prettified) HTML into a file and/or copy to clipboard

Requirements

Please see requirements.txt and dev-requirements.txt for full list of dependencies.

Installation

It's recommended to create and activate a virtual environment before installing.

For the latest stable release, install from PyPI package with pip:

$ pip install tablify-csv

To install the latest development version, run the following:

$ pip install git+https://github.com/ralphqq/tablify-csv

Usage

Once installed, tablify-csv can now be used without any additional configuration required. If applicable, make sure that the virtual environment where you pip installed tablify-csv is activated.

Valid CSV File

The current version of tablify-csv assumes the CSV file to be parsed has:

  • A header row with the column names in the first line of the file
  • No empty lines between the header row and the first data row (i.e., the first data row immediately follows the header row)

Usage Examples

To convert a CSV file:

$ tablify-csv CSV_FILENAME

This will save the HTML table in a file with the same name as the CSV file except the extension will be .html.

To specify a filename for the output file:

$ tablify-csv CSV_FILENAME --output-file OUTPUT_FILENAME

To copy the resulting HTML table to the clipboard (without saving to an output file):

$ tablify-csv CSV_FILENAME --clip

To copy the resulting HTML table to the clipboard and save it to an output file:

$ tablify-csv CSV_FILENAME --output-file OUTPUT_FILENAME --clip

Development Setup

  1. Clone this repo at https://github.com/ralphqq/tablify-csv
  2. Create and activate a virtual environment
  3. Install the development dependencies:
    $ pip install -r dev-requirements.txt
    
  4. Run the test suite:
    $ pytest
    

Note: To ensure coding style consistency, this project uses pre-commit hooks. You may also want to initialize pre-commits into your local development clone (this is strongly recommended if you want to contribute, see Contributing section).

$ pre-commit install

Contributing

  1. Fork this repo at https://github.com/ralphqq/tablify-csv
  2. Clone your fork into your local machine
  3. Follow steps in Development Setup but skip step 1
  4. Initialize pre-commit hooks
    $ pre-commit install
    
  5. Create your feature branch:
    $ git checkout -b feature/some-new-thing
    
  6. Commit your changes:
    $ git commit -m "Develop new thing"
    
  7. Push to the branch:
    $ git push origin feature/some-new-thing
    
  8. Create a pull request

License

tablify-csv is available under the MIT License.

Metadata

Release files for tablify-csv 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tablify-csv 0.2.0
File Size Uploaded Provenance Actions
tablify-csv-0.2.0.tar.gz 7.7 kB Without provenance Details for tablify-csv-0.2.0.tar.gz

Release files / tablify-csv-0.2.0.tar.gz

Download URL tablify-csv-0.2.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f38f232445b9128f42f4e2461cc4818ff34b08883e938f5b77d1609d530fe268
BLAKE2b-256 checksum
How to use checksums
cee6af933fc12c721c4771d890b2af5ce64de04106ea4c285b7b4cba875e3252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for tablify-csv 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page