Package: roiti-gie
IntroductionPython client for the ALSI/AGSI APIsDocumentation of the API can be found onGIE's websiteDocumentation of the client API can be found on:https://roiti-ltd.github.io/roiti-gie/Installationpython-mpipinstallroiti-gieUsageThe package is split in two clients:GieRawClient: Returns data in raw Python Dict.GiePandasClient: Returns parsed data in the form of a pandas DataFrame.importasyncioimportosfromroiti.gieimportGiePandasClientasyncdefmain():"""The following methods return pandas DataFrame, however you can use theraw client "raw_client = GieRawClient(api_key=Your API key)" and you will get the results asPython dictionaries.NOTE that every method available for AGSI is also available for ALSI"""API_KEY=os.getenv("API_KEY")pandas_client=GiePandasClient(api_key=API_KEY)# You can specify the country, start date, end date, size (the number of results) in order to get country storageawaitpandas_client.query_country_agsi_storage("AT",start="2020-01-01",end="2022-07-10",size=60)# You can run the query without any parameters (in order to get all countries result)awaitpandas_client.query_country_alsi_storage()# You can use this query in order to get all AGSI/ALSI EICs (Energy Identification Code)awaitpandas_client.query_alsi_eic_listing()# Query which lists all the ALSI/AGSI news (without params)awaitpandas_client.query_alsi_news_listing()# Query which lists the news for a specific country (using the url code)awaitpandas_client.query_alsi_news_listing(43419)# Query which lists the data for a current facility storage (provide the storage name and params)awaitpandas_client.query_agsi_facility_storage("ugs_haidach_astora",start="2022-10-10")# You can list the data for a current storage only using its nameawaitpandas_client.query_alsi_facility_storage("dunkerque")# Query which lists the data for a current company (also date and size are by choice)awaitpandas_client.query_agsi_company("astora",size=60)awaitpandas_client.query_alsi_company("dunkerque_lng",size=200)# Query which lists the unavailability for a current country (country name, date, size are optional)awaitpandas_client.query_agsi_unavailability("GB",size=60)awaitpandas_client.query_agsi_unavailability()awaitpandas_client.query_alsi_unavailability("FR")awaitpandas_client.close_session()# set_event_loop_policy method is used in order to avoid EventLoopError for Windows# asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())asyncio.run(main())Running unit testsTell pytest where to look for unit tests and create env for ALSI API keyOn UnixexportPYTHONPATH=./src/roitiexportAPI_KEY='<API_KEY>'On Windows$env:PYTHONPATH='./src/roiti'$env:API_KEY='<API_KEY>'Run unit tests in coverage modepython-mpytest./tests--import-mode=append--covContributingSet up your working environment:Create virtual environmentpython-mvenvvenvActivate the virtual environmentOn UNIX systemsourcevenv/bin/activateOn Windows system./venv/Scripts/activateInstall required packages:python-mpipinstall-rrequirements.txt-rrequirements-dev.txtBumping the package version after making changes:bumpversionmajor|minor|patch|buildAknowledgementsMany thanks to theentsoe-pylibrary for serving as inspiration for this library.Frank Boermanand hisGIE repository, from which we copied the lookup function ideas.