Skip to main content

markdown-table

markdown-table programatically 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 appendeded 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

markdown-table 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

markdown-table 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.

markdown-table 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.

markdown-table 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 onen line 50 in report.md.

Release files for md-table-writer 0.1.1

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

Source distribution (sdist)

Source distribution for md-table-writer 0.1.1
File Size Uploaded
md_table_writer-0.1.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for md-table-writer 0.1.1
File Interpreter ABI Platform
md_table_writer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / md_table_writer-0.1.1.tar.gz

Download URL md_table_writer-0.1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6dc40cf844e4daf404636ee06ddc42db249cc43a48879763bd050325e673ad78
BLAKE2b-256 checksum
How to use checksums
8ee641dee5a00c04c54f1319501d8972b65b3256d293f6df4cde6c3329be961f
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.1-py3-none-any.whl

Download URL md_table_writer-0.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc86e9bd0c7384b8fc148d3a5948834d2238c66a9dbbed5f7cf7a30a579701c3
BLAKE2b-256 checksum
How to use checksums
f5964dbec3b01fba0d7e54f5842f8ffd54740f24855743cf3ca2a7267fe89c47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

1.1.0

2 release files

1.0.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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