Library provides read access to the Artesian API
Project description
Artesian.SDK
This Library provides read access to the Artesian API
Getting Started
Installation
You can install the package directly from pip pip.
pip install artesian-sdk
Alternatively, to install this package go to the release page .
How to use
The Artesian.SDK instance can be configured using API-Key authentication
from artesian import ArtesianConfig
cfg = ArtesianServiceConfig("https://fake-artesian-env/", "{api-key}")
QueryService
Using the ArtesianServiceConfig cfg
we create an instance of the QueryService which is used to create Actual, Versioned and Market Assessment time series queries
Actual Time Series
from artesian import QueryService,Granularity
qs = QueryService(cfg);
data = qs.createActual() \
.forMarketData([100011484,100011472,100011477,100011490,100011468,100011462,100011453]) \
.inAbsoluteDateRange("2018-01-01","2018-01-02") \
.inTimeZone("UTC") \
.inGranularity(Granularity.HOUR) \
.execute()
To construct an Actual Time Series the following must be provided.
Actual Query | Description |
---|---|
Market Data ID | Provide a market data id or set of market data id's to query |
Time Granularity | Specify the granularity type |
Time Extraction Window | An extraction time window for data to be queried |
Go to Time Extraction window section
Versioned Time Series
from artesian import QueryService,Granularity
qs = QueryService(cfg);
q = qs.createVersioned() \
.forMarketData([100042422,100042283,100042285,100042281,100042287,100042291,100042289]) \
.inAbsoluteDateRange("2018-01-01","2018-01-02") \
.inTimeZone("UTC") \
.inGranularity(Granularity.HOUR)
q.forMUV().execute()
q.forLastNVersions(2).execute()
q.forLastOfDays("2019-03-12","2019-03-16").execute()
q.forLastOfDays("P0Y0M-2D","P0Y0M2D").execute()
q.forLastOfDays("P0Y0M-2D").execute()
q.forLastOfMonths("2019-03-12","2019-03-16").execute()
q.forLastOfMonths("P0Y-1M0D","P0Y1M0D").execute()
q.forLastOfMonths("P0Y-1M0D").execute()
q.forVersion("2019-03-12T14:30:00").execute()
To construct a Versioned Time Series the following must be provided.
Versioned Query | Description |
---|---|
Market Data ID | Provide a market data id or set of market data id's to query |
Time Granularity | Specify the granularity type |
Versioned Time Extraction Window | Versioned extraction time window |
Time Extraction Window | An extraction time window for data to be queried |
Go to Time Extraction window section
Market Assessment Time Series
from artesian import QueryService
qs = QueryService(cfg);
data = qs.createMarketAssessment() \
.forMarketData([100000032,100000043]) \
.forProducts(["D+1","Feb-18"]) \
.inAbsoluteDateRange("2018-01-01","2018-01-02") \
.execute()
To construct a Market Assessment Time Series the following must be provided.
Mas Query | Description |
---|---|
Market Data ID | Provide a market data id or set of market data id's to query |
Product | Provide a product or set of products |
Time Extraction Window | An extraction time window for data to be queried |
Go to Time Extraction window section
Artesian SDK Extraction Windows
Extraction window types for queries.
Date Range
.inAbsoluteDateRange("2018-08-01", "2018-08-10")
Relative Interval
.inRelativeInterval(RelativeInterval.ROLLING_WEEK)
Period
.inRelativePeriod("P5D")
Period Range
.inRelativePeriodRange("P-3D", "P10D")
MarketData Service
Using the ArtesianServiceConfig cfg
we create an instance of the MarketDataService which is used to retrieve MarketData infos.
from artesian import MarketDataService
mds = MarketDataService(cfg);
To list MarketData curves
page = 1
pageSize = 100
res = mds.readCurveRange(100042422, page, pageSize, versionFrom="2016-12-20" , versionTo="2019-03-12")
Links
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
Hashes for artesian_sdk-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972f60d7b2a7a4972254444df6e596b7c089e1d8457f1d4b98d6788c37a3e28b |
|
MD5 | 62193dfe3ff6075180ccf55623df134d |
|
BLAKE2b-256 | 824cbaa27a716312ea1e47e09a6be3929f217b9c1755ca863b680e338a3e56ed |