Skip to main content

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

Project description

TvData

PyPI

🇫🇷 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='BINANCE:BTCUSDT',
    timeframe='1',
    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

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)

df = client.fetch_candles(
    symbol='BINANCE:BTCUSDT',
    timeframe='1',
    start=1700000000,
    end=1700003600,
    chunk_size=100,
)
print(df)

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

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.2.0.tar.gz (19.7 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.2.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tvdata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1036993771c8004462401426d89d898dc16a2179835a48de22bd1392516ba4f9
MD5 133fac1752b2b04e183d6009f3e87589
BLAKE2b-256 ea71a4972421176bfeeb2f251c4c1bd02cd8f17ddbd44f28bcdd037d05813441

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvdata-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: tvdata-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e53a44fe140cc1e114a2413215d7eb5f3e57a1b04b2ec39112a72a2d39c56802
MD5 2558c51a400d64897696b93f5376b905
BLAKE2b-256 79610484b112614053c639c43c0ccf01546feff8e8ae19345a76332666ccc9d7

See more details on using hashes here.

Provenance

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