WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
EnviDat
opendataswiss
Commits
e308d0d6
Commit
e308d0d6
authored
May 06, 2022
by
Rebecca Kurup Buchholz
Browse files
Tested calling package_list
parent
9187f2d3
Pipeline
#525
passed with stages
in 2 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
converters/package_json_xml_converter.py
0 → 100644
View file @
e308d0d6
import
json
# Converter valid only for metadata schema of EnviDat
def
envidat_to_opendataswiss_converter
(
metadata_record
):
"""
Converts JSON data to XML fil
:param metadata_record: JSON data from EnviDat metadata record from
https://www.envidat.ch/api/action/current_package_list_with_resources
:return: XML file in OpenDataSwiss format like this https://www.envidat.ch/opendata/export/dcat-ap-ch.xml
"""
# TODO try using call to resource_show
with
open
(
metadata_record
)
as
json_format_file
:
# data = json.load(json_format_file)
# print(data)
pass
# ========================================== TESTING ===========================================================
envidat_to_opendataswiss_converter
(
"test_record.json"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment