GithubHelp home page GithubHelp logo

metaodi / tecdottir Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 465 KB

API for weather stations of the Wasserschutzpolizei Zurich

Home Page: https://tecdottir.herokuapp.com

License: MIT License

JavaScript 85.18% Python 11.19% Shell 3.62%

tecdottir's Introduction

Build Status

tecdottir

This is a project to get measurements from tecson meteo stations.

The City of Zurich has two such stations:

The data is available as CSV from Open Data Zurich.

tecdottir is an API based on this data.

Showcases

Projects based on this API are shown.

(if you want on the list, create an issue or PR to add your project)

Development

We use swagger to document the API. Please install the CLI tool to edit the swagger file:

npm install -g swagger

(you might need root privileges to do so)

After installing the CLI tool, you can start editing:

swagger project edit

To start the server use:

swagger project start

Tests

To run the tests, use the following command:

npm test

Local database

For local developlment you might want to use a local database in a docker container

docker run --rm -P -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD="1234" --name pg postgres:alpine

Or use the provided script:

start_local_database.sh # start in it's own shell

Then you can set DATABASE_URL in .env to postgresql://postgres:1234@localhost:5432/postgres

Once the db is there, import the data:

setup_local_database.sh

Create a new release

  1. Update the version number in package.json and api/swagger/swagger.yaml
  2. Update the CHANGELOG.md
  3. Push code to GitHub
  4. Create a new release on GitHub
  5. Wait for the GitHub Action to deploy the app to heroku

tecdottir's People

Contributors

metaodi avatar dependabot[bot] avatar

Stargazers

David Ochsenbein avatar Eduard Cuba avatar Markus Steiger avatar

Watchers

 avatar Markus Steiger avatar  avatar

Forkers

dongoginho

tecdottir's Issues

no actual data

actual data is missing. last timestamp is 2022-11-17T16:30:00.000Z

Data Refresh

Hello, first of all, thanks for your work!
Secondly, I wanted to ask if it is possible to increase the number of updates during the day.
I'm trying to create an "Alexa" skill to retrieve the temperature but as far as I can see the data is rather old.
For example, I'm performing a query at 16:09 and the result is "value": "2023-02-02T13:30:00+01:00".
Let me already say thank you if you would have the chance to work on this suggestion!

Recent data is empty for the current month

Hey I have a question

I was running this command successfully since a very long time. But since approx a year, the current month is always empty:

curl -X 'GET' 'https://tecdottir.herokuapp.com/measurements/tiefenbrunnen?startDate=2023-03-13&endDate=2023-03-14&sort=timestamp_cet%20desc&offset=0' -H "accept: application/json"

{"ok":true,"total_count":0,"row_count":0,"result":[]}%

Any idea what I'm doing wrong?

Default query with no startDate is empty

Since a while it seems that the default queries return empty results. Only by specifying a startDate that is in the past (multiple days) the request returns data.
My integration is broken for a while but did not find the time to check.
Is there a change needed in order to get the current values?

empty results:

curl -X 'GET' \
  'https://tecdottir.herokuapp.com/measurements/tiefenbrunnen?sort=timestamp_cet%20desc&limit=500&offset=0' \
  -H 'accept: application/json'

compared to:

curl -X 'GET' \
  'https://tecdottir.herokuapp.com/measurements/tiefenbrunnen?startDate=2022-08-05&sort=timestamp_cet%20desc&limit=500&offset=0' \
  -H 'accept: application/json'

Use morph.io scraper

Consider to use morph io to scrape the data, to keep the data and tackle the caching problem (see #2)

No new data since 2022-08-05

Hi,
Unfortunately, the latest data in the csv from stadt-zuerich (and therefore also in your API) is from 2022-08-05T19:30:00+00:00 and no newer data is available. The https://www.tecson-data.ch/zurich/tiefenbrunnen/index.php is still up to date. I'm not sure if this is the same issue as #32 if so, sorry for creating a new one.
I'm guessing the .csv are no longer automatically updated which is no fault of the tecdottir API here, but it would mean getting the current data would require to now access the password protected part of the tecson-data page :(

Hacked keyname

The hardware to measuring the water temperature is at the moment defect. The dataowner solved this with a special(!) "keyname". Is there a simple solution to recognize this "hacked" keyname and give a valid response?

Only load new data

Keep the historical data in the database and only update the current year.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.