Streamlit wrapper for TradingView's lightweight-charts with ultra-simplified API and performance optimizations
Project description
Streamlit Lightweight Charts Pro
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:
- 📖 Official Documentation - Complete API reference, tutorials, and guides
- 📝 GitHub Wiki - Quick-start guides, FAQ, code recipes, troubleshooting
- 🔧 Setup Guides - Documentation infrastructure and setup
- 📁 Examples - Comprehensive code examples and tutorials
- 🔄 Migration Guide - Upgrading from previous versions
Quick Links
- Installation Guide
- Quick Start Tutorial
- Code Recipes - 50+ copy-paste examples
- FAQ
- Troubleshooting
✨ 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
BaseChartandBaseChartManagerfromlightweight-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-proprovides 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_lightweight_charts_pro-0.3.0.tar.gz.
File metadata
- Download URL: streamlit_lightweight_charts_pro-0.3.0.tar.gz
- Upload date:
- Size: 275.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc29bca53fb39bd68d333c8bf204e401fb0afb29f5be2f2f42a8935daceb365a
|
|
| MD5 |
14e890f8aba1becadb951aad84ad7267
|
|
| BLAKE2b-256 |
e47fae89b936ade32b8cad0c48233a4645285c76449f14675369a4404bda7bf4
|
File details
Details for the file streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl
- Upload date:
- Size: 269.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3a9280836b1b42afaf04f2d4a9fd3b2fe292c4c96aeb19e165a647c2eeac56
|
|
| MD5 |
e2e760df5b8779a642386f0ccba5a618
|
|
| BLAKE2b-256 |
14255a7a67453454df2b9e912041bbde51adc5bde8af9276c710ea554a9e6bd2
|