Skip to main content

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

Object arrays

image

Open prs

image

Pr

image

Simple JSON

image

Sql

image

Tasks

image

Text diff

image

Timed

image

Release files for rich-tables 0.10.0

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

Source distribution (sdist)

Source distribution for rich-tables 0.10.0
File Size Uploaded
rich_tables-0.10.0.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rich-tables 0.10.0
File Interpreter ABI Platform
rich_tables-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.9 kB

Release files / rich_tables-0.10.0.tar.gz

Download URL rich_tables-0.10.0.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cdb1cfd1faea3e656f1b575d63e1a6ddf321098b33ac47176ce55b5cd82383d3
BLAKE2b-256 checksum
How to use checksums
39e68c07095dd7692e56c3ebbdc2a2681f87eae2bac24eba9506600dc7ef7075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.11 Linux/7.0.13-arch1-1

Release files / rich_tables-0.10.0-py3-none-any.whl

Download URL rich_tables-0.10.0-py3-none-any.whl
Size 35.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd1cc3833a05a5032baeab97ba32c8f1670817bf914dc2fc50a42b3ab8521c32
BLAKE2b-256 checksum
How to use checksums
baa2341d0dc8b911ff9b713d5df41723fa8164ab755441469556097314637c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.11 Linux/7.0.13-arch1-1

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

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