Skip to main content

No project description provided

Project description

GMNSpy

Python tool for General Modeling Network Specification (GMNS) developed by Zephyr Foundation for Travel Analysis.

Installation

git clone https://github.com/e-lo/GMNSpy.git
cd GMNSpy
pip install .

Usage

Read a single file

Returns a dataframe that conforms to the specified schema and have been validated.

df = gmnspy.in_out.read_gmns_csv(data_filename, schema_file=schemafilename)

Read a network

Returns a dictionary of dataframes that conform to the specified schema and have been validated.

Checks foreign keys between files.

net = gmnspy.in_out.read_gmns_network(data_directory, config: "gmns.spec.json")

GMNS specification

A copy of the GMNS specification is kept in the /spec sub-directory as a series of JSON tables.

Data Table schemas

Data table schemas are specified in JSON and are compatible with the frictionless data table schema standards.

Example:

{
    "primaryKey": "segment_id",
    "missingValues": ["NaN",""],
    "fields": [
        {
            "name": "segment_id",
            "type": "any",
            "description": "Primary key.",
            "constraints": {
              "required": true,
              "unique": true
              }
        },
        {
            "name": "road_link_id",
            "type": "any",
            "description": "Required. Foreign key to road_links. The link that the segment is located on.",
            "foreign_key": "link.link_id",
            "constraints": {
              "required": true
              }
        },
        {
            "name": "ref_node_id",
            "type": "any",
            "description": "Required. Foreign key to node.",
            "foreign_key": "node.node_id",
            "constraints": {
              "required": true
              }
        },
        {
            "name": "start_lr",
            "type": "number",
            "description": "Required. Distance from ref_node_id.",
            "constraints": {
              "required": true,
              "minimum": 0
              }
        },
        {
            "name": "end_lr",
            "type": "number",
            "description": "Required. Distance from ref_node_id.",
            "constraints": {
              "required": true,
              "minimum": 0
              }
          }
    ]
}

Network Data Config

Network data schemas are specified in JSON and are compatible with the frictionless data data package standards.

Example:

{
  "profile": "gmns-data-package",
  "profile_version":0.0,
  "name": "my-dataset",
  "resources": [
   {
     "name":"link",
     "path": "link.csv",
     "schema": "link.schema.json",
     "required": true
   },
   {
     "name":"node",
     "path": "node.csv",
     "schema": "node.schema.json",
     "required": true
   }
 ]
}

Issues

Please add issues, bugs, and feature requests to Github.

Roadmap

Current feature roadmap includes:

  • conversion tools from open street map
  • network connectivity checks
  • auto documentation of schema to markdown files
  • tests tests tests

Feel free to submit pull requests for consideration. See CONTRIBUTING for more detailed instructions.

Credits

Primary Author: Elizabeth Sall, UrbanLabs LLC

Contributing authors and code maintainers:

  • Pedro Carmago, OuterLoop Consulting
  • Ian Berg, Volpe Center

See all in CONTRIBUTORS.md

License to Use

The code herein is licensed under the Apache License 2.0 as defined in file.

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

gmnspy-0.3.5.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

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

gmnspy-0.3.5-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file gmnspy-0.3.5.tar.gz.

File metadata

  • Download URL: gmnspy-0.3.5.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gmnspy-0.3.5.tar.gz
Algorithm Hash digest
SHA256 525a9501ea4c07c8fc4a1ba26eb870837905194593e31768322b8bb18ee3006b
MD5 79e0816c6f9148e24806f64a57412465
BLAKE2b-256 3c46aac5c3cbf893fd6b3be9191aa2b938ccd43fa8d14c87870d2b73c4e0d0ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmnspy-0.3.5.tar.gz:

Publisher: publish.yml on e-lo/GMNSpy

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

File details

Details for the file gmnspy-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: gmnspy-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gmnspy-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cf8912f0c0db77c61b4a1a05258cf608b73618f128c9edee41477a44809f67b5
MD5 a942e62ebf5d07dfc055061dddec746a
BLAKE2b-256 d1a624a2fbd8c8e8ce487bab51d1b36488e92387201632dc4053c3c4c6fd9374

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmnspy-0.3.5-py3-none-any.whl:

Publisher: publish.yml on e-lo/GMNSpy

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

Supported by

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