{"id":13740981,"url":"https://github.com/yahoofinancelive/yliveticker","last_synced_at":"2026-04-02T12:29:39.797Z","repository":{"id":50141686,"uuid":"266644159","full_name":"yahoofinancelive/yliveticker","owner":"yahoofinancelive","description":"Get market data from Yahoo Finance websocket in near-real time.","archived":false,"fork":false,"pushed_at":"2026-03-25T13:32:41.000Z","size":100,"stargazers_count":163,"open_issues_count":0,"forks_count":35,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-25T22:49:24.116Z","etag":null,"topics":["financial-data","livedata","market-data","stock-market","yahoo-finance"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yahoofinancelive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T23:48:44.000Z","updated_at":"2026-03-25T13:32:45.000Z","dependencies_parsed_at":"2022-09-26T20:20:42.128Z","dependency_job_id":null,"html_url":"https://github.com/yahoofinancelive/yliveticker","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/yahoofinancelive/yliveticker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoofinancelive%2Fyliveticker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoofinancelive%2Fyliveticker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoofinancelive%2Fyliveticker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoofinancelive%2Fyliveticker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yahoofinancelive","download_url":"https://codeload.github.com/yahoofinancelive/yliveticker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoofinancelive%2Fyliveticker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31306038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: 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":["financial-data","livedata","market-data","stock-market","yahoo-finance"],"created_at":"2024-08-03T04:00:54.183Z","updated_at":"2026-04-02T12:29:39.790Z","avatar_url":"https://github.com/yahoofinancelive.png","language":"Python","funding_links":[],"categories":["Python","Data and Feeds"],"sub_categories":["Data Sources"],"readme":"# Live Market Data from Yahoo! Finance\r\n\r\n[![Python package](https://github.com/yahoofinancelive/yliveticker/workflows/Python%20package/badge.svg)](https://github.com/yahoofinancelive/yliveticker/actions)\r\n[![Upload Python Package](https://github.com/yahoofinancelive/yliveticker/workflows/Upload%20Python%20Package/badge.svg)](https://github.com/yahoofinancelive/yliveticker/actions)\r\n[![PyPI version](https://badge.fury.io/py/yliveticker.svg)](https://pypi.org/project/yliveticker/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nGet real-time market data from Yahoo! Finance via WebSockets. Lightweight, efficient, and easy to use.\r\n\r\n## Features\r\n\r\n- **Real-time updates**: Stream near-instant price changes from Yahoo! Finance.\r\n- **Interactive Dashboard**: A full-screen terminal UI with live charts and status monitoring.\r\n- **Robust Connectivity**: Built-in automatic reconnection and keep-alive (heartbeats).\r\n- **Modern Support**: Fully compatible with Protobuf 4.x/5.x/7.x.\r\n- **Data Analysis Ready**: Optional pandas integration and background CSV export.\r\n- **Comprehensive Data**: Includes price, volume, change, day high/low, and more.\r\n\r\n## Setup\r\n\r\n### Basic Installation\r\n```bash\r\npip install yliveticker\r\n```\r\n\r\n### 🍺 Homebrew (macOS/Linux)\r\n```bash\r\nbrew tap yahoofinancelive/yliveticker\r\nbrew install yliveticker\r\n```\r\n\r\n### 🖥️ Full Experience (CLI \u0026 Data Analysis)\r\n\r\nTo get the interactive dashboard and pandas support:\r\n```bash\r\npip install yliveticker[cli,pandas]\r\n```\r\n\r\n## Usage Examples\r\n\r\n### 1. Interactive Dashboard (CLI)\r\nThe easiest way to watch stocks. It provides a real-time, color-coded dashboard with **sparklines** and live status updates.\r\n\r\n```bash\r\n# Watch multiple symbols and export to CSV\r\nyliveticker watch AAPL MSFT TSLA BTC-USD --export my_data.csv\r\n```\r\n\r\n**How it looks:**\r\n```text\r\n╭──────────────────────────────────────────────────────────────────────────╮\r\n│                Yahoo! Finance Live Dashboard | 01:50:56                  │\r\n╰──────────────────────────────────────────────────────────────────────────╯\r\n┏━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\r\n┃ Symbol   ┃     Price ┃ Day Change       ┃ Trend                          ┃\r\n┡━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\r\n│ AAPL     │    234.12 │ +1.45 (+0.62%)   │      ▂▃▅▆█                     │\r\n│ BTC-USD  │  98,450.00│ -120.50 (-0.12%) │  █▇▆▅▄▃                        │\r\n│ NVDA     │    177.62 │ +2.42 (+1.38%)   │          █▂                    │\r\n└──────────┴───────────┴──────────────────┴────────────────────────────────┘\r\n╭──────────────────────────────────────────────────────────────────────────╮\r\n│ Status: ● Connected | Updates: 18 | Tickers: 3 | Press Ctrl+C to Quit    │\r\n╰──────────────────────────────────────────────────────────────────────────╯\r\n```\r\n\r\n### 2. Basic Ticker (Blocking)\r\nThis is the simplest way to print live updates to the console.\r\n\r\n```python\r\nimport yliveticker\r\n\r\n# this function is called on each ticker update\r\ndef on_new_msg(ws, msg):\r\n    print(msg)\r\n\r\nyliveticker.YLiveTicker(on_ticker=on_new_msg, ticker_names=[\"BTC-USD\", \"AAPL\", \"EURUSD=X\"])\r\n```\r\n\r\n### 2. Time Series and OHLCV (Pandas)\r\nUse `YTimeSeries` to collect data into a structured format for analysis.\r\n\r\n```python\r\nimport yliveticker\r\nfrom yliveticker import YTimeSeries\r\n\r\nts = YTimeSeries()\r\n\r\n# Collect data (press Ctrl+C to stop and see results)\r\ntry:\r\n    yliveticker.YLiveTicker(on_ticker=ts.on_ticker, ticker_names=[\"BTC-USD\"])\r\nexcept KeyboardInterrupt:\r\n    pass\r\n\r\n# Get raw collected data as a pandas DataFrame\r\ndf = ts.get_dataframe()\r\nprint(df.head())\r\n\r\n# Get 1-minute OHLCV candles\r\nohlcv = ts.get_ohlcv(interval='1Min')\r\nfor symbol, data in ohlcv.items():\r\n    print(f\"\\n--- {symbol} ---\")\r\n    print(data)\r\n```\r\n\r\n### 3. Time Series Database (TSDB) \u0026 Grafana\r\nStore and visualize live ticker data using high-performance time-series databases and Grafana.\r\n\r\n#### Installation\r\nInstall the necessary drivers for your chosen database:\r\n```bash\r\n# For all supported databases\r\npip install yliveticker[all]\r\n\r\n# Or individually\r\npip install yliveticker[influxdb]\r\npip install yliveticker[timescaledb]\r\npip install yliveticker[clickhouse]\r\npip install yliveticker[questdb]\r\npip install yliveticker[timestream]\r\n```\r\n\r\n#### Supported Sinks\r\n- **InfluxDB**: Native Flux support with tag/field mapping.\r\n- **TimescaleDB**: Automated hypertable creation and bulk inserts.\r\n- **ClickHouse**: High-throughput columnar storage.\r\n- **QuestDB**: Ultra-fast ingestion via InfluxDB Line Protocol (ILP).\r\n- **Amazon Timestream**: AWS-native serverless time-series database.\r\n\r\n#### Quick Start with Docker \u0026 Grafana\r\nWe provide a pre-configured environment with InfluxDB and Grafana.\r\n\r\n1. **Start the stack**:\r\n   ```bash\r\n   cd docker\r\n   docker-compose up -d\r\n   ```\r\n2. **Run the example script**:\r\n   ```bash\r\n   python examples/tsdb_example.py\r\n   ```\r\n3. **Visualize**: Open `http://localhost:3000` (User: `admin`, Pass: `admin`) to see the live \"Yahoo Finance Live Ticker\" dashboard.\r\n\r\n## Configuration\r\n\r\nThe `YLiveTicker` constructor accepts several parameters for fine-tuning:\r\n\r\n| Parameter | Default | Description |\r\n| :--- | :--- | :--- |\r\n| `on_ticker` | `None` | Callback function `f(ws, msg)` called on each update. |\r\n| `ticker_names` | `[\"AMZN\"]` | List of Yahoo Finance symbols to subscribe to. |\r\n| `reconnect` | `5` | Delay in seconds before attempting to reconnect on failure. |\r\n| `ping_interval` | `15` | Interval in seconds to send WebSocket pings. |\r\n| `ping_timeout` | `10` | Timeout in seconds to wait for a pong response. |\r\n| `enable_socket_trace` | `False` | Set to `True` to see raw WebSocket frames. |\r\n\r\n## Note on Trading Hours\r\nIf you don't observe any live metrics, please check the **trading hours** for your specific market. Many traditional stock symbols will only provide updates during market hours. Crypto symbols (like `BTC-USD`) usually stream 24/7.\r\n\r\n## License\r\nDistributed under the MIT License. See `LICENSE` for more information.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoofinancelive%2Fyliveticker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyahoofinancelive%2Fyliveticker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoofinancelive%2Fyliveticker/lists"}