Skip to main content

GOSTnets: Build, process, and analyze networks

GOSTNets is a Python library from the World Bank's GOST team that streamlines geospatial network analysis, especially with OpenStreetMap data. It provides a convenience layer on top of networkx and integrates with geopandas, osmnx, and rtree to build, clean, and analyze spatial graphs, and to convert networkx graphs to GeoDataFrames for mapping and analysis. Typical uses include travel-time and accessibility studies (e.g., health facility access), urban and transport network analysis, and infrastructure planning workflows

Installation

From PyPI

The first line includes conda install of several libraries; this is to support Windows users for whom gdal and geopandas do not install cleanly through pip.

conda create --name gostnets geopandas osmnx -c conda-forge
conda activate gostnets
pip install GOSTnets

Additionally, there are two extensions you may want to include.

pip install GOSTnets[tutorials]
pip install GOSTnets[dev]

From Source

  1. Clone or download this repository to your local machine. Then, navigate to the root directory of the repository:

    git clone https://github.com/worldbank/GOSTnets.git
    cd GOSTnets
    
  2. Create a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  3. Install the package in editable mode with dependencies:

    pip install -e .
    

    The -e flag stands for "editable," meaning changes to the source code will immediately affect the installed package.

Usage

Every function contains a docstring which can be brought up in use to check the inputs for various functions. For example:

import GOSTnets as gn
gn.edge_gdf_from_graph?

returns:

Signature: gn.edge_gdf_from_graph(G, crs={'init': 'epsg:4326'}, attr_list=None, geometry_tag='geometry', xCol='x', yCol='y')
#### Function for generating a GeoDataFrame from a networkx Graph object ###
 REQUIRED: a graph object G
 OPTIONAL: crs - projection of format {'init' :'epsg:4326'}. Defaults to
           WGS84. Note: here we are defining the crs of the input geometry -
           we do NOT reproject to this crs. To reproject, consider using
           geopandas' to_crs method on the returned gdf.
           attr_list: list of the keys which you want to be moved over to
           the GeoDataFrame.
           geometry_tag - the key in the data dictionary for each edge which
           contains the geometry info.
           xCol - if no geometry is present in the edge data dictionary, the
           function will try to construct a straight line between the start
           and end nodes, if geometry information is present in their data
           dictionaries.  Pass the Longitude info as 'xCol'.
           yCol - likewise, determining the Latitude tag for the node's data
           dictionary allows us to make a straight line geometry where an
           actual geometry is missing.
 RETURNS: a GeoDataFrame object of the edges in the graph
#-------------------------------------------------------------------------#

License

This licensed under the MIT License. This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for GOSTnets 1.2.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 GOSTnets 1.2.1
File Size Uploaded
gostnets-1.2.1.tar.gz 57.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for GOSTnets 1.2.1
File Interpreter ABI Platform
gostnets-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 57.6 MB

Release files / gostnets-1.2.1.tar.gz

Download URL gostnets-1.2.1.tar.gz
Size 57.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f7d6c77e4a3e87b55ad93d75041d19ca6606d6832ca32b5c9e0e007d0ce9315d
BLAKE2b-256 checksum
How to use checksums
83a714ef56e536a42a1038d8c7a9c8ff4ab2016e9a90f63c3acbb0c1eed381fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Release files / gostnets-1.2.1-py3-none-any.whl

Download URL gostnets-1.2.1-py3-none-any.whl
Size 68.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba78460eef76bc7587e8663f081b3aa99311145adf2a17734e7131b2b74957e7
BLAKE2b-256 checksum
How to use checksums
a763305c40b18a598155a765eff14d4abdd2d8cb58319dae3ae3a2bf2562c88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

5 release files

0.1

4 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