General Instructions
Generating API token
This project uses openrouteservice API to plot maps and routes. So the following steps are necessary at first:
- Sign up on openrouteservice.org to generate an API token;
- Create a
.envfile with the following content:TOKEN=XXXXXXXXXXXXXXX, whereXXXXXXXXXXXXXXXis the token generated in the step before; - Install the lib:
pip install safety-road-mapping - Get the road accidents according the instructions bellow: Getting accident road data
- See the documentation on: safety documentation
- See the examples on how to use the lib on: how-to-use.ipynb
Getting accident road data
- The accidents data used were extracted from the Polícia Rodoviária Federal website.
- The notebook get_data.ipynb is responsible to download and extract the data used.
- If you want to directly download the files you can click here.
- To consolidate all the accidents by year on an unique
.csvfile use the notebook consolidate_data.ipynb. - For a simple explore data analysis from the data look at eda_accidents.ipynb
Adding São Paulo data
- Access the infosiga website
- Download the xlsx file with fatal accidents: Fatal accidents
- Download the csv file with non fatal accidents: Non-fatal accidents
- Use the notebook treat_data_from_SP.ipynb to transform and concatenate the data generating a final file that will be used as input for the safety map code.
Other possible steps on the project
- The accidents data used comes just from road federal police source, so there are some routes that don't receive score because they are state highways.
- Create some unit tests.
- Use Renaest data (currently only SP has geolocation data).
- Include other variables in the score calculation.
- Include driver behaviors data.
- Implement an algorithm to predict accidents.
- The routes subsections are not connected, once they are plotted individually in the map. Visually it can be interesting to connect them. (Is it possible or necessary?).
Metadata
Release files for safety-road-mapping 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| safety-road-mapping-0.1.7.tar.gz | 538.0 kB | Without provenance | Details for safety-road-mapping-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| safety_road_mapping-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for safety_road_mapping-0.1.7-py3-none-any.whl |
Total release size: 1.1 MB
Release files / safety-road-mapping-0.1.7.tar.gz
| Download URL | safety-road-mapping-0.1.7.tar.gz |
|---|---|
| Size | 538.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b577b87f6d01d6f2ea169257569b57865cfd3f0c158b357dc18b29fa9978a07
|
|
BLAKE2b-256 checksum How to use checksums |
4d5911cf4ea0c70519086a6d80b719dd6c8ac9137bdb03fa5b85a55fc2049df5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.8.7 Windows/10
|
Release files / safety_road_mapping-0.1.7-py3-none-any.whl
| Download URL | safety_road_mapping-0.1.7-py3-none-any.whl |
|---|---|
| Size | 551.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd6cb06109ef2cfc58bc22a2cac850554d023c12af5a49d3a4aa13cd52ad20bb
|
|
BLAKE2b-256 checksum How to use checksums |
c5413fcf59f428d5553c7e13dfa94ef72aca3a747d531379e5f6ca8d575febb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.8.7 Windows/10
|
Security for safety-road-mapping 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.