md_table_writer
md_table_writer generates Markdown formatted table(s) from a given data file and writes it to a Markdown file. Supported data file formats: CSV (.csv), NumPy (.npy), and Excel (.xlsx) files.
Download
pip install md_table_writer
Overview
Program processes text from data files and processes them into row-ordered table(s) with column headers. The table is written to a Markdown file either at a specific line number or appended to the end of the file.
CSV and Excel: Users have the option to specify which column headers from the file to process. If left unspecified, the package will process all columns. The package assumes the first row in the file is column headers.
Excel: For Excel files, a new table is generated for every sheet. There is an additional option to specify what sheet names to generate tables for. If left unspecified, every sheet will be processed.
NumPy: Unlike the other two file types, it is required to specify column headers. The first row in the matrix should not be the intended column headers. The number of column headers must match the number of columns in the matrix.
Usage
md_table_writer f md -cols -sheets -align -line -append
| Argument | Description | Required? | Default | Example |
|---|---|---|---|---|
| f | Data file | Yes | data.xlsx | |
| md | Markdown file | Yes | report.md | |
| -cols | List of column headers to include from data file | No, unless data file is a NumPy file | -cols Time Population | |
| -sheets | List of sheets from Excel file to write tables for | No | -sheets Sheet1 Sheet2 | |
| -align | Table column alignment options: left, center, or right | No | center | -align right |
| -line | Line number in Markdown file to write table to | No | end of file | -line 50 |
| -append | Flag to write table at end of Markdown file | No | False | -append |
Examples
md_table_writer data.xlsx report.md -cols Time Population -sheets Sheet1 Sheet2 -align right -line 50
Generates two tables for Sheet1 and Sheet2 with columns Time and Population from data.xlsx. The table's columns are right aligned. The table is written on line 50 in report.md.
md_table_writer data.csv report.md -align left -append
Generates one table with columns Time and Population from data.csv. The table's columns are left aligned. The table is written to the end of report.md.
md_table_writer data.npy report.md -cols Time Population -line 50
Generates one table from the 2D matrix in data.npy with column headers Time and Population. The table's columns are center aligned. The table is written on line 50 in report.md.
Release files for md-table-writer 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| md_table_writer-0.1.3.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| md_table_writer-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / md_table_writer-0.1.3.tar.gz
| Download URL | md_table_writer-0.1.3.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
076eaa888c1144072a6f9250eb679ad695e616b6b91258a0fa66f8a9b68562c2
|
|
BLAKE2b-256 checksum How to use checksums |
a010236956c0b877929c3a098d26273d55650ca54b07c570164520fb9c6721a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / md_table_writer-0.1.3-py3-none-any.whl
| Download URL | md_table_writer-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85d1c32b8870de673dfad59cf92f918ab66019515a41bdb56efd0c32522e7e45
|
|
BLAKE2b-256 checksum How to use checksums |
e298284b1706037a175a0179a67f86f2523b8d46606444ba8bb8ace3e05ff824
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|