Converts a CSV formatted input to a readable table in text
Project description
csvtables
Converts a CSV formatted input to a readable table in text. The table is Markdown compatible.
Usage
Import convert_table
to your project and call it with a CSV formatted iterable. This can be a file or a StringIO
object. Passing compact=True
argument will remove all the unnecessary whitespace from the output, producing a smaller size but less readable table.
Example:
A sample data CSV file tests/sample_data.csv
contains a list of fictional people.
Running from command line
csvtables tests/sample_data.csv
will produce a table of the data
Running as a module
# example.py
from csvtables import csvtables
csv_file = open("tests/sample_data.csv", "r")
table_string = csvtables.convert_table(csv_file)
print(table_string) # display the table to stdout
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
csvtables-0.3.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for csvtables-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86eb5ff51b12c5e407aa6d7238b49fb6902b71333b60ceadc8aef6f52f7e0ca6 |
|
MD5 | 49d662dd2e422866de0b774da4ee6ff7 |
|
BLAKE2b-256 | d6e5cd541306eb007a786fe449fe52c7c25ee41ee6f3a62ea2122a693b9edad7 |