TvData
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
Metadata
Release files for tvdata 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tvdata-0.2.0.tar.gz | 19.7 kB | With provenance | Details for tvdata-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tvdata-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for tvdata-0.2.0-py3-none-any.whl |
Total release size: 34.2 kB
Release files / tvdata-0.2.0.tar.gz
| Download URL | tvdata-0.2.0.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1036993771c8004462401426d89d898dc16a2179835a48de22bd1392516ba4f9
|
|
BLAKE2b-256 checksum How to use checksums |
ea71a4972421176bfeeb2f251c4c1bd02cd8f17ddbd44f28bcdd037d05813441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 20, 2025.
Transparency logRelease files / tvdata-0.2.0-py3-none-any.whl
| Download URL | tvdata-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e53a44fe140cc1e114a2413215d7eb5f3e57a1b04b2ec39112a72a2d39c56802
|
|
BLAKE2b-256 checksum How to use checksums |
79610484b112614053c639c43c0ccf01546feff8e8ae19345a76332666ccc9d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 20, 2025.
Transparency logSecurity for tvdata 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for tvdata-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 20, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.