Skip to main content

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

Project description

.. contents:: **pytablewriter-altrow-theme**
:backlinks: top
:depth: 2


Summary
============================================
.. image:: https://badge.fury.io/py/pytablewriter-altrow-theme.svg
:target: https://badge.fury.io/py/pytablewriter-altrow-theme
:alt: PyPI package version

.. image:: https://img.shields.io/pypi/pyversions/pytablewriter-altrow-theme.svg
:target: https://pypi.org/project/pytablewriter-altrow-theme
:alt: Supported Python versions

.. image:: https://img.shields.io/pypi/implementation/pytablewriter-altrow-theme.svg
:target: https://pypi.org/project/pytablewriter-altrow-theme
:alt: Supported Python implementations

.. image:: https://github.com/thombashi/pytablewriter-altrow-theme/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/pytablewriter-altrow-theme/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows

.. image:: https://coveralls.io/repos/github/thombashi/pytablewriter-altrow-theme/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/pytablewriter-altrow-theme?branch=master
:alt: Test coverage: coveralls

``pytablewriter-altrow-theme`` is a `pytablewriter <https://github.com/thombashi/pytablewriter>`__ plugin to provide a theme that colored rows alternatively.


Installation
============================================
::

pip install pytablewriter-altrow-theme

Usage
============================================

:Sample Code:
.. code-block:: python

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:
.. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter-altrow-theme@master/ss/ptw-altrow-theme_example_default.png
:scale: 100%
:alt: 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:
.. code-block:: python

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:
.. figure:: https://cdn.jsdelivr.net/gh/thombashi/pytablewriter-altrow-theme@master/ss/ptw-altrow-theme_example_yellow.png
:scale: 100%
:alt: https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_yellow.png


Other Examples
--------------------------------------------
- HTML example: `source file <https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/examples/write_html.py>`__ and `the output <https://thombashi.github.io/pytablewriter-altrow-theme/example.html>`__


Dependencies
============================================
- Python 3.7+
- `Python package dependencies (automatically installed) <https://github.com/thombashi/pytablewriter-altrow-theme/network/dependencies>`__


Related Projects
============================================
- `pytablewriter <https://github.com/thombashi/pytablewriter>`__
- `pytablewriter-altcol-theme <https://github.com/thombashi/pytablewriter-altcol-theme>`__

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytablewriter_altrow_theme-0.2.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pytablewriter-altrow-theme-0.2.0.tar.gz.

File metadata

File hashes

Hashes for pytablewriter-altrow-theme-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f30617d423259a02081182677bc0abefe0a91015da44b71f7c0f8324dc480a4d
MD5 4e697fbfcc93a0dd8789804f6898cb3e
BLAKE2b-256 9d8d144c978726e61b0b30a065ce3cb2ed9810fa08a8102a59029b447272c9e4

See more details on using hashes here.

File details

Details for the file pytablewriter_altrow_theme-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytablewriter_altrow_theme-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d508866d2904130f6d3164067386d8442fb22ab4bf1a14f2c2fdd7083ec81084
MD5 826c4434fdf3ff3c18808114c9aca23a
BLAKE2b-256 2f18f55b6f7bce415245eb98b5b3162220158ae767040beeda3da538138fb652

See more details on using hashes here.

Supported by

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