Skip to main content

Ready-made rich tables for various purposes

Project description

Coverage Status

Rich tables

JSON human-prettifier based on the brilliant rich python library.

Since my usual day involves building and interacting with various APIs, JSON data is constantly flying around the terminal. Reading JSON data (even when it's prettified by, say, jq) requires a fair bit of mental effort; and it's basically impossible to analyse / make sense of it just by looking at it.

This project initially started as a way to solve this issue – it takes JSON data as an input and prints it in (rich-)tables, making it somewhat more readable for humans. With time, it's become the main handler for most of structured data that gets displayed in my terminal and is now one of my core every day tools.

Releases

It's WIP but installable through pip: pip install rich-tables – feel free test it but do not expect it to be stable yet.

If we have enough interest, I am more than happy to prepare a release with a somewhat stable API.

Some bits to be aware of

Most commits are made by a daily cron job

You will find commits named

Automatic backup <date>

There is a daily cronjob which checks my local copy of the repository for changes, commits, and pushes them upstream.

It got setup because this entire thing got built without intention – whenever I came across data that was not handled by rich-tables, I opened the code, quickly added the logic and continued on with the original work without committing. Eventually, I'd have to deal with a huge diff with a lot of unrelated changes.

Tests simply attempt to render data in each test case without making any assertions
  • At least at this point I only want to know whether every piece of data is rendered fine.
For each tests/json/<name>.json test case, the rendered output is saved to svgs/<name>.svg file
  • Allows to see the visual difference a certain change makes
  • Helps to detect unintended side effects: if we're expecting an update of album.svg only but see that pr.svg is also updated, we know something's not right
  • In commit details, GitHub shows visual difference for svg file changes
    • This is very helpful when one is trying to track down the culprit behind some missing border
README is populated with pictures dynamically when tests pass
  • Once tests finish successfully, a subsection is added for every picture in the svgs/ folder (in the alphabetical order). case.svg would be found under the subsection Case.
  • This logic lives in a session-scoped pytest fixture, after the yield statement.

Examples

Album

image

Albums

image

Calendar

image

Diff

image

Emails

image

Hue

image

Jira diff

image

Music list

image

Nested arrays

image

Nested JSON

image

Pr

image

Simple JSON

image

Sql

image

Tasks

image

Text diff

image

Timed

image

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

rich_tables-0.7.4.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

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

rich_tables-0.7.4-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file rich_tables-0.7.4.tar.gz.

File metadata

  • Download URL: rich_tables-0.7.4.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.11 Linux/6.13.8-arch1-1

File hashes

Hashes for rich_tables-0.7.4.tar.gz
Algorithm Hash digest
SHA256 ae50cec19c46dc51288d9039eaa52c41cb5674f1944e8bbd7541caf3eb3f7eed
MD5 24803677724d481364da2a973baf9408
BLAKE2b-256 9167890249b81e36a8854471f8e310e51f64bcf915ec3dc42c1f96b5b0d5621b

See more details on using hashes here.

File details

Details for the file rich_tables-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: rich_tables-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.11 Linux/6.13.8-arch1-1

File hashes

Hashes for rich_tables-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee036175b1508a617be615b1dcc991a218f6676bb33bc700ee3ad86c27c9891
MD5 3faef636952c1ce2eacb1980d80af2a6
BLAKE2b-256 c170deec7a644fe999c249d86eb2b815d7d00d15cb96bea1e42f24df5ac1a79f

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