Skip to main content

moveq

Transport-equity analysis for Python.

PyPI Python versions License

moveq turns the numbers you already have — trips per area, population counts, deprivation ranks, coverage shares — into standard inequality measures and a documented composite accessibility score, plus a cross-country catalogue contract so a study cannot silently drop a section when it moves from one country to another.

It is a library stack, not a hosted product. You bring arrays or CSVs; moveq owns the math and the trail of what was computed. It does not decide policy.

This package is the one most people should install. It re-exports the public API of moveq-core and moveq-catalogue behind import moveq. The command-line tool is a separate install: moveq-cli.

What it computes

Inequality of service (who gets how much). Given a service value per area (weekly trips, departures, coverage) and a population weight:

  • Gini — overall inequality of that service across people. 0 is equal service for everyone (including the all-zero convention); values toward 1 mean service is concentrated on a small share of the population. Internally this is a population-weighted Lorenz curve, integrated with the trapezoid rule.
  • Palma ratio — the extremes: mean service of the best-served 10% of the population divided by mean service of the worst-served 40%. Areas that straddle those cuts are split proportionally. Equal service, including all-zero service, yields 1. If the bottom 40% have no service while the top 10% do not, the result is infinity.

Neither Gini nor Palma knows anything about income or deprivation. They only describe the distribution of the service variable.

Inequality along deprivation (who is favoured). The Wagstaff Concentration Index ranks areas by a socioeconomic variable (for example Index of Multiple Deprivation, where 1 is most deprived) and asks whether service rises or falls along that ranking. Tied ranks share a group-midpoint fractional rank so input order does not change the answer. For non-negative service the index lies in [-1, 1]:

  • positive — service is concentrated among less deprived areas (pro-rich)
  • negative — service is concentrated among more deprived areas (pro-poor)
  • zero — no systematic gradient with rank

A composite score that does not treat missing data as zero. Accessibility work almost always has holes: night frequency was not collected, weekend service is unknown for one cut. compute_score takes named terms in [0, 1] and design weights. Any term that is None is dropped and the remaining weights are renormalised. The result is a 0–100 score plus a component table (design_weight vs weight_used, which terms were dropped, and a human-readable note). If every term is missing, the score is None rather than a silent 0.

A same / replace / omit registry for multi-country work. When a questionnaire or indicator list is reused in a second country, some items map cleanly, some need a local substitute, and some cannot be measured at small-area resolution. Catalogue requires an explicit decision for every base section so an item cannot disappear without a record.

The methodology guide has the formulae.

Installation

Requires Python 3.10+.

pip install moveq

Pandas helpers for a vulnerability index and “multiply deprived” flags:

pip install "moveq[frames]"

CSV / JSON command line (installs this package as a dependency):

pip install moveq-cli

Quickstart

import numpy as np
from moveq import (
    compute_gini,
    compute_palma_ratio,
    compute_concentration_index,
    compute_score,
    Catalogue,
    SectionAction,
)

service = np.array([10.0, 20.0, 5.0, 50.0, 8.0])
population = np.array([1000, 800, 1200, 300, 900])
deprivation_rank = np.array([1, 3, 2, 5, 4])  # 1 = most deprived

gini = compute_gini(service, population)
palma = compute_palma_ratio(service, population)
ci = compute_concentration_index(service, deprivation_rank, population)

result = compute_score(
    terms={"coverage": 0.7, "evening": 0.5, "frequency": None, "gap": 0.9},
    weights={"coverage": 0.40, "evening": 0.25, "frequency": 0.20, "gap": 0.15},
)
# result.score is on 0–100; result.dropped lists terms that were None

Package layout

PyPI project Role
moveq (this package) Single import for the Python API
moveq-core NumPy algorithms; optional pandas extras
moveq-catalogue Harmonization registry
moveq-cli moveq command for CSV and JSON

All four are versioned together.

What this stack is not

  • Not a GIS toolkit, GTFS parser, or data pipeline — pass in arrays or CSVs.
  • Not a dashboard or SaaS product.
  • Not a legal or policy verdict. Rankings and cut-offs stay with the analyst.

Documentation

License

BSD 3-Clause.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moveq-0.1.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

moveq-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file moveq-0.1.2.tar.gz.

File metadata

  • Download URL: moveq-0.1.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for moveq-0.1.2.tar.gz
Algorithm Hash digest
SHA256 34ea9576b6c5c5b7d8448dd1d643633d484be7b2ec35f6428c6af8ac4e426368
MD5 5e66d45e361e092c8cfaa76f8d91a31a
BLAKE2b-256 749a4ca0ec9f7686d592dc0bfad74d05752c4cb764cd7ee70a9dbd4cd8aeb5e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for moveq-0.1.2.tar.gz:

Publisher: publish.yml on SVamseekar/moveq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moveq-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: moveq-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for moveq-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 381f88e2639053df43342e85edbbac637b0eddf796c7d55821f2569da218709e
MD5 ee4f8f71cda18aa8457cc8b403a193ab
BLAKE2b-256 b7080de1141f828c576b37c79b5e6a95c1c4791919da625cfbf34fa8440c76ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for moveq-0.1.2-py3-none-any.whl:

Publisher: publish.yml on SVamseekar/moveq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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