mobility-and-transport
БесплатноБез исполняемых скриптовНе проверенBuild spatial OD mobility graphs and local GTFS/GBFS transportation graphs with explicit schemas, service windows, time semantics, and DuckDB spatial…
от lza6★ 19 звёзд на GitHubОб этом скилле
Mobility and transport
Use this skill when the task is to turn an existing origin-destination (OD)
data set, a local GTFS schedule archive, or a local GBFS JSON directory into
city2graph graph data. The package is GeoDataFrame-first: prefer returning
(nodes_gdf, edges_gdf) and convert that pair with city2graph.utils.gdf_to_nx
only when a NetworkX consumer explicitly requires it.
This skill covers:
city2graph.mobility.od_matrix_to_graphfor OD edge lists and adjacency matrices/arrays;city2graph.transportation.load_gtfsandload_gbfsfor local feed ingestion;get_od_pairsfor dated, stop-to-stop GTFS legs; andtravel_summary_graphfor an aggregated stop-level service graph.
It does not download feeds, query a live transit API, geocode locations, or
construct a road-routing network. All workflows can be exercised with local
files or an in-memory DuckDB connection. A local/cached DuckDB spatial
extension is still required for geometry-producing transit workflows; a first
attempt to INSTALL spatial can itself require package access, so do not claim
an offline environment is ready until that extension is available.
Choose the workflow
| Starting data | Entry point | Result |
|---|---|---|
| Edge-list OD flows plus zone geometries | od_matrix_to_graph(..., matrix_type="edgelist") |
Spatial zone nodes and weighted OD edges |
| Labeled adjacency DataFrame | od_matrix_to_graph(..., matrix_type="adjacency") |
Spatial zone nodes and non-zero adjacency edges |
| NumPy adjacency array | Same, with matrix_type="adjacency" |
Array rows/columns mapped to zone order |
Local .zip GTFS schedule |
load_gtfs(path) |
In-memory DuckDB tables |
| GTFS connection and individual legs needed | get_od_pairs(con, ...) |
One row per consecutive stop leg/date |
| GTFS connection and an aggregate network needed | travel_summary_graph(con, ...) |
Stop nodes and service-weighted summary edges |
| Local GBFS JSON directory | load_gbfs(path) |
In-memory DuckDB tables; no transit summary is inferred |
Do not treat GBFS station/bike/vehicle tables as GTFS stops, trips, or
stop_times; load_gbfs is an ingestion primitive, not a graph builder.
Public API and defaults
The installed package exposes these functions both from their modules and via the package-level re-export:
from city2graph.mobility import od_matrix_to_graph
from city2graph.transportation import (
get_od_pairs,
load_gbfs,
load_gtfs,
travel_summary_graph,
)
Important defaults:
od_matrix_to_graph:matrix_type="edgelist",source_col="source",target_col="target",directed=True,include_self_loops=False,compute_edge_geometry=True, and GeoDataFrame output.get_od_pairs:include_geometry=True,directed=False.travel_summary_graph: no time/date bounds,directed=False,use_frequencies=True, and GeoDataFrame output.load_gtfsaccepts a local path to a ZIP archive;load_gbfsaccepts a local directory and recursively reads*.jsonfiles.
The exact signatures are kept in the bundled workflow references. If a caller
passes as_nx, emit/expect the package deprecation warning: as_nx is a
legacy compatibility path and is not the recommended interface.
Fast operating procedure
- Classify the source. Decide whether the input is an OD table/matrix, GTFS ZIP, or GBFS directory. Do not silently reinterpret a GBFS feed as GTFS.
- Check prerequisites before calling. Confirm identifiers, geometry/CRS,
feed tables, service dates, stop times, and the DuckDB spatial extension as
applicable. See
references/troubleshooting.md. - Use the GeoDataFrame output first. Inspect row counts, indices, columns, CRS, edge direction, and empty-edge behavior before converting to another graph representation.
- Make filtering explicit. Record threshold and self-loop policy for OD;
record date/time windows and
use_frequenciesfor transit. - Validate invariants. For OD, confirm every retained endpoint belongs to the zone set. For transit, confirm positive travel times/frequencies and that the requested calendar/time window actually selects service.
- Keep provenance with the result. Record local input paths, feed table names, zone/stop ID columns, CRS, parameters, and warnings. No live-network provenance is expected because this skill never fetches data.
Bundled references
Minimal acceptance checklist
Before handing a graph to a downstream analysis:
- The input type and identifier mapping are documented.
- OD zones have unique, non-null IDs; adjacency labels or array ordering have been checked against those zones.
- The returned edge index is understood (
source,targetfor
Установить mobility-and-transport в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mobility-and-transport?
Build spatial OD mobility graphs and local GTFS/GBFS transportation graphs with explicit schemas, service windows, time semantics, and DuckDB spatial prerequisites.
Как установить скилл mobility-and-transport?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mobility-and-transport запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic