🍫 cacao-json-viewer
A tiny desktop app to view JSON as an interactive tree using Cacao.
Installation
pip install cacao-json-viewer
Usage
Command Line Interface
# From a file
cacao-json-viewer path/to/data.json
# Or via stdin
cat data.json | cacao-json-viewer
Programmatic Usage 🍫
Now with simplified imports! Use the package directly in your Python code:
Basic Example
import json
from cacao_json_viewer import preview_json
# Load your JSON data
with open("data.json", "r") as f:
data = json.load(f)
# Preview it in a desktop window
preview_json(data, title="My JSON Data")
Alternative Import Syntax
import json
from cacao_json_viewer import preview # Even cleaner!
data = {
"name": "John Doe",
"age": 30,
"skills": ["Python", "JavaScript", "SQL"],
"address": {
"street": "123 Main St",
"city": "New York",
"zipcode": "10001"
}
}
# Same function, cleaner name
preview(data, title="User Profile", width=900, height=700)
Working with API Data
import json
import requests
from cacao_json_viewer import preview_json
# Fetch data from an API
response = requests.get("https://api.example.com/data")
data = response.json()
# Preview the API response
preview_json(data, title="API Response")
Function Parameters
preview_json(
data, # Your JSON data (dict, list, or any JSON-serializable object)
title="Cacao JSON Viewer", # Window title
width=800, # Window width in pixels
height=600, # Window height in pixels
)
Features
- 🍫 Simple & Clean: Minimal setup, maximum functionality
- 🌳 Interactive Tree View: Expand/collapse JSON nodes
- 🖥️ Desktop Application: Native desktop window using Cacao
- 📦 Easy Import: Clean import syntax -
from cacao_json_viewer import preview_json
Requirements
- Python 3.8+
- Cacao framework
License
MIT
Metadata
Release files for cacao-json-viewer 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cacao_json_viewer-0.1.2.tar.gz | 4.3 kB | Without provenance | Details for cacao_json_viewer-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cacao_json_viewer-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for cacao_json_viewer-0.1.2-py3-none-any.whl |
Total release size: 9.8 kB
Release files / cacao_json_viewer-0.1.2.tar.gz
| Download URL | cacao_json_viewer-0.1.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
788033644928d9aa378a1188a299493f7bbab6e5c7bc25f0286d3b9c96f80f90
|
|
BLAKE2b-256 checksum How to use checksums |
a82f49a804c65360ea6d4bb682104e2e9bf79b81ebedd524789a8ff05b32f6fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.7
|
Release files / cacao_json_viewer-0.1.2-py3-none-any.whl
| Download URL | cacao_json_viewer-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6d7fecbc35a7445e767f388b10285fd969cc7aad3374b657661945ec904f857
|
|
BLAKE2b-256 checksum How to use checksums |
1eef9075167284787c5f76c83928cb27df9da1a8c2fa6b7350b6b28732269e13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.7
|
Security for cacao-json-viewer 0.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.