# 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
```
Raw data
{
"_id": null,
"home_page": "",
"name": "irv-autopkg-client",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "climate,infrastructure,hazard,risk,data,extract",
"author": "Fred Thomas",
"author_email": "fred.thomas@eci.ox.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/b1/4c/d3e782f3e805b13290c6535717fad3526e9b152dd0e4d1df586d5fb120c3/irv_autopkg_client-0.3.2.tar.gz",
"platform": null,
"description": "# irv-autopkg-client\nA client library for accessing the irv-autopkg API.\n\nThe 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.\n\n## Installation\n\nInstall from PyPI with:\n```\npip install irv-autopkg-client\n```\n\n## Usage\n\nCreate a client object to establish a session\n```\nimport irv_autopkg_client\nclient = irv_autopkg_client.Client()\n```\n\nFor a list of available methods, try:\n\n```\nhelp(client)\n```\n\n## Quick start\n\nIs the API responding?\n```\nclient.server_readiness()\n```\n\nWhich boundaries can we create extracts for?\n```\nclient.boundary_list()\n```\n\nWhich datasets are available?\n```\nclient.dataset_list()\n```\n\nGet information on a specific dataset:\n```\nclient.dataset(\"wri_aqueduct.version_2\")\n```\n\nTo submit an extract job:\n```\njob_id = client.job_submit(\n country_iso,\n [\n \"gri_osm.roads_and_rail_version_1\",\n \"wri_aqueduct.version_2\"\n ]\n)\n```\n\nWe can then check if the job is complete:\n```\nclient.job_complete(job_id)\n```\n\nGet the boundary of a territory:\n```\nboundary = client.boundary_geometry(\"bgd\")\n```\n\nDownload some extracted data:\n```\nclient.extract_download(\n \"bgd\",\n \"data\",\n # there may be other datasets available, but only download the following\n dataset_filter=[\n \"gri_osm.roads_and_rail_version_1\",\n \"wri_aqueduct.version_2\"\n ],\n overwrite=True\n)\n```\n\n## Testing\n\nTo run the bundled tests, try:\n```\npython -m unittest\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A client for accessing the infra-risk-vis autopackage API",
"version": "0.3.2",
"split_keywords": [
"climate",
"infrastructure",
"hazard",
"risk",
"data",
"extract"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "96fe02ff92865c96f9a8885ea3ed11bef7c3ba8a5fb2695856f63a784fbd0598",
"md5": "f23c690f1ebf795da05c0564474b1d39",
"sha256": "4f2eb1ea2abc0309460774e7ef2efb9e3dd274fcc67b2e14a13761e98647d6ed"
},
"downloads": -1,
"filename": "irv_autopkg_client-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f23c690f1ebf795da05c0564474b1d39",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 54416,
"upload_time": "2023-03-31T16:32:17",
"upload_time_iso_8601": "2023-03-31T16:32:17.852990Z",
"url": "https://files.pythonhosted.org/packages/96/fe/02ff92865c96f9a8885ea3ed11bef7c3ba8a5fb2695856f63a784fbd0598/irv_autopkg_client-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b14cd3e782f3e805b13290c6535717fad3526e9b152dd0e4d1df586d5fb120c3",
"md5": "dd27cc9edafb2f26a24a5d4b0ab538a5",
"sha256": "44e6172769bbee14f3155c100b5b0a9d7283fbe26c7764200b27710a7fa876df"
},
"downloads": -1,
"filename": "irv_autopkg_client-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "dd27cc9edafb2f26a24a5d4b0ab538a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 42863,
"upload_time": "2023-03-31T16:32:19",
"upload_time_iso_8601": "2023-03-31T16:32:19.671691Z",
"url": "https://files.pythonhosted.org/packages/b1/4c/d3e782f3e805b13290c6535717fad3526e9b152dd0e4d1df586d5fb120c3/irv_autopkg_client-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-31 16:32:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "irv-autopkg-client"
}