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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tvdata-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 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.1.tar.gz
Algorithm Hash digest
SHA256 5aa8f4b05b96df58020735c7bf348ce26ef689310ac879eae604c25c9b323190
MD5 45f1bf5e636ede509517fdea784b1777
BLAKE2b-256 0ec6cee99abdb326caf4c9b0ae910db8321f896590049e2537a8aab9036499db

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tvdata-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84b30f0d797a4881a593c2ffbc6efcd6de3c7939581bebce7d3ebe235da5fed1
MD5 c02b900a9bf77d0b854c2d313489b830
BLAKE2b-256 928498cc8cc9c87483f2bac83d6c52dedd0ec0025faf91df9453c52c339fa612

See more details on using hashes here.

Provenance

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