Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eurostat-fetcher
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
There was a problem fetching the latest pipeline status.
Show more breadcrumbs
dbnomics-fetchers
eurostat-fetcher
Commits
eb1471c9
Commit
eb1471c9
authored
6 years ago
by
Christophe Benz
Browse files
Options
Downloads
Patches
Plain Diff
Rename convert script
parent
fc4840ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#6608
failed with stage
in 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
convert.py
+15
-13
15 additions, 13 deletions
convert.py
with
15 additions
and
13 deletions
eurostat_to_dbnomics
.py
→
convert
.py
+
15
−
13
View file @
eb1471c9
...
...
@@ -50,17 +50,24 @@ from lxml import etree
import
ujson
as
json
data_package_json
=
{
"
dbnomics
"
:
{
"
data_model_version
"
:
"
0.7.5
"
,
}
}
provider_code
=
'
eurostat
'
provider_json
=
{
"
code
"
:
provider_code
,
"
name
"
:
"
Eurostat
"
,
"
region
"
:
"
European Union
"
,
"
terms_of_use
"
:
"
http://ec.europa.eu/eurostat/about/policies/copyright
"
,
"
website
"
:
"
http://ec.europa.eu/eurostat/home
"
,
}
args
=
None
# Will be defined by main().
git_blob_filemode
=
0o100644
git_tree_filemode
=
0o040000
log
=
logging
.
getLogger
(
__name__
)
provider_code
=
'
Eurostat
'
provider_json
=
dict
(
code
=
provider_code
,
region
=
"
European Union
"
,
terms_of_use
=
"
http://ec.europa.eu/eurostat/about/policies/copyright
"
,
website
=
"
http://ec.europa.eu/eurostat/home
"
,
)
required_observations_tsv_column_names
=
[
"
PERIOD
"
,
"
VALUE
"
]
sdmx_file_extension
=
"
.sdmx.xml
"
toc_nsmap
=
{
...
...
@@ -159,7 +166,7 @@ def iter_git_objects_in_sdmx_series_element(series_element, sdmx_blob_name, dsd_
series_element_attributes
=
OrderedDict
([
(
attribute_key
,
attribute_value
)
for
attribute_key
,
attribute_value
in
series_element
.
attrib
.
items
()
if
attribute_key
not
in
{
"
TIME_FORMAT
"
}
if
attribute_key
not
in
{
"
TIME_FORMAT
"
}
# Redundant with FREQ.
])
dimensions_codes_order
=
list
(
series_element_attributes
.
keys
())
...
...
@@ -413,11 +420,6 @@ def main():
# Write datapackage.json.
data_package_json
=
{
"
dbnomics
"
:
{
"
data_model_version
"
:
0.7
,
# Matches version in setup.py of dbnomics-data-model Python package.
}
}
data_package_json_blob
=
Blob
.
from_string
(
json
.
dumps
(
data_package_json
,
ensure_ascii
=
False
,
indent
=
2
,
sort_keys
=
True
).
encode
(
'
utf-8
'
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment