Skip to content

bigeagle/anywidget-react-json-view

 
 

Repository files navigation

JSON View AnyWidget

An interactive JSON viewer widget for Jupyter notebooks using React JSON View.

Features

  • 🔍 Interactive JSON tree view with expand/collapse
  • 🎨 Multiple theme support (monokai, solarized, etc.)
  • 🎯 Support Jupyter notebooks and marimo
  • 📝 Support Multi-line strings

Installation

From PyPI (Recommended)

pip install json-view-anywidget

Using uv

uv pip install json-view-anywidget

From Source

git clone https://github.com/bigeagle/anywidget-react-json-view.git
cd anywidget-react-json-view
uv pip install -e .

Quick Start

from rjv_anywidget import JsonWidget

# Create a simple JSON viewer
widget = JsonWidget({
    "name": "John",
    "age": 30,
    "city": "New York"
})
widget

Advanced Usage

# Use different themes
widget = JsonWidget(
    data=your_data,
    theme="monokai"  # Available themes: "rjv-default", "monokai", "solarized", etc.
)

# Display in Jupyter
widget

Development

Frontend Development

# Install dependencies
pnpm install

# Development mode (with hot reload)
pnpm run dev

# Build for production
pnpm run build

Python Package Development

# Build package
uv build

# Install locally for testing
uv pip install -e .

Project Structure

.
├── src/
│   ├── widget.tsx          # React component source
│   ├── index.css           # Component styles
│   └── rjv_anywidget/      # Python package
│       ├── __init__.py
│       ├── widget.py       # JsonWidget class
│       └── static/         # React build output
├── pyproject.toml          # Python package configuration
├── package.json            # Frontend build configuration
└── dist/                   # Build outputs

License

MIT License

Related Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 46.0%
  • Python 34.9%
  • TypeScript 11.4%
  • JavaScript 6.0%
  • CSS 1.7%