metadata
- class Json_Metadata(dependencies)[source]
Bases:
egon.data.datasets.Dataset- name: str
The name of the Dataset
- version: str
The
Dataset’s version. Can be anything from a simple semantic versioning string like “2.1.3”, to a more complex string, like for example “2021-01-01.schleswig-holstein.0” for OpenStreetMap data. Note that the latter encodes theDataset’s date, region and a sequential number in case the data changes without the date or region changing, for example due to implementation changes.
- context()[source]
Project context information for metadata
- Returns
dict – OEP metadata conform data license information
- generate_resource_fields_from_db_table(schema, table, geom_columns=None)[source]
Generate a template for the resource fields for metadata from a database table.
For details on the fields see field 14.6.1 of Open Energy Metadata standard. The fields name and type are automatically filled, the description and unit must be filled manually.
Examples
>>> from egon.data.metadata import generate_resource_fields_from_db_table >>> resources = generate_resource_fields_from_db_table( ... 'openstreetmap', 'osm_point', ['geom', 'geom_centroid'] ... )
- Parameters
schema (str) – The target table’s database schema
table (str) – Database table on which to put the given comment
geom_columns (list of str) – Names of all geometry columns in the table. This is required to return Geometry data type for those columns as SQL Alchemy does not recognize them correctly. Defaults to [‘geom’].
- Returns
list of dict – Resource fields
- generate_resource_fields_from_sqla_model(model)[source]
Generate a template for the resource fields for metadata from a SQL Alchemy model.
For details on the fields see field 14.6.1 of Open Energy Metadata standard. The fields name and type are automatically filled, the description and unit must be filled manually.
Examples
>>> from egon.data.metadata import generate_resource_fields_from_sqla_model >>> from egon.data.datasets.zensus_vg250 import Vg250Sta >>> resources = generate_resource_fields_from_sqla_model(Vg250Sta)
- Parameters
model (sqlalchemy.ext.declarative.declarative_base()) – SQLA model
- Returns
list of dict – Resource fields
- license_agpl(attribution='© eGon development team')[source]
License information for GNU Affero General Public License v3.0
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© GeoBasis-DE / BKG’
- Returns
dict – OEP metadata conform data license information
- license_ccby(attribution='© eGon development team')[source]
License information for Creative Commons Attribution 4.0 International (CC-BY-4.0)
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© GeoBasis-DE / BKG’
- Returns
dict – OEP metadata conform data license information
- license_dedl(attribution='© eGon development team')[source]
License information for Data licence Germany – attribution – version 2.0
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© GeoBasis-DE / BKG’
- Returns
dict – OEP metadata conform data license information
- license_egon_data_odbl()[source]
ODbL license with eGon data attribution
- Returns
dict – OEP metadata conform data license information for eGon tables
- license_geonutzv(attribution='© eGon development team')[source]
License information for GeoNutzV
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© GeoBasis-DE / BKG’
- Returns
dict – OEP metadata conform data license information
- license_odbl(attribution='© eGon development team')[source]
License information for Open Data Commons Open Database License (ODbL-1.0)
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© OpenStreetMap contributors’
- Returns
dict – OEP metadata conform data license information
- licenses_datenlizenz_deutschland(attribution='© eGon development team')[source]
License information for Datenlizenz Deutschland
- Parameters
attribution (str) – Attribution for the dataset incl. © symbol, e.g. ‘© GeoBasis-DE / BKG’
- Returns
dict – OEP metadata conform data license information