Skip to main content

A python library for accessing and querying data from Kystdatahuset

Project description

Kystdatahuset Python Library

kystdatahuset-python-lib — Python SDK companion for the Kystdatahuset API

kystdatahuset-python-lib is the official Python client for accessing the Kystdatahuset API, a unified data and knowledge platform for coastal and maritime spatial analytics.

It provides a clean, Pythonic, and strongly typed interface for querying datasets, managing authentication, and performing efficient data access.


✨ Features

🚀 Easy Installation

Install directly from PyPI:

pip install kystdatahuset-python-lib

Supports Python 3.9+ on Linux, macOS, and Windows.


🔐 Simple Authentication

The client offers:

  • API key authentication
  • Support for headless servers and notebooks

Example:

from kystdatahuset.auth import login
import os

    login_response = login("username", "password")
    jwt = auth_res.data.JWT
    voyages = get_voyages_for_ships_by_mmsi(
        auth_jwt=jwt,
        mmsi_ids=[258090000, 259028000],
        start_date=datetime(2024,1,1),
        end_date=datetime(2024,5,1),
    )

🌍 Efficient & “Social” Data Access

Instead of fetching massive multi-GB extracts, the library is designed for smart, cooperative usage patterns, where users share infrastructure responsibly:

✅ Time Window Batching

Fetch long time periods in small, safe slices, python/Pandas "periods"

✅ Geographic Slicing

Request only the needed spatial extent by WKT filters


🧱 Library Structure

+---kystdatahuset
|   |   ais.py
|   |   api_client.py
|   |   auth.py
|   |   const.py
|   |   file_storage.py
|   |   logging.py
|   |   voyage.py
|   |   __init__.py
|   |
|   +---models
|   |   |   AuthData.py
|   |   |   FileListing.py
|   |   |   WebServiceResponse.py
|   |   |   __init__.py
|   |   |
|   |
|   +---types
|   |   |   PandasFrequency.py
|   |   |   UploadFileType.py
|   |   |   __init__.py
|   |   |
|   |
|   +---utils
|   |   |   _date_range.py
|   |   |   __init__.py

📦 Development & Distribution

kystdatahuset-py uses standard packaging:

  • pyproject.toml + PEP 621 metadata
  • versioning via Semantic Versioning
  • full type hints (mypy-friendly)
  • GitHub Actions for automated testing & publishing

🧠 Typical Use Cases

  • Query live AIS vessel data efficiently
  • Retrieve spatial datasets in bounded windows
  • Build dashboards, decision-support tools, or AI/ML pipelines
  • Use Jackdaw (GeoAI) for semantic dataset discovery
  • Integrate with Maritime or Rural Development workflows
  • Avoid oversized extracts by using time/space batching helpers

📄 License

Open source under the MIT License.

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

kystdatahuset_python_lib-0.9.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

kystdatahuset_python_lib-0.9.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file kystdatahuset_python_lib-0.9.1.tar.gz.

File metadata

  • Download URL: kystdatahuset_python_lib-0.9.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for kystdatahuset_python_lib-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e557d9e2d9304f317c9c0b03db351c027c01ea44e051a724b5ae1e6c0b0b42ef
MD5 79fad76341bec6f3b794e1c90c7d07d5
BLAKE2b-256 a684b62c3f857878209d7d1adc05df56a47ee1e70cccf1a21c46d4d88b6b6d81

See more details on using hashes here.

File details

Details for the file kystdatahuset_python_lib-0.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kystdatahuset_python_lib-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a04d65f112eef69ad432d2bbd0d93766db0fcc20fee3f2e8b35a0a6033607c9
MD5 83c136d15872e5f6970972fcf9c1c547
BLAKE2b-256 73cb2e2a4d05bd67d8a20ae1470ee4a07da36849479b0776049087d7994ba52d

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