Skip to content

Commit

Permalink
Update resources to v 1.5.2.#386
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskar.Oetken committed Mar 28, 2023
1 parent b98761a commit 7cd6690
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions open_mastr/soap_api/metadata/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,34 +240,36 @@ def create_datapackage_meta_json(
raw_fields.append({"name": name, **specification, "unit": None})

if "raw" in data:
resource = {
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_raw",
"path": filenames["raw"][tech]["joined"],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}

resource = [
{
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_raw",
"path": filenames["raw"][tech]["joined"],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
]
resources_meta["resources"].append(resource)
if "cleaned" in data:
resource = {
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_cleaned",
"path": filenames["cleaned"][tech],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}

resource = [
{
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_cleaned",
"path": filenames["cleaned"][tech],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
]
resources_meta["resources"].append(resource)
if "postprocessed" in data:
processed_fields = [
Expand Down Expand Up @@ -312,11 +314,9 @@ def create_datapackage_meta_json(
resource = {
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}",
"title": f"open-MaStR {tech} units",
"path": filenames["postprocessed"][tech],
"scheme": "file",
"format": "PostgreSQL",
"encoding": "utf-8",
"mediatype": "text/csv",
"schema": {
"fields": raw_fields + processed_fields,
"primaryKey": ["EinheitMastrNummer"],
Expand Down

0 comments on commit 7cd6690

Please sign in to comment.