Skip to content

About

Get information from chart images (especially TradingView)

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Chart Extractor 📈⛏️


GitHub Actions Workflow Status License Code style: black

Introduction

Chart-extractor provides tools for extracting important information from financial charts, utilizing the chart-info-detector model and OCR tools. It detects the chart title and the small price "pill" in screenshots, runs OCR on those regions, and applies lightweight parsing heuristics to convert raw OCR text into structured fields such as symbol, exchange, timeframe, price, and trading session. The project is designed primarily for TradingView-style screenshots, but also works with similar chart widgets. It uses RapidOCR (ONNX runtime) for fast local inference. Use the library programmatically, the small CLI for quick JSON output, or the example script for experiments.

Example

Given a TradingView chart image like the one below, it will extract the information such as price, symbol, exchange, and timeframe.

Input Image Example 📊 Input Chart

Python code:

from chart_extractor import ChartExtractor

extractor = ChartExtractor(weights=None, imgsz=1792, conf=0.25, iou=0.5)
res = extractor.analyze("img/chart.png")

print(res)

Output:

ExtractResult(symbol='SPOR S&P 500 ETF Trust', exchange='NYSE', timeframe='1D', price=682.98, session='regular', raw_title_text='SPOR S&P 500 ETF Trust · 1D · NYSE Arca', raw_pill_text='682.98 :28', det_title_box=(13, 28, 193, 38), det_pill_box=(1139, 145, 1186, 168))

Table of Contents 🗂

Installation ⚙️

The required packages to run this code can be found in the requirements.txt file. To run this file, execute the following code block after cloning the repository:

pip install -r requirements.txt

or

pip install git+https://github.com/StephanAkkerman/chart-extractor.git

Usage ⌨️

Citation ✍️

If you use this project in your research, please cite as follows:

@misc{chart_extractor_2025,
  author  = {Stephan Akkerman},
  title   = {Chart Extractor},
  year    = {2025},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/StephanAkkerman/chart-extractor}}
}

Contributing 🛠

Contributions are welcome! If you have a feature request, bug report, or proposal for code refactoring, please feel free to open an issue on GitHub. We appreciate your help in improving this project.
https://github.com/StephanAkkerman/chart-extractor/graphs/contributors

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.

About

Get information from chart images (especially TradingView)

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages