vDatafeed: A Python wrapper for Viet Nam Datafeed API
Project description
vDatafeed
vDatafeed: A Python wrapper for Viet Nam Datafeed API
Installation
pip install vdatafeed
Supported Providers
| Provider | Status |
|---|---|
| SSI | ✅ Supported |
| SSI-v2 | ⚠️ Work in Progress |
| DNSE | ⚠️ Work in Progress |
| DNSE-v2 | ⚠️ Work in Progress |
Usage
Financial data
from vdatafeed import Datafeed, Provider, SSIConfig
datafeed = Datafeed(
provider=Provider.SSI.value,
config=SSIConfig(
consumer_id="<SSI_CONSUMER_ID>",
consumer_secret="<SSI_CONSUMER_SECRET>"
)
)
# Get list of instruments
datafeed.api.get_instruments()
# Get instrument details
datafeed.api.get_instrument_details("SSI")
# Get list of indices
datafeed.api.get_indices()
# Get list of instruments in an index
datafeed.api.get_indices_instruments("VN30")
# Get daily instrument info
datafeed.api.get_daily_instrument_info(instrument="SSI", from_date="2024-09-01", to_date="2024-09-10")
# Get daily all instruments info
datafeed.api.get_daily_instruments_info(from_date="2024-09-10", to_date="2024-09-10")
# Get daily indices info
datafeed.api.get_daily_indices_info(index="VN30", from_date="2024-09-01", to_date="2024-09-10")
# Get end of day OHLCV
datafeed.api.get_endofday_ohlcv(instrument="SSI", from_date="2024-09-01", to_date="2024-09-10")
# Get intraday OHLCV
datafeed.api.get_intraday_ohlcv(instrument="SSI", from_date="2024-09-01", to_date="2024-09-10")
Streaming data
import asyncio
from vdatafeed import Datafeed, Provider, SSIConfig
datafeed = Datafeed(
provider=Provider.SSI.value,
config=SSIConfig(
consumer_id="<SSI_CONSUMER_ID>",
consumer_secret="<SSI_CONSUMER_SECRET>"
)
)
def on_trade_message(msg):
print(f"TRADE: {msg}")
def on_quote_message(msg):
print(f"QUOTE: {msg}")
asyncio.run(
datafeed.hub.listen(
input("Please select Symbol(SSI)/Index(VNINDEX/VN30) or list(SSI,VCB): "),
on_trade_message,
on_quote_message
)
)
List available providers
from vdatafeed import list_providers
print(list_providers()) # ['ssi']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vdatafeed-2.0.0.tar.gz
(17.4 kB
view details)
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
vdatafeed-2.0.0-py3-none-any.whl
(22.1 kB
view details)
File details
Details for the file vdatafeed-2.0.0.tar.gz.
File metadata
- Download URL: vdatafeed-2.0.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2615b95ab71b7a9126b1292f35641352b1bdc54774b5a6da5676c93fb42387f
|
|
| MD5 |
6bcebf62200a45633ab803f16c452829
|
|
| BLAKE2b-256 |
724db6eef734bf9623d8b0118e8b6d03c7c436cc95747d30f906a1352381bead
|
File details
Details for the file vdatafeed-2.0.0-py3-none-any.whl.
File metadata
- Download URL: vdatafeed-2.0.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b64c9a46de2d8c9b0ba0b7b11cbf1e1ac1790d4a212e81b21cf43a6ab7074195
|
|
| MD5 |
1bdd939fc8dfb8a4f971d04ef6346648
|
|
| BLAKE2b-256 |
48afc1dba899c740e56a92ab918e0a61b4e8f893ec85e2c07e325fe2bccf81a9
|