Skip to main content

TransNet Generator

TransNet Generator is a Python library for generating transport networks from GTFS data. The library provides a convenient and efficient way to generate transport network graphs from one or multiple GTFS directories to a graph in Pajek or GML format, which can be used for network analysis and visualization.

Installation

To install TransNet Generator, you can use pip:

pip install transnet-generator

Usage

To use TransNet Generator, you can import the transnet_generator module and use the generate_graph function:

from transnet_generator import generate_graph

input_GTFS = ["path/to/gtfs/directory1", "path/to/gtfs/directory2"]
output_path = "path/to/output/graph"

generate_graph(input_GTFS, output_path)

The generate_graph function takes two required arguments:

input_GTFS - A list containing the paths to the directories containing the GTFS files.
output_path - The path to the output graph file.

Supported Output Formats

TransNet Generator supports the following output formats:

Pajek (.net)
GML (.gml)

To specify the output format, simply pass the desired format as a string to the output_format parameter of the generate_graph function.

Examples

Here's an example of how to generate a graph file in Pajek format from one GTFS directory:

from transnet_generator import generate_graph

input_GTFS = ["path/to/gtfs/directory"]
output_path = "path/to/output/graph.net"

generate_graph(input_GTFS, output_path, format="pajek")

Here's an example of how to generate a graph file in GML format from three GTFS directories:

from transnet_generator import generate_graph

input_GTFS = ["path/to/gtfs/directory1", "path/to/gtfs/directory2", "path/to/gtfs/directory3"]
output_path = "path/to/output/graph.gml"

generate_graph(input_GTFS, output_path, format="gml")

License

TransNet Generator is released under the MIT License. See the LICENCE file for details.

Metadata

Release files for transnet-generator 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transnet-generator 0.1
File Size Uploaded
transnet_generator-0.1.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transnet-generator 0.1
File Interpreter ABI Platform
transnet_generator-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / transnet_generator-0.1.tar.gz

Download URL transnet_generator-0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4e58925f7ca1e701beef05f117f3c049893ecf9832ddbfb50b0a260cbf22eaf2
BLAKE2b-256 checksum
How to use checksums
b45abaa1c04074c145a515fcba156d8700f01c587ad20caf33cb59154960ddd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.3

Release files / transnet_generator-0.1-py3-none-any.whl

Download URL transnet_generator-0.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2523cbaf35e24c4d73bf471e6ce870510f4fce65b82254a1bbbe5b25ee03cfe9
BLAKE2b-256 checksum
How to use checksums
a03d0c82de07203abcf726e9207c17e75c600e3a92b6799e1e22cdee26b50ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page