Skip to main content

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 website search_v2 endpoint (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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ticker_price_data-0.1.4.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ticker_price_data-0.1.4-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file ticker_price_data-0.1.4.tar.gz.

File metadata

  • Download URL: ticker_price_data-0.1.4.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ticker_price_data-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b71f30dbda599b29e9706b9cd6670140909f26caa2f18d752c3f9ffd6e45c9ed
MD5 aebd581aab99f80b423c4283b0cbbd0b
BLAKE2b-256 72ad725745414becea2904638419b8b65aa6ef0dfd370ab5a1962a76c4047d86

See more details on using hashes here.

Provenance

The following attestation bundles were made for ticker_price_data-0.1.4.tar.gz:

Publisher: publish.yml on StephanAkkerman/ticker-price-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ticker_price_data-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ticker_price_data-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b59cbb3d1fc603a90d13746b1053eed25008fbfee0c62e1174e9e1b47a2e3dc9
MD5 5a3f1ba2b34a052f0707e9ab6fe5131a
BLAKE2b-256 60651d87e788bbad154c44b081c1f2ff1f1c5e063069311172ab2e1a5da06091

See more details on using hashes here.

Provenance

The following attestation bundles were made for ticker_price_data-0.1.4-py3-none-any.whl:

Publisher: publish.yml on StephanAkkerman/ticker-price-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page