Skip to main content

Streamlit Lightweight Charts Pro

PyPI version Python 3.10+ License: MIT

Professional-grade financial charting library for Streamlit applications

Streamlit Lightweight Charts Pro is a comprehensive Streamlit wrapper that brings TradingView's powerful lightweight-charts library to Streamlit with an intuitive, fluent API. Built on top of lightweight-charts-pro, it provides seamless integration with Streamlit's component system.

📚 Documentation

This project has comprehensive, multi-layered documentation:

Quick Links

✨ Features

🎯 Core Capabilities

  • Interactive Financial Charts: Candlestick, line, area, bar, histogram, and baseline charts
  • Fluent API: Method chaining for intuitive chart creation
  • Multi-Pane Charts: Synchronized charts with multiple series and timeframes
  • Trade Visualization: Built-in support for displaying trades with markers and annotations
  • Advanced Annotations: Text, arrows, and shape annotations with layering
  • Responsive Design: Auto-sizing charts that adapt to container dimensions
  • Pandas Integration: Seamless DataFrame to chart data conversion

🚀 Advanced Features

  • Price-Volume Charts: Pre-built candlestick + volume combinations
  • Range Switchers: Professional time range selection (1D, 1W, 1M, 3M, 6M, 1Y, ALL)
  • Auto-Sizing: Responsive charts with min/max constraints
  • Custom Styling: Full control over colors, fonts, and visual elements
  • Performance Optimized: Handles large datasets efficiently
  • Type Safety: Comprehensive type hints and validation

🔧 Developer Experience

  • Production Ready: Comprehensive logging, error handling, and security
  • Well Documented: Complete API documentation with examples
  • Tested: 450+ unit tests with 95%+ coverage
  • Code Quality: Black formatting, type hints, and linting compliance

📦 Installation

pip install streamlit-lightweight-charts-pro

This will automatically install the required dependency: lightweight-charts-pro

🚀 Quick Start

import streamlit as st
from streamlit_lightweight_charts_pro import renderChart
import pandas as pd

st.title("Simple Line Chart")

# Create sample data
data = pd.DataFrame({
    'time': pd.date_range('2024-01-01', periods=100, freq='D'),
    'value': pd.Series(range(100)) + pd.Series(range(100)).apply(lambda x: x**0.5)
})

# Render chart
renderChart([
    {
        'type': 'line',
        'data': data,
        'options': {}
    }
], {
    'layout': {
        'textColor': 'black',
        'background': {
            'type': 'solid',
            'color': 'white'
        }
    }
})

🏗️ Architecture

This package is a Streamlit-specific wrapper that:

  • Extends BaseChart and BaseChartManager from lightweight-charts-pro
  • Provides Streamlit component integration via custom React component
  • Manages session state and component lifecycle
  • Renders charts using Streamlit's bi-directional component system

The package consists of:

  • Python wrapper: Streamlit integration and session state management
  • React frontend: Custom TypeScript/React component built on TradingView's lightweight-charts
  • Core dependency: lightweight-charts-pro provides chart classes and utilities

📖 Examples

Check out the examples/ directory for comprehensive examples:

  • Getting Started: Basic chart types and configuration
  • Advanced Features: Multi-pane charts, annotations, legends
  • Trading Features: Trade visualization, signals, markers
  • Custom Styling: Themes, colors, and visual customization

🔄 Migration from v0.2.x to v0.3.x

Version 0.3.0 renames the core dependency from lightweight-charts-core to lightweight-charts-pro. See MIGRATION.md for details on updating your code.

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please check the main repository for contribution guidelines.

Release files for streamlit-lightweight-charts-pro 0.3.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 streamlit-lightweight-charts-pro 0.3.0
File Size Uploaded
streamlit_lightweight_charts_pro-0.3.0.tar.gz 275.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-lightweight-charts-pro 0.3.0
File Interpreter ABI Platform
streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 545.0 kB

Release files / streamlit_lightweight_charts_pro-0.3.0.tar.gz

Download URL streamlit_lightweight_charts_pro-0.3.0.tar.gz
Size 275.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fc29bca53fb39bd68d333c8bf204e401fb0afb29f5be2f2f42a8935daceb365a
BLAKE2b-256 checksum
How to use checksums
e47fae89b936ade32b8cad0c48233a4645285c76449f14675369a4404bda7bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl

Download URL streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl
Size 269.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a3a9280836b1b42afaf04f2d4a9fd3b2fe292c4c96aeb19e165a647c2eeac56
BLAKE2b-256 checksum
How to use checksums
14255a7a67453454df2b9e912041bbde51adc5bde8af9276c710ea554a9e6bd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

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