Skip to main content

CLI tool that turns a CSV file into an HTML table with basic formatting

Project description

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

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.

To install the latest development version, run the following:

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

Usage

If applicable, make sure that the virtual environment where you pip installed tablify-csv is activated.

To convert a CSV file, run:

$ 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, run:

$ tablify-csv CSV_FILENAME --output-file OUTPUT_FILENAME

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.

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

tablify-csv-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file tablify-csv-0.1.0.tar.gz.

File metadata

  • Download URL: tablify-csv-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for tablify-csv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18a73795a367a2a128e3d677b7289b59e6b49a3b8935d24b474c6807975eb514
MD5 4af5ad0e811498f1891c73b1b1051da4
BLAKE2b-256 5dad34f15dd8ae48f7efd2e8247467479c790b61cb808bda2de2a8feec342cf9

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