pytablewriter-altcol-theme 0.1.1


pip install pytablewriter-altcol-theme

  Latest version

Released: Oct 08, 2023


Meta
Author: Tsuyoshi Hombashi
Requires Python: >=3.7

Classifiers

Development Status
  • 4 - Beta

Environment
  • Plugins

Intended Audience
  • Developers
  • Information Technology

License
  • OSI Approved :: MIT License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3 :: Only

Topic
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

Summary

CI status of Linux/macOS/Windows Test coverage: coveralls CodeQL

pytablewriter-altcol-theme is a pytablewriter plugin to provide a terminal theme.

Installation

pip install pytablewriter-altcol-theme

Usage

Sample Code:
import pytablewriter as ptw

writer = ptw.TableWriterFactory.create_from_format_name(
    "markdown",
    headers=["INT", "STR"],
    value_matrix=[
        [1, "hoge"],
        [2, "foo"],
        [3, "bar"],
    ],
    margin=1,
    theme="altcol",
)
writer.write_table()

You can change the color of the theme by using the color parameter:

Sample Code:
import pytablewriter as ptw

writer = ptw.TableWriterFactory.create_from_format_name(
    "markdown",
    headers=["INT", "STR"],
    value_matrix=[
        [1, "hoge"],
        [2, "foo"],
        [3, "bar"],
    ],
    margin=1,
)

writer.set_theme("altcol", color="yellow")

writer.write_table()

Other Examples

Dependencies

Extras:
Dependencies:
pytablewriter (<2,>=0.59.0)
tcolorpy (<1,>=0.1)