Getting timeseries data from Belvis Rest API.
Project description
Belvys
Fetch data from Kisters Belvis API. It has 3 classes: Tenant, which is the main class, and Structure and Api, which it depends on.
Class Tenant
This class uses a structure specification (see Structure) and an interface (see Api) to retrieve timeseries (more specifically portfolyo.PfLine instances) from Belvis.
It can be created from a Structure and Api instance, which can be accessed from the .structure and .api properties.
Class Structure
The purpose of this class is primarily to specify the portfolios and timeseries we are interested in. This includes original Belvis portfolios, as well as synthetic ones that are the sum of several original porfolios. It also specifies where relevant prices can be found in Belvis.
It is used by the Tenant class, but can also be used stand-alone to load a structure file and investigate, which data is defined and how.
The most convenient way to create a Structure instance is from a yaml file, with the Structure.from_file() class method.
An example structure is returned by the belvys.example_structure() function; the corresponding file can stored to the file system with belvys.example_structure_to_file().
Class Api
This class is used to query the belvis Api and retrieve data, including the authentication part. It is used by the Tenant class for this purpose, but can also be used stand-alone to investigate the timeseries available in a Belvis instance.
For example, we can create an instance with api = belvys.Api('belvisserver:port', 'gas'), then provide access with api.access_from_usr_pwd('Myfirst.Lastname', 'my!p@ssw0rd') and finally query it, e.g. to find the timeseries in a certain portfolio (api.find_tsids), or, with the unique timeseries id, get information (api.metadata) or values (api.series).
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 belvys-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8b283b3c641ce9fc15dade155cacde1b724b3f3138af0b3ce85687f24c2d5a1 |
|
MD5 | 76d4aa5052a4abefdd69cc9ff510819d |
|
BLAKE2b-256 | 9b6ecf11c8bdb6a462fb94bdfc8129ca9b451d0d1da34dac2419cf1a009a5c6e |