Skip to main content

A pytablewriter plugin to provide a theme that colored rows alternatively.

Project description

Summary

PyPI package version Supported Python versions Supported Python implementations CI status of Linux/macOS/Windows Test coverage: coveralls

pytablewriter-altrow-theme is a pytablewriter plugin to provide a theme that colored rows alternatively.

Installation

pip install pytablewriter-altrow-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="altrow",
)
writer.write_table()
Output:
https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_default.png

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("altrow", color="yellow")

writer.write_table()
Output:
https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_yellow.png

Other Examples

Dependencies

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

pytablewriter-altrow-theme-0.2.0.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

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