Skip to main content

termcharts

Terminal charts with rich compatibility in mind

bar

import termcharts


chart1 = termcharts.bar({'roll': 24, 'bread':10, 'rice':30, 'pasta':50}, title='brunches')
chart2 = termcharts.bar({'roll': 24, 'bread':10, 'rice':30, 'pasta':50}, title='brunches', mode='v') # vertical
chart3 = termcharts.bar([10, 20, 30, 40], title='brunches') # from list
print(chart1)
print(chart2)
print(chart3)

Pie

import termcharts


chart = termcharts.pie({'pencil':10, 'eraser': 20, 'ruler': 30}, title='stationary')
print(chart)

Doughnut

import termcharts


chart = termcharts.doughnut({'a':10, 'b': 20, 'c': 30}, title='aphabet dist')
print(chart)

Rich compatibility

from termcharts import pie
from termcharts import doughnut
from termcharts import bar

from rich.console import Console
from rich.columns import Columns
from rich.panel import Panel

console = Console()

charts = [
    doughnut({'a':10, 'b': 20, 'c': 30, 'd': 20}, title='aphabet dist', rich=True),
    pie({'wefwefqwddwqdqwda':10, 'b': 20, 'c': 30, 'd': 20}, rich=True),
    bar({'roll': 24, 'bss':10, 'wes':30, 'ewfwef':50}, title='Brunches', rich=True)
    ]
user_renderables = [Panel(x, expand=True) for x in charts]
console.print(Columns(user_renderables))

Testing

All testing is currently handled by the pytest module and are incomplete at the momment.

Installation:

pip install -U pytest

Run all the testcases in a file:

pytest tests/<file>.py

Run one testcase in a file:

pytest tests/<file>.py::<function_name>

Exclude one testcase in a file:

pytest tests/<file>.py -k 'not <function_name>'

Metadata

Release files for termcharts 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for termcharts 1.1.2
File Size Uploaded Provenance Actions
termcharts-1.1.2.tar.gz 32.3 kB Without provenance Details for termcharts-1.1.2.tar.gz

Release files / termcharts-1.1.2.tar.gz

Download URL termcharts-1.1.2.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8e7d3849f663ccfa284aa75ad5c583f96b30aa3d542af238dbb3b2b57d19b411
BLAKE2b-256 checksum
How to use checksums
81d6676523937d86ad75401ed041b519eb25bf2fc09aa2d71cf10b0f12847fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Security for termcharts 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page