Installation

The traffic library makes an intensive use of pandas DataFrames and of the shapely GIS library.

The library relies on requests for calls to REST APIs. paramiko implements the SSH protocol in Pure Python, giving access to SSH connection independently of the operating system.

Static visualisation tools are accessible with Matplotlib through the cartes library, which leverages access to more projections and to data from OpenStreetMap. More dynamic visualisations in Jupyter Lab are accessible thanks to the altair and ipyleaflet libraries; other exports to various formats (including CesiumJS or Google Earth) are also available.

Latest release

We recommend creating a fresh conda environment for a first installation:

# Recommended options if not set up yet
conda config --set channel_priority strict
conda config --add channels conda-forge

# Installation
conda create -n traffic -c conda-forge python=3.9 traffic
conda activate traffic

Adjust the Python version (>=3.7) and append packages you may need for future works (e.g. bpython, jupyterlab, etc.)

Then activate the environment each time you need to use the traffic library:

conda activate traffic

Warning

Please only report installation issues in fresh conda environments.

Hint

Consider using mamba for a faster Conda experience.

Updating traffic

# -n option is followed by the name of the environment
conda update -n traffic -c conda-forge traffic

Development version

You may also install or update traffic in an existing environment with pip:

pip install --upgrade traffic

For the most recent development version, clone the Github repository:

git clone https://github.com/xoolive/traffic
cd traffic/
pip install .[dev]

If you intend to file a pull request, please activate pre-commit hooks:

pre-commit install