Skip to content

Python package to interact with valenoq.com RESTful API

Notifications You must be signed in to change notification settings

samarkanov/valenoq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Valenoq Python Library

N|Solid

Build Status

Python package to interact with valenoq.com RESTful API

Installation

 $ pip3 install valenoq

Configuration

from valenoq.api import config
config.set(api_key="yourApiKey") # the key is available upon registration at https://valenoq.com

Current limitations

API documentation

http://data.samarkanov.info/valenoq-python/

Getting historical intraday data

Basic functionality:

from valenoq.api import config, request
config.set(api_key="yourApiKey")

# End-of-the-day OHCLV bars for a ticker
data = request.get("AAPL", date="2018-05-01", frequency="day")

# Intraday 1-hour bars for a ticker
data = request.get("AAPL", date="2018-05-01")
# or
data = request.get("AAPL", date="2018-05-01", frequency="hour")

# Intraday x-minute bars for a ticker
data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=1)  # 1-minute bars
data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=5)  # 5-minutes bars
data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=10) # 10-minute bars
data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=15) # 15-minute bars
data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=5)  # 30-minute bars

# Interval of dates is supported:
data = request.get("AAPL", start="2018-05-01", end="2018-05-05", frequency="minute", collapse=15)

Getting historical data for a list of tickers:

# 1-minute bars for AAPL, MU and INTC:
data = request.get(["AAPL", "MU", "INTC"], date="2018-05-01", frequency="minute", collapse=1)

# 15-minute bars between {01/May/2018 - 05/May/2018} for AAPL and INTC
request.get(["AAPL", "INTC"], start="2018-05-01", end="2018-05-05", frequency="minute", collapse=15)

Getting balance sheet data

# Last quarter data for a ticker:
data = request.balance_sheet("AAPL")

# Last quarter data for a list of tickers:
data = request.balance_sheet(["AAPL", "INTC"])

# Five last balance sheets:
data = request.balance_sheet("AAPL", nr_quarters=5)