Python library for interacting with the Velo Data API
Project description
velo-python
Python library for Velo API access see full documentation here.
Install
pip install velodata
Usage
import time, math
from velodata import lib as velo
# new velo client
client = velo.client('api_key')
# get all futures and pick one
future = client.get_futures()[0]
# last 10 minutes in 1 minute resolution
params = {
'type': 'futures',
'columns': ['open_price', 'close_price'],
'exchanges': [future['exchange']],
'products': [future['product']],
'begin': math.floor(time.time() * 1000) - 1000 * 60 * 11,
'end': math.floor(time.time() * 1000),
'resolution': 1
}
# returns dataframe
print(client.get_rows(params))
Streaming rows
Row requests are broken up into batches past a certain size. If you don't want to wait for all your requests to finish before receiving any data, you can use this:
batches = client.batch_rows(params)
for df in client.stream_rows(batches):
print(df)
License
Copyright 2023 Velo Data, license MIT
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
velodata-0.1.1.9.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for velodata-0.1.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e0678d4870451885bf34d9250d4ee86abd04dcabdfc12effd424e0f4583669b |
|
MD5 | f2da75c9e2b17c4516538d565a7ea345 |
|
BLAKE2b-256 | 79c96db0002ffa43d609c1863efa819bd9cd7b5e2879c60d1e59f8231eec6fda |