Skip to main content

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. Extracted from fintwit-web so the pricing logic can be reused across projects.

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.

All helpers return Optional[dict]:

{
    "price": float,
    "change_percent": float,
    "volume": float,
    "website": str,
    "source": str,            # "yahoo" | "coingecko" | "tradingview"
    # yahoo also includes "last_close": float | None
}

Installation ⚙️

pip install git+https://github.com/StephanAkkerman/ticker-price-data.git

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


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.1.tar.gz (23.1 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.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ticker_price_data-0.1.1.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ticker_price_data-0.1.1.tar.gz
Algorithm Hash digest
SHA256 143c7e8930d2dea151bfd5f825ab475fac6532352b722b082abbb794be9a124d
MD5 704a97be35b470b260824e5aeea023b0
BLAKE2b-256 feb3b52e2825d4dd69f3122c275063f9414d546c4455f725acab72582af3b250

See more details on using hashes here.

Provenance

The following attestation bundles were made for ticker_price_data-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ticker_price_data-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0edb4a4244056bf496b5b6357a3db89947f34eb8dd392b56f6935b8b971c34
MD5 61fabb8d66d573c961c2be41f847cae2
BLAKE2b-256 e2eed02a3d699b88ddadeca0df5f681e20f15981abb1b992ed0b29bedbe41076

See more details on using hashes here.

Provenance

The following attestation bundles were made for ticker_price_data-0.1.1-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page