Skip to main content

Fast and flexible Pyhon library for text tables.

Project description

Flex Text Table

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

Fast and flexible Pyhon library for text tables.

PyPI version PyPI - Downloads Python Version License: MIT

There's also PHP version of ths library.


Features

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

Usage example

Simplest 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 in project docs.


License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flex-text-table-2.7.0.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

flex_text_table-2.7.0-py3-none-any.whl (26.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page