Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tsm-orchestration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UFZ TSM
tsm-orchestration
Commits
8a3bd539
Commit
8a3bd539
authored
2 months ago
by
Florian Gransee
Browse files
Options
Downloads
Patches
Plain Diff
adjust docstrings
parent
fd4ca2a6
No related branches found
No related tags found
Loading
Pipeline
#486426
passed
2 months ago
Stage: integration
Stage: end-to-end
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cron/scripts/ext_api_sync/uba_api_sync.py
+15
-5
15 additions, 5 deletions
cron/scripts/ext_api_sync/uba_api_sync.py
with
15 additions
and
5 deletions
cron/scripts/ext_api_sync/uba_api_sync.py
+
15
−
5
View file @
8a3bd539
...
...
@@ -47,7 +47,9 @@ def get_timerange_parameters():
def
get_components_and_scopes
():
"""
Get components (i.e measured quantites) and scopes (aggregation infos) for later mapping
"""
"""
Get components (i.e measured quantites) and scopes
(aggregation infos) for later mapping
"""
response_components
=
requests
.
get
(
"
https://www.umweltbundesamt.de/api/air_data/v3/components/json
"
)
...
...
@@ -69,7 +71,9 @@ def get_components_and_scopes():
def
get_station_info
(
station_id
:
str
)
->
list
:
"""
Get all available components and scope combinations of a given station
"""
"""
Get all available components and scope combinations of a given
station
"""
station_info
=
list
()
response
=
requests
.
get
(
"
https://www.umweltbundesamt.de/api/air_data/v3/measures/limits
"
...
...
@@ -91,7 +95,9 @@ def request_measure_endpoint(
time_from
:
int
,
time_to
:
int
,
)
->
dict
:
"""
Request uba api measure endpoint for a given component and scope and a given time range
"""
"""
Request uba api measure endpoint for a given component and scope
and a given time range
"""
params
=
{
"
date_from
"
:
date_from
,
"
date_to
"
:
date_to
,
...
...
@@ -122,7 +128,9 @@ def combine_measure_responses(
components
:
dict
,
scopes
:
dict
,
)
->
list
:
"""
Combine uba respones for all component/scope combinations into one object
"""
"""
Combine uba respones for all component/scope combinations into
one object
"""
measure_data
=
list
()
station_info
=
get_station_info
(
station_id
)
for
entry
in
station_info
:
...
...
@@ -178,7 +186,9 @@ def get_airquality_data(
time_to
:
int
,
components
:
dict
,
)
->
list
:
"""
Request uba api airquality endpoint for a given station_id and time range
"""
"""
Request uba api airquality endpoint for a given station_id and
time range
"""
params
=
{
"
date_from
"
:
date_from
,
"
date_to
"
:
date_to
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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