Skip to content

Commit

Permalink
Restapi: Add more details to producer paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Mar 10, 2024
1 parent 046410e commit fbf8c30
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions wetterdienst/ui/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from fastapi import FastAPI, HTTPException, Query
from fastapi.responses import HTMLResponse, PlainTextResponse, Response

from wetterdienst import Provider, Wetterdienst, __appname__, __version__
from wetterdienst import Info, Provider, Wetterdienst, __appname__, __version__
from wetterdienst.core.timeseries.request import TimeseriesRequest
from wetterdienst.core.timeseries.result import (
_InterpolatedValuesDict,
Expand All @@ -36,9 +36,6 @@

log = logging.getLogger(__name__)

PRODUCER_NAME = "Wetterdienst"
PRODUCER_LINK = "https://github.com/earthobservations/wetterdienst"

CommaSeparator = StringListParamType(",")


Expand All @@ -54,6 +51,7 @@ def index():
f"<li><a href={url} target='_blank' rel='noopener'>{shortname}</a> ({name}, {country}) - {copyright_}</li>"
)
sources = "\n".join(sources)
info = Info()
return f"""
<html>
<head>
Expand Down Expand Up @@ -139,8 +137,11 @@ def index():
<li><a href="api/summarize?provider=dwd&network=observation&parameter=temperature_air_mean_200&resolution=daily&station=00071&date=1986-10-31/1986-11-01" target="_blank" rel="noopener">DWD Climate Summary</a></li>
</div>
<h2>Producer</h2>
<div class="box">
{PRODUCER_NAME} - <a href="{PRODUCER_LINK}" target="_blank" rel="noopener">{PRODUCER_LINK}</a></li>
<div class="List">
<li>Version: {info.__version__}</li>
<li>Authors: {', '.join(f"""<a href='https://github.com/{author.github_handle}' target='_blank' rel='noopener'>{author.name}</a> ({author.email})""" for author in info.authors)}</li>
<li>Documentation: <a href="{info.documentation}" target="_blank" rel="noopener">{info.documentation}</a></li>
<li>Repository: <a href="{info.repository}" target="_blank" rel="noopener">{info.repository}</a></li>
</div>
<h2>Providers</h2>
<div class="list">
Expand Down

0 comments on commit fbf8c30

Please sign in to comment.