Skip to main content

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:

  1. AlsiRawClient: Returns data in raw JSON format.
  2. 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


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.1b3.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

alsi_py-0.0.1b3-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file alsi-py-0.0.1b3.tar.gz.

File metadata

  • Download URL: alsi-py-0.0.1b3.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for alsi-py-0.0.1b3.tar.gz
Algorithm Hash digest
SHA256 f407f113b6ea1e1e9f4b1093a31bc1e91800066f7fcfdcd03f9e3ca7589ec1e9
MD5 b56a126032d9011807be43f5f0b4869d
BLAKE2b-256 aa5ce38fa051666da79b885c78e5722259cce1e8d760fe015e8f8d7e4b6ba01f

See more details on using hashes here.

File details

Details for the file alsi_py-0.0.1b3-py3-none-any.whl.

File metadata

  • Download URL: alsi_py-0.0.1b3-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for alsi_py-0.0.1b3-py3-none-any.whl
Algorithm Hash digest
SHA256 a7f6feb1379f3e2d7c462d159d2ea05c0a9c533c67bfebdc57effea998e6a79d
MD5 0843dc242112ad6cee5356353d3fb578
BLAKE2b-256 bb99d54d2221790e8516aba8c849c0dbea6b8f9d3206f1f49d2527c26ed2a20a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page