Skip to main content

A Python library and CLI for fetching and exporting enormous amounts of financial & candle data without limit.

Project description

TvData

🇫🇷 Version française

A Python library and CLI for fetching and exporting financial candle data, timeframes, and tickers from your custom API.

Features

  • Fetch candle data in chunks and return as a Pandas DataFrame
  • Export candle data as CSV via CLI
  • List available timeframes and tickers
  • Type hints everywhere for static analysis (compatible with mypy)
  • Examples available in the examples/ folder

Installation

pip install TvData

Usage

Library

from tvdata import Client

client = Client()

# Get available timeframes
timeframes = client.fetch_timeframes()
print(timeframes)

# Get available tickers
tickers = client.fetch_tickers()
print(tickers)

df = client.fetch_candles(
    symbol=tickers[0],
    timeframe=timeframes[0],
    start=1700000000,
    end=1700003600,
    chunk_size=100,
)
print(df)

See more in examples/example_tvdata.py.

CLI

tvdata candles SYMBOL TIMEFRAME START END --csv output.csv
# Example:
tvdata candles "BINANCE:BTCUSDT" 1 1700000000 1700003600 --csv aapl_1m.csv

tvdata timeframes

tvdata tickers

Development

  • Clone the repository
  • Install dependencies: pip install -r requirements-dev.txt
  • Run tests: pytest
  • Check typing: mypy tvdata

License

MIT


🇫🇷 Version française

Une bibliothèque Python et une CLI pour récupérer et exporter des données de chandeliers, timeframes et tickers depuis votre API personnalisée.

Fonctionnalités

  • Récupération des chandeliers en DataFrame Pandas (par lots)
  • Export CSV via la CLI
  • Liste des timeframes et tickers disponibles
  • Typage partout pour l'analyse statique (compatible mypy)
  • Exemples dans le dossier examples/

Installation

pip install TvData

Utilisation

Librairie

from tvdata import Client

client = Client()

# Récupérer les timeframes disponibles
timeframes = client.fetch_timeframes()
print(timeframes)

# Récupérer les tickers disponibles
tickers = client.fetch_tickers()
print(tickers)

candles = client.fetch_candles(
    symbol=tickers[0],
    timeframe=timeframes[0],
    start=1700000000,
    end=1700003600,
    chunk_size=100,
)
print(candles)

Voir plus dans examples/example_tvdata.py.

CLI

tvdata candles SYMBOL TIMEFRAME START END --csv output.csv
# Exemple :
tvdata candles AAPL 1m 1700000000 1700003600 --csv aapl_1m.csv

tvdata timeframes

tvdata tickers

Développement

  • Clonez le dépôt
  • Installez les dépendances : pip install -r requirements-dev.txt
  • Lancez les tests : pytest
  • Vérifiez le typage : mypy tvdata

Licence

MIT

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

tvdata-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

tvdata-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file tvdata-0.1.0.tar.gz.

File metadata

  • Download URL: tvdata-0.1.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tvdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cfb59941e64447bb9e26b78ccadcdb997ec201f558c55f6aa70bb8c604e20e32
MD5 8fb391a81e5d05cad1246408cf68075e
BLAKE2b-256 b4aef98db62af5bb67c29e4d74f8c441f39b7e2480f6347a52e15b9569163542

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvdata-0.1.0.tar.gz:

Publisher: pypi.yaml on flolep2607/tvdata

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

File details

Details for the file tvdata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tvdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tvdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9bd816260e9324ae698885e95e8415631287847dc653ae6ebe269b58e6c35d2
MD5 c288e2dbbc17147c914b0339230e5de4
BLAKE2b-256 dd983498afb4a9cd422ed89eafff1117b6cad332d3a31fb31eff2179edda8df5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvdata-0.1.0-py3-none-any.whl:

Publisher: pypi.yaml on flolep2607/tvdata

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