https://github.com/jhermann/tablemate
:construction: [ALPHA] Prettify your tabular data, either on the command line or in Python code.
https://github.com/jhermann/tablemate
Last synced: 5 months ago
JSON representation
:construction: [ALPHA] Prettify your tabular data, either on the command line or in Python code.
- Host: GitHub
- URL: https://github.com/jhermann/tablemate
- Owner: jhermann
- License: apache-2.0
- Created: 2015-04-13T00:15:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-03-18T10:17:33.000Z (over 8 years ago)
- Last Synced: 2025-06-27T23:35:22.959Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Tablemate
 | Prettify your tabular data using the shell or Python code.
:----: | :----
**Project** | [](https://github.com/jhermann/tablemate/blob/master/LICENSE) [](https://pypi.python.org/pypi/tablemate/)
**QA** | [](https://travis-ci.org/jhermann/tablemate) [](https://coveralls.io/r/jhermann/tablemate) [](https://github.com/jhermann/tablemate/issues)
**Release** | [](https://pypi.python.org/pypi/tablemate/) [](https://pypi.python.org/pypi/tablemate/)
## Overview
### Introduction
To get that out of the way… *Why another table prettifier library?*
Well, I wanted one that fulfilled my requirements, was actively maintained,
and fully tested plus Py2/3 portable.
### Requirements (draft)
**General**
* **Ease of use.**
* Strict division between data and style.
* Support for parsing data from common formats (via ``tablib`` and others).
* Serializing the data to a large choice of output formats (again mostly via ``tablib``).
* Output to markup languages (``.rst``, ``.md``, …).
**API**
* Streaming (with fixed column widths, and wrapping or cuts).
* A `.lines()` generator.
* Fluent API? (`table().headers(…).repeat(24).…`)
**Styling**
* Unicode borders, with a configurable fallback to ASCII only.
* Table titles (above column headers).
* Table footer with stats (sum, avg, …).
* Terminal colors (via ``colorama``).
* Auto-mode for terminal size.
* Compact style (no borders).
* Repeat column headers (use terminal rows as a default).
## Installation
*Tablemate* can be installed via ``pip install tablemate`` as usual,
see [releases](https://github.com/jhermann/tablemate/releases) for an overview of available versions.
To get a bleeding-edge version from source, use these commands:
```sh
repo="jhermann/tablemate"
pip install -r "https://raw.githubusercontent.com/$repo/master/requirements.txt"
pip install -UI -e "git+https://github.com/$repo.git#egg=${repo#*/}"
```
See [Contributing](#contributing) on how to create a full development environment.
To add bash completion, read the [Click docs](http://click.pocoo.org/4/bashcomplete/#activation) about it,
or just follow these instructions:
```sh
cmdname=tbm
mkdir -p ~/.bash_completion.d
( export _$(tr a-z- A-Z_ <<<"$cmdname")_COMPLETE=source ; \
$cmdname >~/.bash_completion.d/$cmdname.sh )
grep /.bash_completion.d/$cmdname.sh ~/.bash_completion >/dev/null \
|| echo >>~/.bash_completion ". ~/.bash_completion.d/$cmdname.sh"
. "/etc/bash_completion"
```
## Usage
…
## Contributing
To create a working directory for this project, call these commands:
```sh
git clone "https://github.com/jhermann/tablemate.git"
cd "tablemate"
. .env --yes --develop
invoke build --docs test check
```
See [CONTRIBUTING](https://github.com/jhermann/tablemate/blob/master/CONTRIBUTING.md) for more.
## Similar Projects
* [prettytable](https://code.google.com/p/prettytable/) – Represent tabular data in visually appealing ASCII tables.
* https://github.com/kxxoling/PrettyTable (in sync)
* https://github.com/adamlamers/prettytable (in sync, with a formatted README)
* https://github.com/dprince/python-prettytable (outdated fork)
## References
**Tools**
* [Cookiecutter](http://cookiecutter.readthedocs.io/en/latest/)
* [PyInvoke](http://www.pyinvoke.org/)
* [pytest](http://pytest.org/latest/contents.html)
* [tox](https://tox.readthedocs.io/en/latest/)
* [Pylint](http://docs.pylint.org/)
* [twine](https://github.com/pypa/twine#twine)
* [bpython](http://docs.bpython-interpreter.org/)
* [yolk3k](https://github.com/myint/yolk#yolk)
**Packages**
* [Rituals](https://jhermann.github.io/rituals)
* [Click](http://click.pocoo.org/)
## Acknowledgements
…