A library to query ALSI data
Project description
alsi-py
Python client for the ALSI API (Aggregated LNG Storage Inventory)
Documentation of the API can be found on: https://alsi.gie.eu/GIE_API_documentation_v004.pdf
Installation
python3 -m pip3 install alsi-py
Usage
The package is split in two clients:
- AlsiRawClient: Returns data in raw JSON format.
- AlsiPandasClient: Returns parsed data in the form of a pandas dataframe.
from alsi.raw_client import AlsiRawClient
from alsi.pandas_client import AlsiPandasClient
from datetime import datetime
import asyncio
API_KEY = '<API_KEY>'
country_code = 'DE'
company_code = '21X000000001368W'
facility_code = '21W000000000100J'
async def main():
client = AlsiRawClient(api_key=API_KEY)
# Functions that return JSON.
client.query_data_for_facility(facility_code, company_code, country_code)
client.query_agg_data_for_europe_or_noneurope(europe='eu')
client.query_agg_data_by_country(contry_code='BE')
client.query_data_by_company_and_country(company_code, country_code)
# Filter results by time
client.query_agg_data_by_country(country_code, start=datetime(2017,1,1), end=datetime(2018,1,1), limit=10)
# Create pandas client. All functions are the same as the raw client.
pandas_client = AlsiPandasClient(api_key=API_KEY)
# In the end of the code, make sure to close the client session:
await client.close_session()
# or
await pandas_client.close_session()
asyncio.run(main())
For more information regarding company codes, facility codes and country codes visit: https://alsi.gie.eu/#/api
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
alsi-py-0.0.1b4.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file alsi-py-0.0.1b4.tar.gz
.
File metadata
- Download URL: alsi-py-0.0.1b4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a04e1c5657454c16403e3e04051fb128b642c5f6ce6c1b2e96ad7371bbc22244 |
|
MD5 | a3c4c9f59141e0538c3c039ff0df8b67 |
|
BLAKE2b-256 | 1b5a8128f951cd2c7b61d6c7e8df5f1b5f9d86be93f8e0818280fdecdc80dfbb |
File details
Details for the file alsi_py-0.0.1b4-py3-none-any.whl
.
File metadata
- Download URL: alsi_py-0.0.1b4-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c103d5cadffadca44d0ad4f775e1f1515ea43d4dd22b5f0c38638c1c9fc53b8e |
|
MD5 | a2918910ea2b66386eb776eb89cee2dd |
|
BLAKE2b-256 | 88f66300dfd6acb5a4d74f5d4fb20115dd90b0993339655a28e940934d8d1a2e |