Skip to content

Latest commit

 

History

History
113 lines (82 loc) · 4.04 KB

README.md

File metadata and controls

113 lines (82 loc) · 4.04 KB

Station Data

Status License Last data release


This is the data fetcher for all BP gas stations.

📝 Table of Contents

🧐 About

This program is fetching all BP gas stations from the Aral "tankstellenfinder" api. The data is saved in the following formats: json and ov2.

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them.

python3 is required.

Installing

Install the required packages by running:

pip install -r requirements.txt

🎈 Usage

You can now run the data fetcher with python main.py

The data will be saved in ./out/json and ./out/ov2.

Program structure:

/
    /main.py # gets all stations and automatically sorts them in /out
    /generator.py # generates the following files in /out/other: sitemap.xml, facilities.json and fuel.json
    /database.py # generates a sqlite3 file based on "stations_ARAL Tankstelle_min.json" which is used in "aral-prices"

Directory structure:

out/
    /json
        /all
            /stations.json # these are all BP Stations worldwide
        /brands
            /stations_BP.json # all stations with the Brand BP
            /stations_ARAL Tankstelle.json # all stations from the Brand Aral
        /countries
            /stations_DE.json # all German stations from all brands
            /stations_US.json # all stations in the US from all Brands
        /other # used in another project
    /ov2 # 
        /all
            /stations.ov2 # these are all BP Stations worldwide
        /brands
            /stations_BP.ov2 # all stations with the Brand BP
            /stations_ARAL Tankstelle.ov2 # all stations from the Brand Aral
        /countries
            /stations_DE.ov2 # all German stations from all brands
            /stations_US.ov2 # all stations in the US from all Brands

There is always a _min.json available (e.g. stations_min.json) that has the whole JSON on a single line.
Use the default file for better readability.

The .ov2 files have skipper records, so performance should be good.

You can find the data here.

There is also a README.md in the data that has basic stats.

Data accuracy

The data may not be accurate as the script calls the gas station locator API and this can be prone to errors.

Please note that there may be stations missing!

🚀 Deployment

You can see a example deployment at ./.github/workflows/generate.yml

Cron

The data is updated by this GitHub action.
The version is automatically bumped by this GitHub action on cron '0 2 * * 1'.

Style

The code is formatted and checked with ruffs default settings.

⛏️ Built Using

None

Affiliation

I am not affiliated with the Aral Aktiengesellschaft nor the BP p.l.c.