TransNet Generator is a Python library for generating transport network from GTFS data.
Project description
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.
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 transnet_generator-0.1.tar.gz.
File metadata
- Download URL: transnet_generator-0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e58925f7ca1e701beef05f117f3c049893ecf9832ddbfb50b0a260cbf22eaf2
|
|
| MD5 |
689c73aa4f6de2fcee944280f1de3470
|
|
| BLAKE2b-256 |
b45abaa1c04074c145a515fcba156d8700f01c587ad20caf33cb59154960ddd0
|
File details
Details for the file transnet_generator-0.1-py3-none-any.whl.
File metadata
- Download URL: transnet_generator-0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2523cbaf35e24c4d73bf471e6ce870510f4fce65b82254a1bbbe5b25ee03cfe9
|
|
| MD5 |
b139a8f8e50b50c3575d867b9863d28b
|
|
| BLAKE2b-256 |
a03d0c82de07203abcf726e9207c17e75c600e3a92b6799e1e22cdee26b50ec9
|