texttable

Python module to create simple ASCII tables

https://github.com/foutaise/texttable

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.3%) to scientific vocabulary

Keywords from Contributors

closember diagrams diagrams-as-code flowchart mindmap uml-diagrams
Last synced: 10 months ago · JSON representation

Repository

Python module to create simple ASCII tables

Basic Info
  • Host: GitHub
  • Owner: foutaise
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 146 KB
Statistics
  • Stars: 358
  • Watchers: 8
  • Forks: 44
  • Open Issues: 0
  • Releases: 26
Created over 10 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Changelog License

README.md

texttable

Python module to create simple ASCII tables

Availability

This module is available on PyPI, and has been packaged for several Linux/Unix platforms (Debian, FreeBSD, Fedora, Suse...).

Dependencies

If available, cjkwrap library is used instead of textwrap, for a better wrapping of CJK text.

If available, wcwidth library is used for a better rendering (basic emoji support).

Documentation

``` NAME texttable - module to create simple ASCII tables

FILE /usr/local/lib/python2.7/dist-packages/texttable.py

DESCRIPTION

Example:

    table = Texttable()
    table.set_cols_align(["l", "r", "c"])
    table.set_cols_valign(["t", "m", "b"])
    table.add_rows([["Name", "Age", "Nickname"],
                    ["Mr\nXavier\nHuon", 32, "Xav'"],
                    ["Mr\nBaptiste\nClement", 1, "Baby"],
                    ["Mme\nLouise\nBourgeau", 28, "Lou\n\nLoue"]])
    print(table.draw())
    print()

    table = Texttable()
    table.set_deco(Texttable.HEADER)
    table.set_cols_dtype(['t',  # text
                          'f',  # float (decimal)
                          'e',  # float (exponent)
                          'i',  # integer
                          'a']) # automatic
    table.set_cols_align(["l", "r", "r", "r", "l"])
    table.add_rows([["text",    "float", "exp", "int", "auto"],
                    ["abcd",    "67",    654,   89,    128.001],
                    ["efghijk", 67.5434, .654,  89.6,  12800000000000000000000.00023],
                    ["lmn",     5e-78,   5e-78, 89.4,  .000000000000128],
                    ["opqrstu", .023,    5e+78, 92.,   12800000000000000000000]])
    print(table.draw())

Result:

    +----------+-----+----------+
    |   Name   | Age | Nickname |
    +==========+=====+==========+
    | Mr       |     |          |
    | Xavier   |  32 |          |
    | Huon     |     |   Xav'   |
    +----------+-----+----------+
    | Mr       |     |          |
    | Baptiste |   1 |          |
    | Clement  |     |   Baby   |
    +----------+-----+----------+
    | Mme      |     |   Lou    |
    | Louise   |  28 |          |
    | Bourgeau |     |   Loue   |
    +----------+-----+----------+

     text     float       exp      int     auto
    ==============================================
    abcd      67.000   6.540e+02    89   128.001
    efghijk   67.543   6.540e-01    90   1.280e+22
    lmn        0.000   5.000e-78    89   0.000
    opqrstu    0.023   5.000e+78    92   1.280e+22

CLASSES class Texttable | Methods defined here: | | init(self, maxwidth=80) | Constructor | | - maxwidth is an integer, specifying the maximum width of the table | - if set to 0, size is unlimited, therefore cells won't be wrapped | | addrow(self, array) | Add a row in the rows stack | | - cells can contain newlines and tabs | | addrows(self, rows, header=True) | Add several rows in the rows stack | | - The 'rows' argument can be either an iterator returning arrays, | or a by-dimensional array | - 'header' specifies if the first row should be used as the header | of the table | | draw(self) | Draw the table | | - the table is returned as a whole string | | header(self, array) | Specify the header of the table | | reset(self) | Reset the instance | | - reset rows and header | | setchars(self, array) | Set the characters used to draw lines between rows and columns | | - the array should contain 4 fields: | | [horizontal, vertical, corner, header] | | - default is set to: | | ['-', '|', '+', '='] | | setcolsalign(self, array) | Set the desired columns alignment | | - the elements of the array should be either "l", "c" or "r": | | * "l": column flushed left | * "c": column centered | * "r": column flushed right | | setcolsdtype(self, array) | Set the desired columns datatype for the cols. | | - the elements of the array should be either a callable or any of | "a", "t", "f", "e" or "i": | | * "a": automatic (try to use the most appropriate datatype) | * "t": treat as text | * "f": treat as float in decimal format | * "e": treat as float in exponential format | * "i": treat as int | * "b": treat as boolean | * a callable: should return formatted string for any value given | | - by default, automatic datatyping is used for each column | | setcolsvalign(self, array) | Set the desired columns vertical alignment | | - the elements of the array should be either "t", "m" or "b": | | * "t": column aligned on the top of the cell | * "m": column aligned on the middle of the cell | * "b": column aligned on the bottom of the cell | | setcolswidth(self, array) | Set the desired columns width | | - the elements of the array should be integers, specifying the | width of each column. For example: | | [10, 20, 5] | | setdeco(self, deco) | Set the table decoration | | - 'deco' can be a combination of: | | Texttable.BORDER: Border around the table | Texttable.HEADER: Horizontal line below the header | Texttable.HLINES: Horizontal lines between rows | Texttable.VLINES: Vertical lines between columns | | All of them are enabled by default | | - example: | | Texttable.BORDER | Texttable.HEADER | | setheaderalign(self, array) | Set the desired header alignment | | - the elements of the array should be either "l", "c" or "r": | | * "l": column flushed left | * "c": column centered | * "r": column flushed right | | setmaxwidth(self, maxwidth) | Set the maximum width of the table | | - maxwidth is an integer, specifying the maximum width of the table | - if set to 0, size is unlimited, therefore cells won't be wrapped | | set_precision(self, width) | Set the desired precision for float/exponential formats | | - width must be an integer >= 0 | | - default value is set to 3 | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | BORDER = 1 | | HEADER = 2 | | HLINES = 4 | | VLINES = 8

DATA all = ['Texttable', 'ArraySizeError'] author = 'Gerome Fournier ' credits = 'Jeff Kowalczyk:\n - textwrap improved import\n ...at... license = 'MIT' version = '1.7.0'

VERSION 1.7.0

AUTHOR Gerome Fournier

CREDITS Jeff Kowalczyk: - textwrap improved import - comment concerning header output

Anonymous:
    - add_rows method, for adding rows in one go

Sergey Simonenko:
    - redefined len() function to deal with non-ASCII characters

Roger Lew:
    - columns datatype specifications

Brian Peterson:
    - better handling of unicode errors

Frank Sachsenheim:
    - add Python 2/3-compatibility

Maximilian Hils:
    - fix minor bug for Python 3 compatibility

frinkelpi:
    - preserve empty lines

```

Forks

  • latextable is a fork of texttable that provide a LaTeX backend.

Owner

  • Name: Gérôme Fournier
  • Login: foutaise
  • Kind: user

GitHub Events

Total
  • Watch event: 13
Last Year
  • Watch event: 13

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 90
  • Total Committers: 10
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.289
Past Year
  • Commits: 6
  • Committers: 2
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
Gerome Fournier j****f@f****g 64
david weil t****i@g****m 7
Jonas Görlich j****c@u****e 5
Hugo h****k 5
Robin Gustafsson g****t@r****e 3
Wasim Thabraze w****m@t****e 2
Marcel Schnirring m****g@m****e 1
endolith e****h@g****m 1
Mantas s****s@g****m 1
Simeon Visser s****r 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 52
  • Total pull requests: 38
  • Average time to close issues: 8 days
  • Average time to close pull requests: 24 days
  • Total issue authors: 47
  • Total pull request authors: 25
  • Average comments per issue: 1.71
  • Average comments per pull request: 1.79
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: about 18 hours
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jayvdb (3)
  • CaledoniaProject (3)
  • slavkoja (2)
  • cclauss (1)
  • a22349 (1)
  • ZsemberiDaniel (1)
  • MohamedAliRashad (1)
  • waseem18 (1)
  • FirePing32 (1)
  • shotah (1)
  • vincent-lg (1)
  • felixonmars (1)
  • csernazs (1)
  • sirex (1)
  • discosultan (1)
Pull Request Authors
  • hugovk (8)
  • rgson (3)
  • tenuki (3)
  • igalic (2)
  • yanxurui (2)
  • philiptzou (1)
  • darkdragon-001 (1)
  • JAEarly (1)
  • LordJakson (1)
  • ntsirakis (1)
  • bmschwa (1)
  • devlights (1)
  • KOLANICH (1)
  • waseem18 (1)
  • graingert (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 24
  • Total downloads:
    • pypi 14,451,937 last-month
  • Total docker downloads: 1,006,108,101
  • Total dependent packages: 152
    (may contain duplicates)
  • Total dependent repositories: 6,366
    (may contain duplicates)
  • Total versions: 94
  • Total maintainers: 2
pypi.org: texttable

module to create simple ASCII tables

  • Versions: 29
  • Dependent Packages: 130
  • Dependent Repositories: 6,338
  • Downloads: 14,451,937 Last month
  • Docker Downloads: 1,006,108,101
Rankings
Docker downloads count: 0.0%
Downloads: 0.1%
Dependent repos count: 0.1%
Dependent packages count: 0.1%
Average: 1.6%
Stargazers count: 3.5%
Forks count: 6.0%
Maintainers (1)
Last synced: 10 months ago
alpine-v3.18: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 7.5%
Stargazers count: 13.8%
Forks count: 16.1%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.18: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 7.5%
Stargazers count: 13.8%
Forks count: 16.1%
Maintainers (1)
Last synced: 11 months ago
proxy.golang.org: github.com/foutaise/texttable
  • Versions: 26
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 11 months ago
alpine-v3.12: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 7.2%
Forks count: 9.0%
Average: 9.4%
Dependent packages count: 21.5%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.13: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 8.5%
Average: 9.6%
Forks count: 10.3%
Dependent packages count: 19.5%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.11: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 7.1%
Forks count: 8.8%
Average: 9.6%
Dependent packages count: 22.6%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.14: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 8.7%
Average: 10.2%
Forks count: 10.5%
Dependent packages count: 21.7%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.10: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 6.6%
Forks count: 8.4%
Average: 11.1%
Dependent packages count: 29.6%
Maintainers (1)
Last synced: 11 months ago
alpine-edge: py3-texttable

module for creating simple ASCII tables

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 11.6%
Dependent packages count: 14.6%
Stargazers count: 15.0%
Forks count: 16.9%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.15: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 9.6%
Forks count: 11.4%
Average: 11.6%
Dependent packages count: 25.6%
Maintainers (1)
Last synced: 11 months ago
alpine-edge: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 11.9%
Dependent packages count: 14.1%
Stargazers count: 15.6%
Forks count: 17.8%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.16: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 10.3%
Forks count: 12.2%
Average: 12.5%
Dependent packages count: 27.3%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.17: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 12.7%
Average: 13.6%
Forks count: 14.6%
Dependent packages count: 27.3%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: texttable

texttable is a module to generate a formatted text table, using ASCII characters.

  • Versions: 12
  • Dependent Packages: 18
  • Dependent Repositories: 14
Rankings
Dependent packages count: 3.5%
Dependent repos count: 9.4%
Average: 15.1%
Stargazers count: 21.5%
Forks count: 26.1%
Last synced: 11 months ago
anaconda.org: texttable

texttable is a module to generate a formatted text table, using ASCII characters.

  • Versions: 2
  • Dependent Packages: 3
  • Dependent Repositories: 14
Rankings
Dependent packages count: 15.1%
Average: 30.9%
Stargazers count: 34.4%
Dependent repos count: 35.3%
Forks count: 38.7%
Last synced: 11 months ago
alpine-v3.19: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.19: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 11 months ago
alpine-v3.20: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.22: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.20: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.22: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.21: py3-texttable-pyc

Precompiled Python bytecode for py3-texttable

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.21: py3-texttable

module for creating simple ASCII tables

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago

Dependencies

setup.py pypi