Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcinorlowski/python-flex-text-table
Feature rich, fast and flexible Python library for rendering table data as nice text tables.
https://github.com/marcinorlowski/python-flex-text-table
Last synced: 3 days ago
JSON representation
Feature rich, fast and flexible Python library for rendering table data as nice text tables.
- Host: GitHub
- URL: https://github.com/marcinorlowski/python-flex-text-table
- Owner: MarcinOrlowski
- License: other
- Created: 2023-04-11T20:30:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-15T20:00:33.000Z (about 1 year ago)
- Last Synced: 2024-11-20T10:11:47.142Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README-pypi.md
- Changelog: CHANGES.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flex Text Table
```ascii
#####.##....#####.##...##...######.#####.##...##.######...######...#....#####..##....#####
##....##....##.....##.##......##...##.....##.##....##.......##....###...##..##.##....##...
##....##....##......###.......##...##......###.....##.......##...##.##..##..##.##....##...
####..##....####.....#........##...####.....#......##.......##..##...##.#####..##....####.
##....##....##......###.......##...##......###.....##.......##..#######.##..##.##....##...
##....##....##.....##.##......##...##.....##.##....##.......##..##...##.##..##.##....##...
##....#####.#####.##...##.....##...#####.##...##...##.......##..##...##.#####..#####.#####
```Fast and flexible Pyhon library for text tables.
[![PyPI version](https://badge.fury.io/py/flex-text-table.svg)](https://badge.fury.io/py/flex-text-table)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/flex-text-table?style=plastic)](https://pypi.org/project/flex-text-table/)
[![Python Version](https://img.shields.io/pypi/pyversions/flex-text-table.svg)](https://pypi.org/project/flex-text-table/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)There's also [PHP version of ths library](https://github.com/MarcinOrlowski/php-text-table).
---
## Features
1. Simple API, easy to use,
2. Lightweight (no additional dependencies),
3. Production ready.---
## Usage example
Simplest possible usage:
```python
from flextable.table import FlexTable # Import FlexTable root classtable = FlexTable(['ID', 'NAME', 'SCORE']) # Define table with 3 columns
table.add_rows([
[1, 'John', 12], # Add 2 rows, 3 columns each
[2, 'Tommy', 15],
])
print(table.render()) # Render table as string and print
```would produce nice text table:
```ascii
┌────┬───────┬───────┐
│ ID │ NAME │ SCORE │
├────┼───────┼───────┤
│ 1 │ John │ 12 │
│ 2 │ Tommy │ 15 │
└────┴───────┴───────┘
```See more usage examples in [project docs](https://github.com/MarcinOrlowski/python-flex-text-table/).
---
## License
* Written and copyrighted ©2023 by Marcin Orlowski
* Flex Text Table is open-sourced software licensed under
the [MIT license](http://opensource.org/licenses/MIT)