{"id":37071431,"url":"https://github.com/alihaskar/pycharting","last_synced_at":"2026-01-14T08:22:52.724Z","repository":{"id":327293327,"uuid":"1108433302","full_name":"alihaskar/pycharting","owner":"alihaskar","description":"A high-performance, open-source Python charting library for visualizing financial data with technical indicators. Built with FastAPI, uPlot, and modern web technologies.","archived":false,"fork":false,"pushed_at":"2025-12-04T17:55:34.000Z","size":886,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-05T20:53:40.755Z","etag":null,"topics":["backtesting","candlestick-chart","charting-library","finance","gui","quantitative-finance","trading","uplot"],"latest_commit_sha":null,"homepage":"https://www.fxwat.ch/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alihaskar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-02T12:50:38.000Z","updated_at":"2025-12-05T17:11:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alihaskar/pycharting","commit_stats":null,"previous_names":["alihaskar/pycharting"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/alihaskar/pycharting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihaskar%2Fpycharting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihaskar%2Fpycharting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihaskar%2Fpycharting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihaskar%2Fpycharting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alihaskar","download_url":"https://codeload.github.com/alihaskar/pycharting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alihaskar%2Fpycharting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtesting","candlestick-chart","charting-library","finance","gui","quantitative-finance","trading","uplot"],"created_at":"2026-01-14T08:22:52.230Z","updated_at":"2026-01-14T08:22:52.713Z","avatar_url":"https://github.com/alihaskar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyCharting\n\n[![PyPI version](https://img.shields.io/pypi/v/pycharting.svg)](https://pypi.org/project/pycharting/)\n[![Python versions](https://img.shields.io/pypi/pyversions/pycharting.svg)](https://pypi.org/project/pycharting/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nHigh‑performance financial charting library for OHLC data visualization with technical indicators.\n\n## Overview\n\nPyCharting lets you render large OHLC time series (hundreds of thousands to millions of candles) in the browser with a single Python call.  \nIt runs a lightweight FastAPI server locally, streams your data to a uPlot-based frontend, and gives you an interactive viewport with overlays and indicator subplots.\n\n![PyCharting demo](demo.png)\n\n## Features\n\n- **Million‑point OHLC charts**: optimized for large numeric indices and dense intraday data.\n- **Overlays on price**: moving averages, EMAs, or any arbitrary overlay series.\n- **Indicator subplots**: RSI-style and stochastic-style oscillators rendered as separate panels.\n- **Viewport management**: server‑side slicing and caching for smooth pan/zoom on huge arrays.\n- **FastAPI + uPlot stack**: Python on the backend, ultra‑light JS on the frontend.\n- **Simple Python API**: one main entry point, `plot(...)`, plus helpers to manage the server.\n\n## Installation\n\n### From PyPI\n\nInstall the latest released version from PyPI:\n\n```bash\npip install pycharting\n```\n\nThis will install the `pycharting` package along with its runtime dependencies (`numpy`, `pandas`, `fastapi`, `uvicorn`, and friends).\n\n### From source\n\nIf you want to develop or run against `main`:\n\n```bash\ngit clone https://github.com/alihaskar/pycharting.git\ncd pycharting\npip install -e .\n```\n\nIf you use Poetry instead of pip:\n\n```bash\ngit clone https://github.com/alihaskar/pycharting.git\ncd pycharting\npoetry install\n```\n\n## Quick start\n\nThe primary API is a single `plot` function that takes OHLC arrays (plus optional overlays and subplots), starts a local server, and opens your default browser on the interactive chart.\nYou normally import everything you need like this:\n\n```python\nfrom pycharting import plot, stop_server, get_server_status\n```\n\nWhen you run this script, PyCharting will:\n\n- spin up a local FastAPI server on an available port,\n- register your OHLC series and overlays in a session,\n- open your default browser to a minimal full‑page chart UI showing price and overlays.\n\n## Overlays vs subplots\n\nOnce you have your OHLC series, you pass additional series to `plot` in two different ways:\n\n```python\noverlays = {\n    \"SMA_50\": sma(close, 50),      # rendered on top of price\n    \"EMA_200\": ema(close, 200),\n}\n\nsubplots = {\n    \"RSI_like\": rsi_like_series,   # rendered in its own panel below price\n    \"Stoch_like\": stoch_series,\n}\n\nplot(\n    index,\n    open_,\n    high,\n    low,\n    close,\n    overlays=overlays,\n    subplots=subplots,\n)\n```\n\n- **Overlays** share the same y‑axis as price and are drawn directly on the candlestick chart (moving averages, bands, signals on price).\n- **Subplots** are stacked independent charts below the main panel with their own y‑scales (oscillators, volume, breadth measures).\n\nSee `demo.py` for a full example that generates synthetic data and wires up both overlays and indicator-style subplots.\n\nRun the demo from the project root:\n\n```bash\npython demo.py\n```\n\nYou should see something similar to the screenshot above: a price panel with overlays, plus RSI-like and stochastic-like subplots underneath.\n\n## Python API\n\nThe public API is intentionally small and focused. All functions are available from the top-level `pycharting` package.\n\n### `plot`\n\n```python\nfrom typing import Dict, Any, Optional, Union\n\nimport numpy as np\nimport pandas as pd\nfrom pycharting import plot\n\nArrayLike = Union[np.ndarray, pd.Series, list]\n\nresult: Dict[str, Any] = plot(\n    index: ArrayLike,\n    open: ArrayLike,\n    high: ArrayLike,\n    low: ArrayLike,\n    close: ArrayLike,\n    overlays: Optional[Dict[str, ArrayLike]] = None,\n    subplots: Optional[Dict[str, ArrayLike]] = None,\n    session_id: str = \"default\",\n    port: Optional[int] = None,\n    open_browser: bool = True,\n    server_timeout: float = 2.0,\n)\n```\n\n- **index**: numeric or datetime-like x-axis values (internally treated as numeric indices).\n- **open/high/low/close**: price series of identical length.\n- **overlays**: mapping of overlay name to series (same length as `close`), rendered on the main price chart.\n- **subplots**: mapping of subplot name to series, rendered as additional charts stacked vertically.\n- **session_id**: identifier for the data session; can be used to host multiple concurrent charts.\n- **port**: optional port override; if `None`, PyCharting picks an available port.\n- **open_browser**: if `False`, you get the URL back in `result[\"url\"]` but the browser is not opened automatically.\n\nThe returned dict includes:\n\n- `status`: `\"success\"` or `\"error\"`,\n- `url`: full chart URL (including session query),\n- `server_url`: base FastAPI server URL,\n- `session_id`: the session identifier you passed in,\n- `data_points`: number of OHLC rows,\n- `server_running`: boolean.\n\n### `stop_server`\n\n```python\nfrom pycharting import stop_server\n\nstop_server()\n```\n\nStops the active chart server if it is running. This is useful in long‑running processes and demos to clean up after you are done exploring charts.\n\n### `get_server_status`\n\n```python\nfrom pycharting import get_server_status\n\nstatus = get_server_status()\nprint(status)\n```\n\nReturns a small dict with:\n\n- `running`: whether the server is alive,\n- `server_info`: host/port and other metadata if running,\n- `active_sessions`: number of registered data sessions.\n\n## Project structure\n\nThe library follows a modern `src/` layout:\n\n```\npycharting/\n├── src/\n│   ├── core/         # Chart server lifecycle and internals\n│   ├── data/         # Data ingestion, validation, and slicing\n│   ├── api/          # FastAPI routes and Python API surface\n│   └── web/          # Static frontend (HTML + JS for charts)\n├── tests/            # Test suite\n├── data/             # Sample CSVs and fixtures\n└── pyproject.toml    # Project configuration\n```\n\n## Contributing\n\nContributions, bug reports, and feature suggestions are welcome. Please open an issue or pull request on GitHub.\n\nBasic workflow:\n\n1. Fork the repository.\n2. Create a feature branch: `git checkout -b feature/my-feature`.\n3. Make changes and add tests.\n4. Run the test suite.\n5. Open a pull request against `main`.\n\n## License\n\nPyCharting is licensed under the MIT License.\n\n## Links\n\n- **PyPI**: `https://pypi.org/project/pycharting/`\n- **Source**: `https://github.com/alihaskar/pycharting`\n- **Issues**: `https://github.com/alihaskar/pycharting/issues`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falihaskar%2Fpycharting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falihaskar%2Fpycharting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falihaskar%2Fpycharting/lists"}