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.

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.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 md-table-writer 0.1.0
File Size Uploaded
md_table_writer-0.1.0.tar.gz 6.8 kB Details

Built distribution (wheel)

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

Total release size: 13.0 kB

Release files / md_table_writer-0.1.0.tar.gz

Download URL md_table_writer-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
517701a67a2a9629ba5e31f966626549a3699bc65ab9027f8366434b20a91430
BLAKE2b-256 checksum
How to use checksums
d98988ac5c90ddbcfabadab4824eb6b0b83af2670c35b8bbc6952dc351c8e031
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.0-py3-none-any.whl

Download URL md_table_writer-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dba8cd9ed69847cd88da5081c49fca163e9b129a16a8ad34a8537c78ebd6e048
BLAKE2b-256 checksum
How to use checksums
711491ba61b51f54cb39d838d6b31edd9d330d3018aa16b998cd8116ad77315e
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

0.1.1

2 release files

This release

0.1.0 This release

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