Skip to main content

Yet another pretty printer for tables and trees

Project description

yappt

Yet another pretty printer for tables and trees.

Note: Versions 0.3.0 and later aren't compatible with earlier versions

A collection of classes and functions to format textual data for printing. The main functions (tabulate and treeiter) do not require reading entire dataset into memory, allowing printing large amount of data in streaming fashion.

Class Capabilities
PrettyInt When formatted, returns human-readable value. It can either show K,M,G suffix or exponential notation
Duration When formatted, returns a value that shows duration in hours, minutes and seconds.
Function Capabilities
tabulate Pretty prints an iterable of either dataclass objects or iterable of sequences of strings as a table
tabulate_iter Like tabulate but returns an iterable over formatted lines of text instead of printing it
treeiter Returns an iterable over tuples of formatted representation of tree node and the original node
strip_pfx strips a common prefix from all substrings that are separated by new-lines
indent indents all substrings that are separated by new-lines
iter_more accepts an iterable and returns a new iterable that returns original item and a more items indicator
format_bool format boolean values as unicode "✓" and "✗" code points

Refer to tests/ folder for examples and usage

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

yappt-0.3.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

yappt-0.3.2-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file yappt-0.3.2.tar.gz.

File metadata

  • Download URL: yappt-0.3.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for yappt-0.3.2.tar.gz
Algorithm Hash digest
SHA256 57ad705621551df52766c6daec774509dee7be3d10d99f908a0775fbd309381f
MD5 ad070f131428a82824cf8a900a9193bb
BLAKE2b-256 6ae65d96c85a4b4ff101e36528b261e735197d0d8f616f389edf66720b79a506

See more details on using hashes here.

File details

Details for the file yappt-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: yappt-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for yappt-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 534c724debd7903ea4ef24c3ad70a578ad771e6b063472cbc65f19f34e1453e2
MD5 1fd88382cd35903978b4845587769a76
BLAKE2b-256 7d461bdd7759894dd1d2d65433e0092359d4b274d9af7f509fb0e348ce4c8288

See more details on using hashes here.

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