{"id":13929904,"url":"https://github.com/nismod/snail","last_synced_at":"2026-02-02T19:25:57.321Z","repository":{"id":46424557,"uuid":"292800384","full_name":"nismod/snail","owner":"nismod","description":"spatial networks impact assessment library 🐌","archived":false,"fork":false,"pushed_at":"2025-10-29T18:54:44.000Z","size":5467,"stargazers_count":10,"open_issues_count":18,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-22T17:56:19.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nismod.github.io/snail/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nismod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2020-09-04T08:58:20.000Z","updated_at":"2025-10-15T16:05:49.000Z","dependencies_parsed_at":"2023-11-27T16:52:24.514Z","dependency_job_id":"5f3d891f-d13f-4d5d-9f25-319ea3681f8d","html_url":"https://github.com/nismod/snail","commit_stats":{"total_commits":280,"total_committers":6,"mean_commits":"46.666666666666664","dds":"0.42500000000000004","last_synced_commit":"2ada0cf952e4357aa1512bd226efbe923dd269f2"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/nismod/snail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nismod%2Fsnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nismod%2Fsnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nismod%2Fsnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nismod%2Fsnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nismod","download_url":"https://codeload.github.com/nismod/snail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nismod%2Fsnail/sbom","scorecard":{"id":689074,"data":{"date":"2025-08-11","repo":{"name":"github.com/nismod/snail","commit":"352e11efd72ecc29fee70b1d44c5250f3fc5960a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/docs.yml:9","Warn: no topLevel permission defined: .github/workflows/package.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 2/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/package.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/package.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/nismod/snail/package.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:67","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:68","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:72","Warn: pipCommand not pinned by hash: .github/workflows/docs.yml:37","Warn: pipCommand not pinned by hash: .github/workflows/docs.yml:38","Info:   0 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/package.yml:50"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T01:50:41.658Z","repository_id":46424557,"created_at":"2025-08-22T01:50:41.658Z","updated_at":"2025-08-22T01:50:41.658Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28977316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T18:02:36.898Z","updated_at":"2026-02-02T19:25:57.314Z","avatar_url":"https://github.com/nismod.png","language":"Jupyter Notebook","readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/nismod/snail/tree/main/tutorials\"\u003eTutorials\u003c/a\u003e |\n\u003ca href=\"https://github.com/nismod/snail/issues\"\u003eIssues\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./images/snail.svg\" alt=\"snail\" /\u003e\n\u003c/p\u003e\n\n[![PyPI version](https://img.shields.io/pypi/v/nismod-snail.svg)](https://pypi.org/project/nismod-snail/)\n[![Build](https://github.com/nismod/snail/actions/workflows/build.yml/badge.svg)](https://github.com/nismod/snail/actions/workflows/build.yml)\n[![License](https://img.shields.io/pypi/l/nismod-snail.svg)](https://opensource.org/licenses/MIT)\n\n# 🤔 What is this?\n\nThis is a Python package to help with analysis of the potential impacts of\nclimate hazards and other perils on infrastructure networks.\n\n## Installation\n\nInstall using pip:\n\n    pip install nismod-snail\n\nThis should bring all dependencies with it. If any of these cause difficulties,\ntry using a [conda](https://docs.conda.io/en/latest/miniconda.html) environment:\n\n    conda env create -n snail_env \\\n        python=3.11 geopandas shapely rasterio python-igraph\n    conda activate snail_env\n    pip install nismod-snail\n\nIf all worked okay, you should be able to run python and import snail:\n\n    $ python\n    \u003e\u003e\u003e import snail\n    \u003e\u003e\u003e help(snail)\n    Help on package snail:\n\n    NAME\n        snail - snail - the spatial networks impact assessment library\n\n## Using the `snail` command\n\nOnce installed, you can use `snail` directly from the command line.\n\nSplit features on a grid defined by its transform, width and height:\n\n```bash\nsnail split \\\n    --features input.shp \\\n    --transform 1 0 -180 0 -1 90 \\\n    --width 360 \\\n    --height 180 \\\n    --output split.gpkg\n```\n\nSplit features on a grid defined by a GeoTIFF, optionally adding the values from each raster band to each split feature as a new attribute:\n\n```bash\nsnail split \\\n    --features lines.geojson \\\n    --raster gridded_data.tif \\\n    --attribute \\\n    --output split_lines_with_raster_values.geojson\n```\n\nSplit multiple vector feature files along the grids defined by multiple raster files, attributing all raster values:\n\n```bash\nsnail process -fs features.csv -rs rasters.csv\n```\n\nWhere at a minimum, each CSV has a column `path` with the path to each file.\n\n### Transform\n\nA note on `transform` - these six numbers define the transform from `i,j` cell index (column/row) coordinates in the rectangular grid to `x,y` geographic coordinates, in the coordinate reference system of the input and output files. They effectively form the first two rows of a 3x3 matrix:\n\n```\n| x |   | a  b  c | | i |\n| y | = | d  e  f | | j |\n| 1 |   | 0  0  1 | | 1 |\n```\n\nIn cases without shear or rotation, `a` and `e` define scaling or grid cell size, while `c` and `f` define the offset or grid upper-left corner:\n\n```\n| x_scale 0       x_offset |\n| 0       y_scale y_offset |\n| 0       0       1        |\n```\n\nSee [`rasterio/affine`](https://github.com/rasterio/affine#usage) and [GDAL Raster Data Model](https://gdal.org/user/raster_data_model.html#affine-geotransform) for more documentation.\n\n## Development\n\nClone this repository using [GitHub Desktop](https://desktop.github.com/) or on\nthe command line:\n\n    git clone git@github.com:nismod/snail.git\n\nChange directory into the root of the project:\n\n    cd snail\n\nTo create and activate a conda environment with snail's dependencies installed:\n\n    conda env create -f environment.yml\n    conda activate snail-dev\n\nRun this to install the source code as a package:\n\n    pip install .\n\nIf you're working on snail itself, install it as \"editable\" along with test and\ndevelopment packages:\n\n    pip install -e .[dev]\n\nRun tests using [pytest](https://docs.pytest.org/en/latest/) and\n[pytest-cov](https://pytest-cov.readthedocs.io) to check coverage:\n\n    pytest --cov=snail --cov-report=term-missing\n\nRun a formatter ([black](https://github.com/psf/black)) to fix code\nformatting:\n\n    black src/snail\n\nBuild the docs:\n\n    rm -r docs/build\n    rm -r docs/source/tutorials\n    cp -r tutorials docs/source/\n    pushd docs\n    sphinx-apidoc -M -o source/api ../src/snail/ --force\n    make html\n    popd\n\nServe the HTML docs locally:\n\n    cd docs/build/html\n    python -m http.server\n\n### C++ library\n\nThe C++ library in `extension/src` contains the core routines to find intersections of\nlines with raster grids.\n\nBefore working on the C++ library, fetch source code for Catch2 unit testing\nlibrary (this is included as a git submodule):\n\n    git submodule update --init --recursive\n\nBuild the library and run tests:\n\n    cmake -Bbuild ./extension\n    cmake --build build/\n    ./build/run_tests\n\nRun code style auto-formatting:\n\n    clang-format -i extension/src/*.{cpp,hpp}\n\nRun lints and checks:\n\n    clang-tidy --checks 'cppcoreguidelines-*' extension/src/*.{cpp,hpp}\n\nThis may need some includes for `pybind11` - which will vary depending on your\npython installation. For example, with python via miniconda:\n\n    clang-tidy --checks 'cppcoreguidelines-*' extension/src/* -- \\\n        -I/home/username/miniconda3/include/python3.11/ \\\n        -I./pybind11/include/\n\nOr with C++ headers installed on a Linux machine:\n\n    clang-tidy --checks 'cppcoreguidelines-*' extension/src/* -- \\\n        -std=c++14  \\\n        -I/usr/include/x86_64-linux-gnu/c++/11 \\\n        -I/usr/include/c++/11 \\\n        -I{$PWD}/extension/extern/pybind11/include \\\n        -I/usr/include/python3.10\n\n### Integration of C++ and Python using pybind11\n\nThe `snail.core.intersections` module is built using `pybind11` with\n`scikit-build-core` (see [docs](https://scikit-build-core.readthedocs.io/en/latest/))\n\n- `extension/src/intersections.cpp` defines the module interface using the\n  `PYBIND11_MODULE` macro\n- `pyproject.toml` defines the build requirements for snail, which includes\n  pybind11 and scikit-build-core\n\n## Acknowledgments\n\n\u003e MIT License\n\u003e\n\u003e Copyright (c) 2020-23 Tom Russell and all [snail contributors](https://github.com/nismod/snail/graphs/contributors)\n\nThis library is developed by researchers in the [Oxford Programme for Sustainable\nInfrastructure Systems](https://opsis.eci.ox.ac.uk/) at the University of Oxford,\nfunded by multiple research projects.\n\nThis research received funding from the FCDO Climate Compatible Growth Programme.\nThe views expressed here do not necessarily reflect the UK government's official\npolicies.\n","funding_links":[],"categories":["others","Climate Change"],"sub_categories":["Natural Hazard and Storms"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnismod%2Fsnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnismod%2Fsnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnismod%2Fsnail/lists"}