Giter VIP home page Giter VIP logo

velib's Introduction

Velib

Make use of a dataset from opendata.paris.fr (Vélib' - Disponibilité temps réel), that is updated every minute, and describes the status of every Vélib' station.

Get the data

get-records.sh pulls the data from the API.

No need to create an account, the quota for an anonymous access is limited to 5000 queries a day, which is enough for this use case. (5000 queries/day == 3 queries/minute)

What I did was putting get-records.sh in a crontab to be executed every minute and 20 seconds. In case the data wasn't available at this time, I put a second cron entry 30 seconds later. The script make sure that it doesn't pull the same data twice in a row.

Here's a trick to get around the minute-resolution of crontab (credits) :

* * * * * sleep 20 ; ~/velib/get-records.sh >> ~/velib/velib.log 2>&1
* * * * * sleep 50 ; ~/velib/get-records.sh >> ~/velib/velib.log 2>&1

Display in Grafana

datasource.py was created to serve datapoints by acting as a datasource for Grafana. Note: this has not been tested since 2019.

Generate reports

velib.py is a one-file-fits-all script that provides functions to generate static and animated charts based on the data available. This is in a draft state for now and could be greatly improved.

Python libraries

Uses Cartopy, which depends on geos and proj. On archlinux: sudo pacman -S geos proj and also Cython (pip)

Proj version error: see SciTools/cartopy#1289 (comment) Let's target cartopy@23e31dd to get the compatibility with proj >= 6 Cartopy requirements needs to be specified as: git+https://github.com/SciTools/cartopy.git@23e31dd#egg=Cartopy

velib's People

Contributors

vjean avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.