Unified ticker price data from Yahoo Finance, CoinGecko, and TradingView.
Project description
ticker-price-data
Unified ticker price data from Yahoo Finance (stocks/indices/forex/futures), CoinGecko (crypto), and TradingView (universal fallback).
One normalized quote shape for every asset, with sensible fallbacks and built-in caching.
Key Features 🔑
get_price(ticker, asset_type)— single entry point;asset_type="auto"uses ticker-classifier to decide stock vs crypto vs forex automatically.get_ticker(ticker)— everything known about a symbol in one call: classification metadata (sector, industry, market cap, company profile, ...) plus the live quote, classifying only once.get_stock_info(ticker)— Yahoo Finance, with a TradingView fallback.get_crypto_info(ticker)— CoinGecko via the websitesearch_v2endpoint (avoids the public API's free-tier rate limits), with Yahoo → TradingView fallbacks.get_tradingview_quote(symbol, asset_hint)— realtime websocket pool + scraper fallback.- In-memory caching, stale/negative caching, and concurrency limits built in.
- Pre-market and after-hours data where available.
All helpers return Optional[dict]:
{
"price": float,
"change_percent": float,
"volume": float,
"website": str,
"source": str, # "yahoo" | "coingecko" | "tradingview"
# stocks only:
"last_close": float | None, # previous day's regular-session close
"session": str, # "regular" | "pre-market" | "after-hours" | "closed"
"extended_price": float, # pre/after-hours price (omitted when session == "regular")
"extended_change_percent": float, # (extended_price − price) / price × 100 (omitted when session == "regular")
}
extended_price and extended_change_percent persist from the end of after-hours (8 pm ET) through weekends and holidays until pre-market opens (4 am ET) on the next trading day.
Installation ⚙️
pip install ticker-price-data
or, for local development:
pip install -e .
Usage ⌨️
import asyncio
from ticker_price_data import get_price, get_ticker, get_stock_info, get_crypto_info
async def main():
print(await get_stock_info("AAPL")) # Yahoo
print(await get_crypto_info("BTC")) # CoinGecko
print(await get_price("BTC", "auto")) # classified automatically
print(await get_ticker("AAPL")) # metadata (sector, industry, ...) + quote
asyncio.run(main())
License 📜
This project is licensed under the MIT License. See the LICENSE file for details.
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 ticker_price_data-0.1.3.tar.gz.
File metadata
- Download URL: ticker_price_data-0.1.3.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9417181b028da9ee8c673e27d1f2b6b125b9a987c35845226fe4f1905f3ad632
|
|
| MD5 |
1a7750bc1b496209eafed5a2ebfe14a7
|
|
| BLAKE2b-256 |
87197c9de9c8b669defbf608a517c2b3bda8e50a96e5d96a287c94b1c6ec0d6d
|
Provenance
The following attestation bundles were made for ticker_price_data-0.1.3.tar.gz:
Publisher:
publish.yml on StephanAkkerman/ticker-price-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ticker_price_data-0.1.3.tar.gz -
Subject digest:
9417181b028da9ee8c673e27d1f2b6b125b9a987c35845226fe4f1905f3ad632 - Sigstore transparency entry: 1913170092
- Sigstore integration time:
-
Permalink:
StephanAkkerman/ticker-price-data@c1a3066481eaac15b93c9a6a032a7dddca9efedb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/StephanAkkerman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1a3066481eaac15b93c9a6a032a7dddca9efedb -
Trigger Event:
release
-
Statement type:
File details
Details for the file ticker_price_data-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ticker_price_data-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
881020bf845e0a4dc3f63337ea82be15d62c2488b1bf8500f93997e59e83d4db
|
|
| MD5 |
f08b964dd368bad0daeb257e349568e5
|
|
| BLAKE2b-256 |
f0be901530743f00e4c86e34d61105f84c33862a54d110dece15bfff1b9a6b63
|
Provenance
The following attestation bundles were made for ticker_price_data-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on StephanAkkerman/ticker-price-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ticker_price_data-0.1.3-py3-none-any.whl -
Subject digest:
881020bf845e0a4dc3f63337ea82be15d62c2488b1bf8500f93997e59e83d4db - Sigstore transparency entry: 1913170356
- Sigstore integration time:
-
Permalink:
StephanAkkerman/ticker-price-data@c1a3066481eaac15b93c9a6a032a7dddca9efedb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/StephanAkkerman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1a3066481eaac15b93c9a6a032a7dddca9efedb -
Trigger Event:
release
-
Statement type: