mirror of
https://github.com/sitn/mobility_updater.git
synced 2026-08-26 00:14:16 +00:00
Python script to retrieve data from https://sharedmobility.ch, swisstopo and to inject it into a PostgreSQL table | Read-only mirror of https://github.com/sitn/mobility_updater — Canton de Neuchâtel. Issues & pull requests at the source.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| logs | ||
| mobility | ||
| scripts | ||
| .gitignore | ||
| config.yml.sample | ||
| electric_mobility.py | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
| shared_mobility.py | ||
| timeout_checker.py | ||
| truncater.py | ||
Shared mobility updater
Requirements
Python 3.6+
Install
- Get the code and create the virtual environment:
git clone https://github.com/sitn/mobility_updater.git
cd mobility_updater
python -m venv venv
venv\Scripts\pip install -r requirements.txt
- Copy-paste the
config.yml.samplefile - Rename it to
config.yml - Use the
create_table.sql, adapt the table name and schema if necessary
That's it!
Run it
With cmd or powershell, cd to your shared_mobility_updater folder and:
- For the shared mobility part:
venv\Scripts\python shared_mobility.py
- For the electric stations part:
venv\Scripts\python electric_mobility.py
Purpose
The shared_mobility.py script gets data from the national shared mobility platform.
The explanation can be found here
The electric_mobility.py script gets data from the national data infrastructure For electromobility:
- Data access is described here
Disclaimer
This is a really "simple" script. There is no logging, no error handling, nothing like that. If you are willing to improve it, feel free, PRs are welcomed.