Skip to main content

A client for accessing the infra-risk-vis autopackage API

Project description

irv-autopkg-client

PyPI

A client library for accessing the irv-autopkg API, currently hosted at global.infrastructureresilience.org.

The irv-autopkg service allows users to extract portions of global datasets pertaining to climate risk and resilience. This Python package is a client for communicating with the irv-autopkg API.

Installation

Install from PyPI with:

pip install irv-autopkg-client

Usage

Create a client object to establish a session:

import irv_autopkg_client
client = irv_autopkg_client.Client()

For a list of available methods, try:

help(client)

Quick start

Is the API responding?

client.server_readiness()

Which boundaries can we create extracts for?

client.boundary_list()

Which datasets are available?

client.dataset_list()

Get information on a specific dataset:

client.dataset("wri_aqueduct.version_2")

Get the boundary of a territory:

boundary = client.boundary_geometry("bgd")

Download some extracted data:

client.extract_download(
    "bgd",
    "data",
    # there may be other datasets available, but only download the following
    dataset_filter=[
        "gri_osm.roads_and_rail_version_1",
        "wri_aqueduct.version_2"
    ],
    overwrite=True
)

Development

First clone this repository (currently hosted at nismod/irv-autopkg-client).

To install the package in editable mode, run:

pip install -e .
pip install vcrpy~=7.0

Alternatively, if you have poetry, run:

poetry install

Testing

To run the bundled tests, try:

python -m unittest

With poetry, either work within poetry shell, or run single commands in the virtual environment:

poetry run python -m unittest

Acknowledgments

This research received funding from the FCDO Climate Compatible Growth Programme. The views expressed here do not necessarily reflect the UK government's official policies.

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

irv_autopkg_client-0.4.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

irv_autopkg_client-0.4.0-py3-none-any.whl (55.3 kB view details)

Uploaded Python 3

File details

Details for the file irv_autopkg_client-0.4.0.tar.gz.

File metadata

  • Download URL: irv_autopkg_client-0.4.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.8.0-57-generic

File hashes

Hashes for irv_autopkg_client-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e223d0bc5b558bd2a0a8ac8e8c55687ec94adf05a1cb946add923b49d9ee0b9b
MD5 911ead74551492b14dbc36b621b8bb9d
BLAKE2b-256 c2a9534228e1f2b14301430ef0c4b150c2452d7166a7ea342c42c2fb941ef3fb

See more details on using hashes here.

File details

Details for the file irv_autopkg_client-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: irv_autopkg_client-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.3 Linux/6.8.0-57-generic

File hashes

Hashes for irv_autopkg_client-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aefa1a3d14902ecfc61a0e3153ce4fedac13707f24a6d2d6baa8fc65c0cc8a0d
MD5 b5f6c014ba7b3eb8940b1b4fec5a21d7
BLAKE2b-256 ca72e84828791b2e9f590d12e20f6945490957e81afa68c10d37878a7375a791

See more details on using hashes here.

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