No project description provided
Project description
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 fetch_candles, fetch_timeframes, fetch_tickers
df = fetch_candles(
symbol="AAPL",
timeframe="1m",
start=1700000000,
end=1700003600,
chunk_size=100,
api_url="http://candles.macrofinder.flolep.fr"
)
print(df)
# Get available timeframes
timeframes = fetch_timeframes("http://candles.macrofinder.flolep.fr")
print(timeframes)
# Get available tickers
tickers = fetch_tickers("http://candles.macrofinder.flolep.fr")
print(tickers)
See more in examples/example_tvdata.py.
CLI
tvdata candles SYMBOL TIMEFRAME START END --csv output.csv
# Example:
tvdata candles AAPL 1m 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 fetch_candles, fetch_timeframes, fetch_tickers
candles = fetch_candles(
symbol="AAPL",
timeframe="1m",
start=1700000000,
end=1700003600,
chunk_size=100,
api_url="http://candles.macrofinder.flolep.fr"
)
print(candles)
timeframes = fetch_timeframes("http://candles.macrofinder.flolep.fr")
print(timeframes)
tickers = fetch_tickers("http://candles.macrofinder.flolep.fr")
print(tickers)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tvdata-0.0.1.tar.gz.
File metadata
- Download URL: tvdata-0.0.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c16bb968d61cbe79b1855b106a5edc0fdf98b180c65939ca8985c93ff5997572
|
|
| MD5 |
cfa7a5854d078866a4c05e04f10c3f8c
|
|
| BLAKE2b-256 |
82b5efcd0d29fc6e479e78f1528ef904af30ff6d9384ebd08a1aded190acef40
|
Provenance
The following attestation bundles were made for tvdata-0.0.1.tar.gz:
Publisher:
pypi.yaml on flolep2607/tvdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tvdata-0.0.1.tar.gz -
Subject digest:
c16bb968d61cbe79b1855b106a5edc0fdf98b180c65939ca8985c93ff5997572 - Sigstore transparency entry: 199637911
- Sigstore integration time:
-
Permalink:
flolep2607/tvdata@12482a8f0871f763e9ce015892a0690a952c03be -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/flolep2607
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@12482a8f0871f763e9ce015892a0690a952c03be -
Trigger Event:
push
-
Statement type:
File details
Details for the file tvdata-0.0.1-py3-none-any.whl.
File metadata
- Download URL: tvdata-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6bff4f3dd15269e01b57c66faea25ef533fc80527a7fd3c5730386f64984dae
|
|
| MD5 |
4a4a7be6ebd39523b93448e3620ed737
|
|
| BLAKE2b-256 |
6d8aab9a008851d6f5bc9c3b4a47c66fd01820ffb1f894a4d93469ec063db395
|
Provenance
The following attestation bundles were made for tvdata-0.0.1-py3-none-any.whl:
Publisher:
pypi.yaml on flolep2607/tvdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tvdata-0.0.1-py3-none-any.whl -
Subject digest:
d6bff4f3dd15269e01b57c66faea25ef533fc80527a7fd3c5730386f64984dae - Sigstore transparency entry: 199637913
- Sigstore integration time:
-
Permalink:
flolep2607/tvdata@12482a8f0871f763e9ce015892a0690a952c03be -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/flolep2607
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@12482a8f0871f763e9ce015892a0690a952c03be -
Trigger Event:
push
-
Statement type: