Skip to main content

Custom component for viewing TOON data in Streamlit

Reason this release was yanked:

not ready

Project description

Streamlit TOON Viewer

A custom Streamlit component for viewing TOON (Tree Object Oriented Notation) data in an interactive, collapsible tree view.

Requirements

  • Python >= 3.12
  • Streamlit >= 1.51.0

Installation

Install the package using pip:

pip install streamlit-toon

Usage

Basic Usage

import streamlit as st
from streamlit_toon import StreamlitTOONViewer

# Create a viewer instance
viewer = StreamlitTOONViewer()

# Display TOON data from a string
toon_data = """
root:
  child1: value1
  child2: value2
"""
viewer.display_toon(toon_data)

Display TOON Data from a File

import streamlit as st
from streamlit_toon import StreamlitTOONViewer

viewer = StreamlitTOONViewer()

# Pass a file path directly
viewer.display_toon("path/to/your/toon_file.toon")

Custom Height and Key

import streamlit as st
from streamlit_toon import StreamlitTOONViewer

viewer = StreamlitTOONViewer()

# Customize the viewer height and add a unique key
viewer.display_toon(
    data="your_toon_data_here",
    height=600,
    key="my_toon_viewer"
)

API Reference

StreamlitTOONViewer()

Creates a new TOON viewer instance.

display_toon(data, height=400, key=None)

Display TOON data in an interactive tree view.

Parameters:

  • data (str): TOON text as a string, or file path to a TOON file
  • height (int, optional): Height of the component in pixels (default: 400)
  • key (str, optional): Unique key for the component

Returns:

  • Component return value

License

[Add your license here]

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

streamlit_toon-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

streamlit_toon-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_toon-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_toon-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for streamlit_toon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa8f29894a0b08eefa85b83e7e73f9b749ef4fe08b547e3a62564608ce85c2b3
MD5 ca0aceb36572e4b24b9d752889d1dc3b
BLAKE2b-256 02d18511e3043ccc5ba925949955d7865beb4f9e4f6d3c36caba04f16ca06bcf

See more details on using hashes here.

File details

Details for the file streamlit_toon-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_toon-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cf243627230f5925f3ffc953118c4341918108125419e8f0b92df8bfb0baecc
MD5 a38500201c519ffe6f641fd969168cff
BLAKE2b-256 ffe5b18b9286fe35656d1223f59ee89497835006df2a985f40b640997fa16768

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