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 621metadata- 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
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kystdatahuset_python_lib-0.9.3.tar.gz.
File metadata
- Download URL: kystdatahuset_python_lib-0.9.3.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d62852fdb4a9e6c49b7d141557cb6dbca46d76991015e4b87daf08876457ee
|
|
| MD5 |
9388bd6c842ab23791453f1b20ecbac7
|
|
| BLAKE2b-256 |
d30ba511e45599eaf69236c44fc368d136e93f0ec10bda679e33ee1b8d4d72e1
|
File details
Details for the file kystdatahuset_python_lib-0.9.3-py3-none-any.whl.
File metadata
- Download URL: kystdatahuset_python_lib-0.9.3-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f50b1b3d21335e8efd879a0140442d769b8436cdb5abaacf117dd9464a39baf7
|
|
| MD5 |
827e7dafa2f2a43daaa943b17b56f80d
|
|
| BLAKE2b-256 |
8c07b53f9b551e4d785c657d69afcee2701b6d6d2a4671df93b463eb005d0fe9
|