Skip to main content

No project description provided

Project description

metroscore

Metroscore is a Python package for analyzing transit quality in a region. It compares the accessibility of driving to the accessibility of public transit options (walking, biking, & public transit) for any given time, place, and trip length. The result is a collection of analyses for a region that can be analyzed to understand how spatial and temporal constraints affect transit performance.

Installation

From pip

Metroscore is available on the Python Package Index (PyPi). To install, run:

pip install metroscore

From source

git clone https://www.github.com/agupta01/metroscore
cd metroscore
pip install -r requirements.txt
pip install -e .

Getting Started

The following describes the most basic usage of Metroscore. For advanced usage, including configuration options, please see the docs.

Datasets

  1. GTFS: public transit agencies frequently publish their transit schedules in the General Transit Feed Specification (GTFS) format. This is a standard format for describing transit schedules and routes. metroscore uses the GTFS format to generate transit service areas.

Building a transit network dataset

The first step of running any Metroscore analysis is to build the transit and drive datasets. To do so:

from metroscore.metroscore import Metroscore
m = Metroscore(name="Brooklyn, NY")
m.build_drive()
m.build_transit(metro="./data/mta_metro_gtfs", bus="./data/mta_bus_gtfs")

Running an analysis

With a built object, you can now pass in points, times of day, and trip durations to run an analysis:

from metroscore.utils import start_time_to_seconds
start_times = list(map(start_time_to_seconds, ["7AM", "12PM", "4PM", "9PM"]))
results = m.compute(
    points=[(<lat>, <lon>), (<lat>, <lon>), ...],
    time_of_days=start_times,
    cutoffs=[600, 1200, 1800, 2400, 3000] # 10, 20, 30, 40, 50 minutes
)

Results may either be read directly as the return value of compute(), or by getting the _results object from the Metroscore object.

Reading results

m.get_score(location=(<lat>, <lon>), time_of_day=start_time_to_seconds("7AM"), cutoff=600)

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

metroscore-1.0.0rc1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

metroscore-1.0.0rc1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file metroscore-1.0.0rc1.tar.gz.

File metadata

  • Download URL: metroscore-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for metroscore-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 d32f391564c4a2e0f3384ceb0d9ea5365e0acc7dd733e0ebc0e44ad4f7689986
MD5 e67fa69e85425fbc16e687d859f75ff0
BLAKE2b-256 533aad815a83f91778ef9e0ea9a8a432ca96aef532e38dfdc9c0455abf2ce26b

See more details on using hashes here.

File details

Details for the file metroscore-1.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for metroscore-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 dddc7ff4fec6495353e5680a45022c5b9e346c9afe329ce0ca57b289c7236d6b
MD5 7df9637a610a608c87ece50072e2cec4
BLAKE2b-256 063129beb85ee8dbd2bd0d1d94441afcd2ed2a8363048464cb29eb4d79d62d5f

See more details on using hashes here.

Supported by

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