Python toolkit for building and analyzing multimodal street and transit networks with a focus on accessibility and distributive equity
Project description
PyQuity
PyQuity is a compact Python toolkit for building and analyzing multimodal street and transit networks with a focus on accessibility and distributive equity. Quickly generate graphs and grids, attach POIs/GTFS, compute route-based accessibility, and evaluate equity (sufficientarianism, egalitarianism, utilitarianism) with seamless GeoPandas/NetworkX/OSMnx integration.
Installation
PyQuity can be installed via PyPI:
pip install pyquity
Usage
Graph Construction
import pyquity
# Street networks from OpenStreetMap
G_walk = pyquity.graph_from_place('Barrie, Canada', network_type='walk')
G_bike = pyquity.graph_from_place('Barrie, Canada', network_type='bike')
# Transit network from GTFS
G_gtfs = pyquity.graph_from_gtfs('gtfs.zip')
# Combine into multimodal graph
MG_walk = pyquity.multimodal_graph(G_walk, G_gtfs)
MG_bike = pyquity.multimodal_graph(G_bike, G_gtfs)
Grid Construction
# Create amenity GeoDataFrame
amenity = pyquity.amenity_from_place('Barrie, Canada', amenity_type='all')
# Create spatial grid (500 m resolution)
grid = pyquity.grid_from_place('Barrie, Canada', grid_size=5000)
# Attach amenities and micromobility stations to grid
grid = pyquity.amenity_in_grid(grid, amenity)
grid = pyquity.micromobility_in_grid(grid, micromobility_size=100)
# Optional: select multiple amenity types
amenity = pyquity.amenity_from_place('Barrie, Canada', amenity_type=['education', 'healthcare'])
Equity Analysis
# Create equity properties
equity = pyquity.Equity(MG_walk, MG_bike, grid, amenity)
# Sufficientarianism: proportion of grid cells reachable within served_time
grid = equity.sufficientarianism(served_time=15, weight='travel_time')
# Utilitarianism: average accessibility score across all cells
grid = equity.utilitarianism(served_time=15, weight='travel_time')
# Egalitarianism: Gini coefficient and Lorenz curve of accessibility distribution
gini, lorenz = equity.egalitarianism(grid)
Examples
See examples for a full walkthrough covering graph construction, grid setup, and equity analysis.
License
This project is licensed under the MIT License. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyquity-1.9.0.tar.gz.
File metadata
- Download URL: pyquity-1.9.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
388403be4445c1c7fb24f8fa48423ef02b23415f43e28e631d102016eed30f9b
|
|
| MD5 |
f5c629df374ae4d59646dbae5dfaf9d1
|
|
| BLAKE2b-256 |
faaee0153dd06fb56c1dd1a1ea1d8bb6e702edcdba9a8222dd517bf1dbcd8199
|
File details
Details for the file pyquity-1.9.0-py3-none-any.whl.
File metadata
- Download URL: pyquity-1.9.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98afdcba021cf43b1b86ed042a3d41ae70a3b8440e121d1805eaab61ebddcf4b
|
|
| MD5 |
e2ecf2852fc185d305755a6af1a847e9
|
|
| BLAKE2b-256 |
92fff4b741211449793e80ab3bc2d7fd1f13d9a68477b67696b5668e8ca08ec4
|