Metadata-Version: 2.4
Name: cacao-json-viewer
Version: 0.1.1
Summary: A simple JSON/tree viewer desktop app built on Cacao
Author-email: Juan Denis <juan@vene.co>
License-Expression: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cacao>=1.0.40
Dynamic: license-file

# 🍫 cacao-json-viewer

A tiny desktop app to view JSON as an interactive tree using Cacao.

## Installation

```bash
pip install cacao-json-viewer
```

## Usage

### Command Line Interface

```bash
# 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

```python
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

```python
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

```python
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

```python
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
