Package: pyESDL
pyESDLpyESDL is a library for using ESDL in python programs. ESDL stands for Energy System Description
Language and is created to support developers creating, parsing, generating ESDL-files with the
goal to create interoperable energy system transition tooling.This package contains all the ESDL classes of the ESDL language and anEnergySystemHandlerthat helps the developer to read and write ESDL-files.More information about ESDL can be found at:ESDL gitbook documentationwith a general introduction,
example applications and some code samples.ESDL Model Reference documentationthat describes all the
classes and definitions in detail using a clickable UML diagram.Support functions:PyESDL now comes with a lot of support functions for:handling profiles:ProfileManager: reading profiles from a CSV, converting to and from esdl.DateTimeProfile or esdl.TimeSeriesProfile.ExcelProfileManager: reading from and writing profiles to Excel filesInfluxDBProfileManager: reading from and writong profiles to InfluxDB (version 1.7)handling geometries: conversion to and from esdl geometries, WKT, WKB, GeoJSON, ...qunatity and units: unit conversion, converting a QuantityAndUnit to a string, building a QuantityAndUnit from a stringInstallingPyESDL now comes with a lot of support functions for handling profiles, geometries and qunatity and units. This requires
additional dependencies. As not all users might need all functionalities, there are several ways to install pyESDL.Use the following command to install the pyESDL python module including all dependencies from the PyPi registry:pip install pyESDL[all]To install the minimal version of pyESDL:pip install pyESDLTo install the dependencies for additional profile functionalities (only required for support for Excel and InfluxDB):pip install pyESDL[profiles]To install the dependencies for handling geometries:pip install pyESDL[geometry]DocumentationWe will start soon with generating more documentation onreadthedocs.UsageExample 1 - Creating an ESDL-file and saving it to diskfromesdl.esdl_handlerimportEnergySystemHandlerfromesdlimportesdlesh=EnergySystemHandler()es=esh.create_empty_energy_system(name="ES1",es_description='Nice Energy System',inst_title='instance 1',area_title="Area 51")print(es)esh.save(filename="test.esdl")Example 2 - Loading an ESDL file and adding a WindTurbine to an areafromesdl.esdl_handlerimportEnergySystemHandlerfromesdlimportesdlfrompprintimportpprintesh=EnergySystemHandler()# load an ESDL file and use type hinting to help the IDE to do auto completiones:esdl.EnergySystem=esh.load_file('test.esdl')print(es)# Create a WindTurbinewind_turbine=esdl.WindTurbine(name='WindTurbine at coast',rotorDiameter=50.0,height=100.0,type=esdl.WindTurbineTypeEnum.WIND_ON_COAST)# print the wind turbines properties in ESDL as a dictpprint(esh.attr_to_dict(wind_turbine))# Get the area where this windturbine should be addedarea51:esdl.Area=es.instance[0].area# add the WindTurbine to the areaarea51.asset.append(wind_turbine)# save the fileesh.save()# Give the WindTurbine a location on the maplocation=esdl.Point(lat=52.6030475337285,lon=4.729614257812501)wind_turbine.geometry=locationesh.save()# Convert the Energy System to an XML string and print itxml_string=esh.to_string()print(xml_string)Converting ESDL unitsExample:fromesdl.units.conversionimportconvert_to_unit,ENERGY_IN_J,ENERGY_IN_MWhconverted=convert_to_unit(5,ENERGY_IN_MWh,ENERGY_IN_J)18E9==converted>>TrueChangesVersion 24.2Fix bug when no tags are given for an InfluxDBProfileFix issue with multi-valued attribute values (such as values in TableRow)Start with the ReadTheDocs documentationVersion 24.1Add support for ESDL release 24.01Version 23.12.1Fix bug in ProfileManagerInfluxDBProfileManager.load_influxdb now returns an esdl.InfluxDBProfileInfluxDBProfileManager: improved handling of situations where no data is returnedVersion 23.12Bug fixes in InfluxDBProfileManagerVersion 23.11.2Add support for ESDL release 23.11 (with powerCurveTable for WindTurbine)Version 23.11.1Fix bug in determining the end_datetime of profilesVersion 23.11Implement EDR clientAdded more predefined QaUsSupport for tags in InfluxDBProfileManagerVersion 23.10.1Implement set_profile functionCorrected some bugs (datetime_utils missing, support for fields with '-')Version 23.10Add support functions for handling profiles, geometries and qunatity and units.Version 23.03Add support for ESDL release 23.03 (added 2 PowerPlant types, referenceYear for CostInformation, added fullLoadHours and operationalHours attributes to Consumer and Transport classes)Version 22.11.1Add support for ESDL release 22.11 (with KPI-KPI and Sector-Sector relation, ElectricBoiler, PowerPlant types, ...)Version 22.11Add support for Energy Data Repository files (*.edd)Add supoprt for linking to external files (e.g. stored in the EDR) usingget_external_reference(url, object_id)Add function to instantiate a class by its class name (instantiate_esdltype(className))Version 22.10.0Add support for ESDL release 22.10 (with Port-Constraint relation, support for modelling material flows, added powerFactor attribute for electricity related assets, DataSourceList)Version 22.7.0Add support for ESDL release 22.07 (with ConnectableAsset, ExposedPortsAsset, PumpedHydroPower and CAES assets, restructured some LabelJump information, asset Constraints)Version 21.12.0Add support for ESDL release 21.12 (with quantity and unit information for InputOutputRelation, renaming of some distribution information classes of AggregatedBuildings)Version 21.11.0Add support for ESDL release 21.11 (with HybridHeatpump, developmentCosts, Commodity emission attribute)Version 21.10.0Add support for ESDL release 21.10 (with storage volumes)Version 21.9.1Add support for ESDL release 21.9 (with pipe and cable relations)Version 21.9.0Fix pyecore 0.12.1 dependency issueVersion 21.7.1Add support for ESDL release 21.7 (with BufferDistance, ATES)Version 21.6.2Fix issue with version definition, making the EnergySystemHandler unusable.Add get_all_instances_of_type() to EnergySystemHandler to retrieve all the instances of a certain type in an EnergySystem.E.g.esh.get_all_instances_of_type(esdl.GenericProfile)will give you all the profiles defined in the EnergySystem.Version 21.6.1Add support for InputOutputRelationReleasingThe release process is as follows:Do agit tagwith the new version numberDopython setup.py sdist bdist_wheelto create the tarball and wheel in thedistfolderupload to PyPi:python3 -m twine upload --repository pyESDL dist/*