Metadata-Version: 2.4
Name: fixbikenet
Version: 0.5.0
Summary: Python package to detect gaps in developed bicycle networks
Author: Manuel Knepper, Anastassia Vybornova, Michael Szell
Maintainer-email: Manuel Knepper <manuel.knepper@gmx.net>
License-Expression: AGPL-3.0-or-later
Project-URL: Repository, https://github.com/BikeNetKit/FixBikeNet
Project-URL: Issues, https://github.com/BikeNetKit/FixBikeNet/issues
Keywords: Bicycle network planning,Networks,OpenStreetMap,Urban Planning,Urban Mobility
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Natural Language :: English
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: geopandas>=0.14
Requires-Dist: matplotlib
Requires-Dist: osmnx>=1.9.4
Requires-Dist: geojson
Requires-Dist: tqdm
Requires-Dist: pip
Requires-Dist: momepy
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: doc
Requires-Dist: sphinx; extra == "doc"
Requires-Dist: momepy; extra == "doc"
Dynamic: license-file

# FixBikeNet

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Docs](https://github.com/BikeNetKit/FixBikeNet/actions/workflows/docs.yml/badge.svg)](https://github.com/BikeNetKit/FixBikeNet/actions/workflows/docs.yml)
[![Test](https://github.com/BikeNetKit/FixBikeNet/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/BikeNetKit/FixBikeNet/actions/workflows/test.yml)

The Python package `fixbikenet` identifies the most important gaps to fill in a city's bicycle network. 

The software downloads and pre-processes data from OpenStreetMap, identifies the gaps, saves the results, creates plots and videos. The source code builds on [the code from the research paper](https://github.com/anastassiavybornova/bikenwgaps) _Automated Detection of Missing Links in Bicycle Networks_.


**Publication**: [https://doi.org/10.1111/gean.12324](https://doi.org/10.1111/gean.12324)


## Installation

### The easy way

> [!IMPORTANT]  
> As of 2026-05-06, the conda-forge installation is not yet working. We will remove this note once it works.

The best way to install FixBikeNet is using [`conda`](https://docs.conda.io/projects/conda/en/latest/index.html) and the `conda-forge` channel:

```
conda install -c conda-forge fixbikenet
```

### Advanced installations
#### Set up environment

The main step is to set up a virtual environment `fbnenv` in which to install the package, and then to use or run the environment.

##### With Pixi

Installation with [`Pixi`](https://pixi.prefix.dev/latest/) is fastest and most stable:

```
pixi init fbnenv
pixi add --pypi fixbikenet
```

At this point you can run fixbikenet in the environment, for example as such:

```
pixi run python examples/mwe.py
```

> [!NOTE]  
> The first time you run code with Pixi, it might take a minute longer, as Pixi resolves the environment's dependencies only at this point.

_Alternatively_, or if you run into issues, [clone this repository](https://github.com/BikeNetKit/fixbikenet/archive/refs/heads/main.zip) and create the environment via the [`environment.yml`](environment.yml) file:

```
pixi init --import environment.yml
```

##### With mamba/conda/pip

Alternatively to Pixi, use [`mamba`](https://mamba.readthedocs.io/en/latest/index.html) or [`conda`](https://docs.conda.io/projects/conda/en/latest/index.html).

<details><summary>Instructions</summary>

> [!IMPORTANT]  
> As of 2026-05-06, the conda-forge installation is not yet working. We will remove this note once it works.

```
mamba create -n fbnenv -c conda-forge fixbikenet
mamba activate fbnenv
```

_Alternatively_, or if you run into issues, [clone this repository](https://github.com/BikeNetKit/fixbikenet/archive/refs/heads/main.zip) and create the environment via the [`environment.yml`](environment.yml) file:

```
mamba env create --file environment.yml
mamba activate fbnenv
pip install fixbikenet
```

</details>

### Run fixbikenet in Jupyter lab

After having set up the environment above, if you wish to run fixbikenet via [JupyterLab](https://pypi.org/project/jupyterlab/), follow the

<details><summary>Instructions</summary>

#### With Pixi
Running fixbikenet in Jupter lab with [`Pixi`](https://pixi.prefix.dev/latest/) is straightforward:

```
pixi run jupyter lab
```

An instance of Jupyter lab is automatically going to open in your browser after the environment is built.

#### With mamba/conda

Using mamba/conda, run:

```
mamba activate fbnenv
ipython kernel install --user --name=fbnenv
mamba deactivate
jupyter lab
```

Once Jupyter lab opens, switch the kernel (Kernel > Change Kernel > fbnenv)

#### With pip

Using pip, run:

```
pip install --user ipykernel
python -m ipykernel install --user --name=fbnenv
jupyter lab
```

Once Jupyter lab opens, switch the kernel (Kernel > Change Kernel > fbnenv)

</details>

## Development installation

If you want to develop the project, [clone this repository](https://github.com/BikeNetKit/fixbikenet/archive/refs/heads/main.zip) and create the environment via the [`environment-dev.yml`](environment-dev.yml) file:

```
pixi init --import environment-dev.yml
```

The developemt environment is called `fbnenvdev`. Make sure to also read [our contribution guidelines](https://github.com/BikeNetKit/FixBikeNet?tab=contributing-ov-file).

## Usage

We provide a minimum working example in two formats:

- Python script ([examples/mwe.py](examples/mwe.py))
- Jupyter notebook ([examples/mwe.ipynb](examples/mwe.ipynb))

## Repository structure

```
├── fixbikenet             <- Packaged functions and visualizations
├── tests                   <- Tests to execute to ensure functionality
├── .gitignore              <- Files and folders ignored by git
├── .pre-commit-config.yaml <- Pre-commit hooks used
├── README.md
├── environment.yml         <- Environment file to set up the environment using conda/mamba/pixi
```

## Credits

<!--Please cite as:
>AUTHOR1, AUTHOR2, and AUTHOR3, PROJECTNAME, JOURNAL (YYYY), DOIURL
-->

Development of FixBikeNet was supported by the Danish Innovation Fund (Innovationsfonden).
