A client for accessing the infra-risk-vis autopackage API
Project description
irv-autopkg-client
A client library for accessing the irv-autopkg API.
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")
To submit an extract job:
job_id = client.job_submit(
country_iso,
[
"gri_osm.roads_and_rail_version_1",
"wri_aqueduct.version_2"
]
)
We can then check if the job is complete:
client.job_complete(job_id)
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
)
Testing
To run the bundled tests, try:
python -m unittest
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
Built Distribution
File details
Details for the file irv_autopkg_client-0.3.2.tar.gz
.
File metadata
- Download URL: irv_autopkg_client-0.3.2.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-56-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44e6172769bbee14f3155c100b5b0a9d7283fbe26c7764200b27710a7fa876df |
|
MD5 | dd27cc9edafb2f26a24a5d4b0ab538a5 |
|
BLAKE2b-256 | b14cd3e782f3e805b13290c6535717fad3526e9b152dd0e4d1df586d5fb120c3 |
File details
Details for the file irv_autopkg_client-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: irv_autopkg_client-0.3.2-py3-none-any.whl
- Upload date:
- Size: 54.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-56-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f2eb1ea2abc0309460774e7ef2efb9e3dd274fcc67b2e14a13761e98647d6ed |
|
MD5 | f23c690f1ebf795da05c0564474b1d39 |
|
BLAKE2b-256 | 96fe02ff92865c96f9a8885ea3ed11bef7c3ba8a5fb2695856f63a784fbd0598 |