Skip to content

drofford/python-flex-text-table

 
 

Repository files navigation

Flex Text Table

#####.##....#####.##...##...######.#####.##...##.######...######...#....#####..##....#####
##....##....##.....##.##......##...##.....##.##....##.......##....###...##..##.##....##...
##....##....##......###.......##...##......###.....##.......##...##.##..##..##.##....##...
####..##....####.....#........##...####.....#......##.......##..##...##.#####..##....####.
##....##....##......###.......##...##......###.....##.......##..#######.##..##.##....##...
##....##....##.....##.##......##...##.....##.##....##.......##..##...##.##..##.##....##...
##....#####.#####.##...##.....##...#####.##...##...##.......##..##...##.#####..#####.#####

Fast and flexible Pyhon library for text tables.

Unit tests MD Lint GitHub issues

PyPI version PyPI - Downloads Python Version License: MIT

There's also PHP version of ths library.


Table of contents

  1. Features
  2. Installation & requirements
  3. Examples
  4. License

Features

  1. Simple API, easy to use,
  2. Lightweight (no additional dependencies),
  3. Production ready.

Usage examples

Simples possible usage:

from flextable.table import FlexTable       # Import FlexTable root class

table = 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:

┌────┬───────┬───────┐
│ ID │ NAME  │ SCORE │
├────┼───────┼───────┤
│ 1  │ John  │ 12    │
│ 2  │ Tommy │ 15    │
└────┴───────┴───────┘

See more usage examples.


License

  • Written and copyrighted ©2023 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
  • Flex Text Table is open-sourced software licensed under the MIT license

About

Feature rich, fast and flexible Python library for rendering table data as nice text tables.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Shell 0.5%