This is a unofficial wrapper for Vinter.co API
Project description
Unofficial Wrapper for the Vinter API
This is an unofficial wrapper for the Vinter API. It is not affiliated with Vinter in any way.
Installation
pip install vinterunofficial
Documentation
Usage
Valid AssetType
- single_assets
- multi_assets
Get Latest Data
from vinterunofficial import VinterAPI
# vinter = VinterAPI(<APIKEY>, <AssetType>)
vinter = VinterAPI(123456, "single_assets")
selected_symbol = "btc-usd-p-d"
# Get the latest value of the asset
data = vinter.get_latest_data(selected_symbol)
current_price = data[0]["value"]
created_at = data[0]["created_at"]
print("The current price of {} is {} at {}".format(selected_symbol, current_price, created_at))
Get Historical Data
from vinterunofficial import VinterAPI
# vinter = VinterAPI(<APIKEY>, <AssetType>)
vinter = VinterAPI(123456, "single_assets")
selected_symbol = "btc-usd-p-d"
# Get the latest value of the asset
data = vinter.get_data_by_date(selected_symbol, ["2022-12-04", "2022-12-09"])
for asset in data:
print("The price of {} on {} is {}".format(selected_symbol, asset["created_at"], asset["value"]))
Get All Active Symbols
from vinterunofficial import VinterAPI
single_assets = VinterAPI(123456, "single_assets")
multi_assets = VinterAPI(123456, "multi_assets")
all_active_symbol_multi = [asset["symbol"] for asset in multi_assets.get_all_active_symbols()]
all_active_symbol_single = [asset["symbol"] for asset in single_assets.get_all_active_symbols()]
print("All active symbols for multi assets: {}".format(all_active_symbol_multi))
print("All active symbols for single assets: {}".format(all_active_symbol_single))
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
Built Distribution
File details
Details for the file vinterunofficial-0.0.6.tar.gz
.
File metadata
- Download URL: vinterunofficial-0.0.6.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 313c3d463b064449beb56ddfa985078e44dd05e7309ff60d3a470186561d686e |
|
MD5 | daef4183b5a3c1f74bd23c6484e5c966 |
|
BLAKE2b-256 | bd5fa5b8e37af1b98ce55fba6d59609d599b2c16ec96bda229e2a13401cc6d67 |
File details
Details for the file vinterunofficial-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: vinterunofficial-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8569171c40ce11ca491c9edaff2887eb3d4836b6f5fbf17d3c29b44ad769c47 |
|
MD5 | 8d5cbbe62e6a16cb9571a3985dc2d475 |
|
BLAKE2b-256 | 7f728cd9d1756aa1b7f4fb5ab942a3f9a54d5f31141f7798809b0dfb36bdb8b3 |