Skip to main content

A python package for downloading, extracting and clipping bicycle traffic count data from the STADTRADELN database

Project description

stadtradeln-data

pytest

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 to pandas

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


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.2rc1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stadtradeln_data-0.0.2rc1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file stadtradeln-data-0.0.2rc1.tar.gz.

File metadata

  • Download URL: stadtradeln-data-0.0.2rc1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for stadtradeln-data-0.0.2rc1.tar.gz
Algorithm Hash digest
SHA256 dfd200cab8999d2929c4770f602f17531f8f54e3f9b196be3c76b507e6652dd0
MD5 b6a3a717c78db1ca1d8de944dc3d447c
BLAKE2b-256 6f0b8cc216603f3a1ced133a5e3e755622afbfca2540e99da8b989461fda3998

See more details on using hashes here.

File details

Details for the file stadtradeln_data-0.0.2rc1-py3-none-any.whl.

File metadata

  • Download URL: stadtradeln_data-0.0.2rc1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for stadtradeln_data-0.0.2rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb7f45fd7d720a7e23b96af2a4e88c2c09d62ae895f7dcd4b9a7c28af02141f8
MD5 0f5e82921dd3b943ea4d087286a68570
BLAKE2b-256 528aaa02f8f2ae697aaf89be2a82e5f744e175da2c91c1881a7c6fd128f2e268

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page