Giter VIP home page Giter VIP logo

prix-carburants's People

Contributors

doreapp avatar

Stargazers

 avatar  avatar

prix-carburants's Issues

Create github-pages sources

Create source code for a github-pages website using Jekyll.

It must include:

  • A very basic webpage
  • Documentation about how to install, build and display the website (on linux only)

Fix data parse and transform

Add missing information in current parsing:

  • opening and closing hours
  • several prices with the same fuel, but at different times (for data on several days)
  • out of order of some fuels
  • closing days
  • services

Stop saving data in data branch

To show data on github pages we do not need to have all the data from every day save in a dedicated branch.
We only need to have relevant data in gh-pages/assets/data folder.

Therefore, remove actions that fetches frequently data and save it in data branch & remove the branch

Handle possible out-the-scope department codes

For now, we consider that department codes are "01" to "95". We can imagine adding a 96th department, starting at 0, removing a code or adding a non-numeric code, such as 2A for Corsica.

The list of departments to use should be dynamically found from the data

Automatically and frequently save fuel prices data in the dedicated branch

Once #10 is done, create an action to automatically and frequently (e.g. every 3 hours) fetch new data from Open Data and save it in the data branch.

Save the data as latest.

This new data should come from instantaneous data source, and contains only meaningful values, i.e.:

  • id
  • address (city, address, postcode)
  • fuels
    • id
    • price if available
    • reason of unavailability (out of order, no service)
  • pairs fuel_id / fuel_name

Fix continous integration by handling 403 request error

Some of the continuous integration workflow are failing.

403

Given those jobs, the error is coming from a 403 HTTP error:

403 Client Error: rate limit exceeded for url: https://api.github.com/repos/Doreapp/prix-carburants/contents/assets/data/metrics.json?ref=gh-pages

502

Some other jobs (i.e. https://github.com/Doreapp/prix-carburants/actions/runs/4942342860/jobs/8835770321) are failing due to

502 Server Error: Bad Gateway for url: https://api.github.com/repos/Doreapp/prix-carburants/contents/assets/data/latest.json

https://github.com/Doreapp/prix-carburants/actions/runs/4942342860/jobs/8835770321

The request should retry when failing on CI, multiple time with a time delta between each.

Be able to save fetched data into a file

From fetched and parsed zip file, create a file in a web format (such as json or yaml).

Should be able to use it like:

$ python -m prixcarburants download day
Downloaded in .tmp/PrixCarburants_jour.xml
$ python -m prixcarburants transform .tmp/PrixCarburants_jour.xml
Data saved in .tmp/PrixCarburants_jour.json

Depends on #7.

Display prices by departments

  • Using python script, extract average prices per department (2 first digits of the postcode) an fuel type into metrics
  • On website, display a Map view with prices, using a library such as plotly.js (see this example)

Extract and display new data frequently

From latest data saved every hour, extracts metrics and display them in github-pages website.

Metrics are:

  • average prices by type (gazole, GLPc, E10...)

This metrics must be saved in /_data/ directory in gh-pages branch, and be used to display the data using jekyll templating

Change the form of metrics

Rather than having a dictionary like prices[department][fuel_type], have prices[fuel_type][department].

Needed as we more often split by fuel_type rather than by department.

Moreover, rather than using numbers as key, transform the prices and fuel_names objects in arrays:

{
  "prices" : [
    {
      "44": 2.2
      ..
    }, {
      "44": 1.1
      ..
    }
  ],
  "fuel_names": [...]
}

Fetch fuel prices of the day

Add https://donnees.roulez-eco.fr/opendata/jour URL as the source for daily data.

Goal:

  • Be able to fetch data related to the current day

Improve JS libraries download

To download JS libraries (leaflet for now), we are currently using a makefile target that uses curl commands.. Improve this process.

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.