Package: drb-driver-discodata
DISCODATA driverThis drb-driver-discodata module implements DISCODATA databases access with DRB data model. It is able to navigates among the database contents.For more information about DISCODATA see:https://discodata.eea.europa.eu/Help.htmlDISOCDATA Factory and DISCODATA NodeThe module implements the basic factory model defined in DRB in its node resolver. Based on the python entry point mechanism, this module can be dynamically imported into applications.The entry point group reference isdrb.driver.The driver name isdiscodata.The factory classDrbDiscodataFactoryis encoded intodrb.drivers.factorymodule.NodesDrbDiscodataServiceNodeRepresent a node for browsing Discodata databases.
Its attributedatabasescontain the list of all the available databases in the discodata service.
Its children is a list ofDrbDiscodataDataBaseNodethat can be browsed by name (of the database).
This node has no implementations.DrbDiscodataDataBaseNodeRepresent a discodata database.
Its attributetablescontain the list of the tables available in this database.
Its children is a list ofDrbDiscodataTableNodethat can be browsed by name.DrbDiscodataTableNodeRepresent a table of discodata.
Its attributecolumnscontain the list of the columns namof this table.
Its children is a list ofDrbDiscodataRowList.
A panda DataFrame and xarray Dataset representations are available using theget_impl()methodlimitationsThe current version does not manage child modification and insertion.DrbDiscodataNodeis currently read only.
The factory to build DrbDiscodataNode supports file directly opening it with path, for other implementation ByteIO or BufferedIOBase, they are manged with a local temporary file, removed when the node is closed..Using this moduleTo include this module into your project, thedrb-driver-discodatamodule shall be referenced intorequirements.txtfile, or the following pip line can be run:pip install drb-driver-discodataExamplesThis example shows how to create aDrbDiscodataServiceNodethen look for the first 3 databases using the attribute of the service:fromdrb.drivers.discodataimportDrbDiscodataServiceNodeservice=DrbDiscodataServiceNode(path="https://discodata.eea.europa.eu")databases=service@"databases"fordatabaseindatabases[:3]:print(database)Output :AirQualityDataFlows
BISE
CataloguePolicyEvaluationsThen we can get the list of tables from a specific database:database = service["AirQualityDataFlows"]
tables = database @ "tables"
for table in tables:
    print(table)Output :AirQualityStatistics
AssessmentRegimeMethods
AssessmentRegimes
AttainmentMethods
Attainments
Measurements
Models
ZonesFinaly, we can get a pandas.DataFrame implementation:import pandas as pd

table = database["Models"]
print(table.get_impl(pd.DataFrame))Output :Country CountryCode  B2G_Namespace  ...             AuthorityAddress                                      SourceDataURL                 Imported
0      Austria  AT          AT.0008.20.AQ  ...                               http://cdr.eionet.europa.eu/at/eu/aqd/e1b/envx...  2021-11-20T18:38:50.493
1      Austria  AT          AT.0008.20.AQ  ...                               http://cdr.eionet.europa.eu/at/eu/aqd/e1b/envx...  2021-11-20T18:38:50.493
2      Austria  AT          AT.0008.20.AQ  ...                               http://cdr.eionet.europa.eu/at/eu/aqd/e1b/envx...  2021-11-20T18:38:50.493
3      Austria  AT          AT.0008.20.AQ  ...                               http://cdr.eionet.europa.eu/at/eu/aqd/e1b/envx...  2021-11-20T18:38:50.493
4      Austria  AT          AT.0008.20.AQ  ...                               http://cdr.eionet.europa.eu/at/eu/aqd/e1b/envx...  2021-11-20T18:38:50.493
...        ...         ...            ...  ...                          ...                                                ...                      ...
2495  Slovenia  SI             SI.ARSO.AQ  ...  Vojkova 1b, LJUBLJANA, 1000  http://cdr.eionet.europa.eu/si/eu/aqd/e1b/envy...  2021-11-20T19:08:05.693
2496  Slovenia  SI             SI.ARSO.AQ  ...  Vojkova 1b, LJUBLJANA, 1000  http://cdr.eionet.europa.eu/si/eu/aqd/e1b/envy...  2021-11-20T19:08:05.693
2497  Slovenia  SI             SI.ARSO.AQ  ...  Vojkova 1b, LJUBLJANA, 1000  http://cdr.eionet.europa.eu/si/eu/aqd/e1b/envy...  2021-11-20T19:08:05.693
2498  Slovenia  SI             SI.ARSO.AQ  ...  Vojkova 1b, LJUBLJANA, 1000  http://cdr.eionet.europa.eu/si/eu/aqd/e1b/envy...  2021-11-20T19:08:05.693
2499  Slovenia  SI             SI.ARSO.AQ  ...  Vojkova 1b, LJUBLJANA, 1000  http://cdr.eionet.europa.eu/si/eu/aqd/e1b/envy...  2021-11-20T19:08:05.693

[2500 rows x 39 columns]