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
Show more breadcrumbs
dbnomics-fetchers
eurostat-fetcher
Commits
0ed5bba9
Commit
0ed5bba9
authored
4 years ago
by
Christophe Benz
Browse files
Options
Downloads
Patches
Plain Diff
Read --datasets option default value from DATASETS env var
parent
b918c0f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#201363
canceled with stage
in 54 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
convert.py
+9
-1
9 additions, 1 deletion
convert.py
with
9 additions
and
1 deletion
convert.py
+
9
−
1
View file @
0ed5bba9
...
...
@@ -59,6 +59,7 @@ namespace_url_by_name = {"xml": "http://www.w3.org/XML/1998/namespace"}
timings
=
None
DAILY_PERIOD_RE
=
re
.
compile
(
r
"
(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})
"
)
DATASETS_ENV_VAR
=
'
DATASETS
'
FULL_ENV_VAR
=
'
FULL
'
...
...
@@ -323,12 +324,19 @@ def toc_to_category_tree(xml_element, toc_dataset_json_stub_by_code):
def
main
():
global
args
global
timings
datasets_from_env
=
os
.
getenv
(
DATASETS_ENV_VAR
)
if
datasets_from_env
:
datasets_from_env
=
datasets_from_env
.
split
(
"
,
"
)
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
source_dir
'
,
type
=
Path
,
help
=
'
path of source directory containing Eurostat series in source format
'
)
parser
.
add_argument
(
'
target_dir
'
,
type
=
Path
,
help
=
'
path of target directory containing datasets &
'
'
series in DBnomics JSON and TSV formats
'
)
parser
.
add_argument
(
'
--datasets
'
,
nargs
=
'
+
'
,
metavar
=
'
DATASET_CODE
'
,
help
=
'
convert only the given datasets (datasets codes, space separated)
'
)
parser
.
add_argument
(
'
--datasets
'
,
nargs
=
'
+
'
,
metavar
=
'
DATASET_CODE
'
,
default
=
datasets_from_env
,
help
=
'
convert only the given datasets (datasets codes, space separated)
'
)
parser
.
add_argument
(
'
--full
'
,
action
=
'
store_true
'
,
default
=
os
.
getenv
(
FULL_ENV_VAR
),
help
=
'
convert all datasets; default behavior is to convert what changed since last commit
'
)
parser
.
add_argument
(
'
--log
'
,
default
=
'
INFO
'
,
help
=
'
level of logging messages
'
)
...
...
This diff is collapsed.
Click to expand it.
Christophe Benz
@cbenz
mentioned in issue
management#846 (moved)
·
4 years ago
mentioned in issue
management#846 (moved)
mentioned in issue management#846
Toggle commit list
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