Giter Club home page Giter Club logo

meteostat-server's Introduction

Meteostat Server

The Meteostat server allows everyone to run a local instance of the Meteostat JSON API. The server provides different endpoints which return historical weather data and meta information in JSON format.

Installation

First, make sure you have Git and Python 3 running on your machine.

Then, clone this repository by running:

git clone https://github.com/meteostat/meteostat-server

Now you can install the package's dependencies:

cd meteostat-server
python3 -m pip install . -U

Before you can start serving JSON data, make sure to place a customized config.ini file in the ~/.meteostat-server directory. You can use config.example.ini in the root of this repository as a template.

Finally, you can run a local test server using:

python3 app.py

Deployment

When deploying Meteostat Server for production, you should use a robust web server like Apache or nginx. Generally, the process is as straight-forward as deploying any other Flask application.

Apache

At Meteostat we're using Apache on Ubuntu. The Apache server is running using the app.wsgi file provided in this repository.

First, let's install mod_wsgi:

apt-get install libapache2-mod-wsgi-py3

Then, add an Apache configuration file using this template:

ServerName jasper.meteostat.net
WSGIScriptAlias / /var/www/vhosts/jasper.meteostat.net/meteostat-server/app.wsgi

If you're receiving internal server errors when accessing endpoints, please check if the Apache user has write-access for Meteostat Python's cache directory. You can grant missing rights using chmod:

sudo chmod -R 777 /var/www/

Also, after making changes to the Python code or pulling the latest state, you'll probably need to restart Apache for the changes to become effective:

/etc/init.d/apache2 restart

Data License

Meteorological data is provided under the terms of the Creative Commons Attribution-NonCommercial 4.0 International Public License (CC BY-NC 4.0). You may build upon the material for any purpose, even commercially. However, you are not allowed to redistribute Meteostat data "as-is" for commercial purposes.

Code License

The code of the Meteostat project is available under the MIT license.

meteostat-server's People

Contributors

clampr avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

togettechinov

meteostat-server's Issues

JSON API and METEOSTAT Web App are inconsistent in time

Hi! Thank you for the meteostat service, it's very helpful. I did notice a time inconsistency between the Web App and the data from the JSON API. Even if I use UTC in both cases, the data in the web app graphs are shifted -1 hour in comparison to the data requested from JSON API. Is it a visualisation problem? Or should the API data be adjusted? Thank you, Trang

400 Bad Request on Nerby Stations endpoint

I am new to meteostat API, signed up on RapidAPI and tried to use the API.

The Nerby Stations endpoint seems to have a problem, because it is always returning 400 Bad Request. Even with default parameters via Test Endpoint.

My API key seems to be fine, because the Daily Station Data endpoint is working as expected.

Tested URL: https://meteostat.p.rapidapi.com/stations/nearby?lat=51.5085&lon=-0.1257

Mention Forecast/Observation status in results

This should really belong to the API, but its code base isn't public so I'll open the issue here instead.

When querying hourly data, there seems to be a mix of forecast vs observation - however the switching point between the two doesn't seem to be clear to me.

It'd be great, if observation/forecast status was added to the response. Or alternatively, if it was possible to request observations only - that way you save on response size.

Due to API key being in header, all requests are pre-flighted, increasing latency

I was wondering why all my requests to the API were preceded by an OPTIONS request, before the actual GET request.

This seemed wasteful and I couldn't see what I'd done wrong.

I learned this is called preflighting and is necessary due to CORS restrictions.

If the API key was added to the URL, preflighting wouldn't be necessary saving time. Are you aware of this impact of implementing authentication like that?

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.