Python wrapper library for the Detektia API.
Project description
pyDetektia
Python wrapper library for the Detektia API.
Package layout
pyDetektia/
manager.py ApiUser, ApiAdmin, ApiRoot
errors.py DetektiaAPIError, DetektiaConnectionError
Classes
- ApiUser — read operations and actions. Base class.
- ApiAdmin — inherits ApiUser. Adds write operations.
- ApiRoot — inherits ApiAdmin. Adds user and organization management.
ApiAdmin requires being admin or root user. ApiRoot requires being root.
Authentication
Create an instance by passing the API base URL (ip) and one of:
| Method | Example |
|---|---|
| Access token | ApiUser(ip, token=token) |
| Username + password | ApiUser(ip, username=user, password=pwd) |
| Offline refresh token | ApiUser(ip, offline_token=offline_token) |
Obtain an offline token:
from pyDetektia.manager import ApiUser
offline_token = ApiUser.get_offline_token(ip, username, password)
api = ApiUser(ip, offline_token=offline_token)
For admin/root operations use the same auth with ApiAdmin or ApiRoot.
Errors
| Exception | When |
|---|---|
DetektiaAPIError |
API returned an error (4xx/5xx). Has status_code and detail. |
DetektiaConnectionError |
Network failure (unreachable host, timeout). |
ValueError |
Local checks in the library (e.g. wrong role, no auth method). |
Failed API calls raise automatically — no extra import needed in notebooks.
ApiUser
Includes all methods below.
Auth (classmethod)
get_offline_token(ip, username, password)
Datasets
get_datasets_metadataget_dataset
Properties
get_properties_metadataget_property
Metrics
get_metrics_metadataget_metric
Models
get_models_metadataget_kinetics_metadataget_model_data
Exogenous
get_exogenous_metadataget_exogenous_geometriesget_exogenous_data
Assignations
get_assignations_metadataget_assignation_data
Polygons
get_polygon_layersget_polygon_geometriesget_polygon_metricsget_polygon_dataget_polygon_data_info
Actions
run_action
ApiAdmin (additional methods)
Inherits all ApiUser methods.
Datasets
modify_dataset_metadataadd_datasetdelete_dataset
Properties
add_propertydelete_property
Metrics
add_metricdelete_metric
Models
add_modeldelete_model
Exogenous
add_exogenousdelete_exogenous
Assignations
add_assignationdelete_assignation
Polygons
add_polygon_layeradd_polygon_metricsdelete_polygon_layerdelete_polygon_metrics
Quota & credits
get_assigned_quotaget_consumed_quotaget_credits
ApiRoot (additional methods)
Inherits all ApiAdmin and ApiUser methods.
Users
get_userscreate_userdelete_usermodify_role
Organization
modify_quotamodify_credits
Project details
Release history Release notifications | RSS feed
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 pydetektia-4.1.0.tar.gz.
File metadata
- Download URL: pydetektia-4.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
179d87f03e7e4924de1ea7fb9067334d8bcf7dbc194422ed95ab6f3e4ff52733
|
|
| MD5 |
30cefe4dccb7573d4851d1f908bea190
|
|
| BLAKE2b-256 |
364ecc970d213ceaf701e67067132716c018692ebb809efd68956cf3fcc496d4
|
File details
Details for the file pydetektia-4.1.0-py3-none-any.whl.
File metadata
- Download URL: pydetektia-4.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8bc2e5d5a23212f75231019dc92619e993e631a6547dd52ef0a3ae3b36cac2
|
|
| MD5 |
dbcb040759916eee6274694918d139f4
|
|
| BLAKE2b-256 |
fd9fcfcab22764107430d55311611b9df8fb0f539cab3e2b0c66447af386972b
|