Skip to main content

A python client for accessing and querying geospatial open data portals.

Reason this release was yanked:

Initial release immediately updated.

Project description

kapipy

A python client for accessing and querying datasets from geospatial open data portals such as LINZ, Stats NZ and LRIS.

Overview

kapipy is a Python package that provides a python interface to the Koordinates geospatial content management system. It allows users to connect a data portal, retrieve metadata, and query vector layers and tables.

Documentation available at Github Pages documentation website

Disclaimer

This is a hobby project and the modules are provided as-is on a best-effort basis and you assume all risk for using it.
The author has no affiliation with either Koordinates nor LINZ, Stats NZ or LRIS. As such, the underlying API's and services may change at any time without warning and break these modules. The author is not privvy to any inside knowledge or documentation beyond what is available online or by inspecting the payloads returned by the services.

This project does not cover the full spectrum of the Koordinates API and probably never will. It focuses currently on basic workflows such as connecting using an api key, getting references to datasets and downloading them.

The author is happy to take feedback and consider suggestions and code contributions as time allows. Preferred method for feedback is via the Github repository issues page.

Installation

pip install kapipy

Usage

  • Import kapipy.
  • Create a GIS object, passing in an api key.
  • Get a reference to an item using {gis}.content.get({layer_id})
  • Perform actions on the item.

Basic example:

from kapipy.gis import GIS
linz = GIS(name="linz", api_key="my-api-key")
rail_station_layer_id = "50318"
itm = linz.content.get(rail_station_layer_id)
data = itm.query()
data.head()

Tests

Tests are written using pytest. To run tests using UV:

uv run -m pytest --log-cli-level=INFO

There is currently very limited test coverage. Any live tests require a "LINZ_API_KEY" entry to exist in a .env file in the root project folder.

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

kapipy-0.1.2.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

kapipy-0.1.2-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file kapipy-0.1.2.tar.gz.

File metadata

  • Download URL: kapipy-0.1.2.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.9

File hashes

Hashes for kapipy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 690b25c51e2500b3ca84bbbccf84dfcd0b77f0849d3262a729ff6f912fc5bafd
MD5 5598e2298cef3d22137bc6d454c4540d
BLAKE2b-256 2c371defaec02124de62724c2029bccd1adbdafc28723fd95d217a84890dcefb

See more details on using hashes here.

File details

Details for the file kapipy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: kapipy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.9

File hashes

Hashes for kapipy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a45bb45b60b676b00119ee776905c8e605ff07d4d366146d4aff6b633a754689
MD5 72c394f3a84a21aa80b545753fce974d
BLAKE2b-256 6f773e7c3486137c10bc1151e9a9a0ddd1586e2b1557dc6f06c46c217517ad1a

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