Metadata-Version: 2.4
Name: fmt-md-tables
Version: 0.1.0
Summary: Format markdown tables in a file so columns align.
Project-URL: Homepage, https://github.com/veeso/fmt-md-tables
Author-email: Christian Visintin <christian.visintin@veeso.dev>
License: MIT License
        
        Copyright (c) 2026 Christian Visintin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: formatter,markdown,tables
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# fmt-md-tables

[![license-mit](https://img.shields.io/pypi/l/fmt-md-tables.svg?logo=python)](https://opensource.org/licenses/MIT)
[![repo-stars](https://img.shields.io/github/stars/veeso/fmt-md-tables?style=flat)](https://github.com/veeso/fmt-md-tables/stargazers)
[![downloads](https://img.shields.io/pypi/dm/fmt-md-tables.svg?logo=python)](https://pypi.org/project/fmt-md-tables/)
[![latest-version](https://img.shields.io/pypi/v/fmt-md-tables.svg?logo=python)](https://pypi.org/project/fmt-md-tables/)
[![python-versions](https://img.shields.io/pypi/pyversions/fmt-md-tables.svg?logo=python)](https://pypi.org/project/fmt-md-tables/)
[![conventional-commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

[![ci](https://github.com/veeso/fmt-md-tables/actions/workflows/ci.yml/badge.svg)](https://github.com/veeso/fmt-md-tables/actions)

Format markdown tables in a file so columns align.

## Install

With [uv](https://docs.astral.sh/uv/) — install as a global CLI tool:

```sh
uv tool install .
```

Editable / dev:

```sh
uv pip install -e .
```

Run without installing:

```sh
uvx --from . fmt-md-tables FILE
```

From PyPI (once published):

```sh
uv tool install fmt-md-tables
```

## Usage

```sh
fmt-md-tables FILE                 # print formatted output to stdout
fmt-md-tables FILE1 FILE2 ...      # process many files (concatenated to stdout)
fmt-md-tables -i FILE1 FILE2 ...   # rewrite each file in place
fmt-md-tables -                    # read from stdin
```

## Features

- Pads cells to max column width per table.
- Preserves alignment markers (`:---`, `:---:`, `---:`).
- Skips fenced code blocks (``` and `~~~`).
- Handles escaped pipes (`\|`).
- Pads short rows with empty cells.

## Example

Input:

```md
| Filter | Index plan | Notes |
|--------|-----------|-------|
| `Filter::eq("col", val)` | Exact match | Best case |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |
```

Output:

```md
| Filter                   | Index plan               | Notes                      |
| ------------------------ | ------------------------ | -------------------------- |
| `Filter::eq("col", val)` | Exact match              | Best case                  |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |
```

## License

MIT
