A python package for downloading, extracting and clipping bicycle traffic count data from the STADTRADELN database
Project description
stadtradeln-data
A Python package to download bicycle traffic count data from the STADTRADELN database.
This package installs two things:
- The executable
stadtradeln-data-manager
: A command line interface (cli) for downloading, extracting and clipping STADTRADELN datasets. - The library
stadtradeln_data_tools
: Methods for importing STADTRADELN datasets topandas
Example: stadtradeln-data-manager
$ # Show available commands
$ stadtradeln-data-manager --help
$ # Download and extract 2020's "verkehrsmengen" dataset to /tmp/stadtradeln_data/.
$ # Instead of "verkehrsmengen" you can also choose "geschwindigkeiten".
$ # use `stadtradeln-data-manager download --help` for more options.
$ stadtradeln-data-manager download 2020 verkehrsmengen
$ stadtradeln-data-manager extract 2020 verkehrsmengen
$ # Clip them to the area of Freiburg im Breisgau.
$ # Stores the resulting file in the same directory as the source file.
$ # Here: /tmp/stadtradeln_data/verkehrsmengen_2020_clipped.csv
$ stadtradeln-data-manager clip 2020 verkehrsmengen -latmin 7.616 -latmax 8.112 -lonmin 47.87 -lonmax 48.11
Example: stadtradeln_data_tools
import stadtradeln_data_tools as sdt
# Assumes that you have previously downloaded and extracted a dataset
df = sdt.pandas_importer.load_csv("/tmp/stadtradeln_data/verkehrsmengen_2020_clipped.csv")
# Possibly further clip the data
df = sdt.dataset_clipper.clip_dataset(
df=df,
latitude_lim=(7.9, 8.1),
longitude_lim=(47.9, 48.1)
)
# Continue work with the pandas.DataFrame
print(df)
The repository
Installation
$ git clone git@github.com:Duam/python-stadtradeln-data.git
$ cd python-stadtradeln-data
$ virtualenv venv
$ source venv/bin/activate
$ pip install -e .
$ stadtradeln-data-manager --help
Folder structure
./
├ src/
│ ├ stadtradeln_data_tools/ # The API for processing the datasets
│ └ stadtradeln_data_manager/ # A command line interface for handling datasets manually
└ tests/ # Unit-tests
See also
- teelram-data: A friendly Python package to download traffic count data from Telraam.net. (not by me)
- MOVEBIS
Notes
- This is a third-party package not officially affiliated with the STADTRADELN project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stadtradeln-data-0.0.2rc6.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for stadtradeln-data-0.0.2rc6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b17a6564f2e6a4f99e9e02cf5b5f589a58f39c2ddbe736109b1bc7392fde16a |
|
MD5 | d722fc2152f5999a324d9f108ec20e6d |
|
BLAKE2b-256 | 1b9f588d5a598c1e84591ccee282a822723c45ac9b978830e4b3594ef3d9d79f |
Close
Hashes for stadtradeln_data-0.0.2rc6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ac52d4af96faf29d11c18a4af49864838f4672802f804f59f89e8d5db771294 |
|
MD5 | ffd96042b6748f1e4db34743391f2a63 |
|
BLAKE2b-256 | 3b109202a1ff46a2d33529fe5956a4e9b6de7e1df170fd0539834b683a207fb1 |