Skip to main content

A Python wrapper library for the Huwise Automation API

Project description

huwise-utils-py

A Python library for the Huwise Automation API.

PyPI version Python 3.12+ License: MIT

Features

  • Type-safe configuration with Pydantic-based HuwiseConfig
  • Object-oriented API with HuwiseDataset class and method chaining
  • Async support for high-performance bulk operations
  • Structured logging via dcc-backend-common
  • Dependency injection support for testable code
  • Backwards compatible function-based API available

Installation

Using uv (recommended):

uv add huwise-utils-py

Or via pip:

pip install huwise-utils-py

Requirements

  • Python Version: 3.12 or higher
  • API Key: A valid API key from Huwise

Quick Start

Configuration

Create a .env file:

HUWISE_API_KEY=your-api-key
HUWISE_DOMAIN=data.bs.ch
HUWISE_API_TYPE=automation/v1.0

Using HuwiseDataset (Recommended)

from huwise_utils_py import HuwiseDataset

# Create a dataset instance
dataset = HuwiseDataset(uid="da_abc123")

# Read metadata
title = dataset.get_title()
description = dataset.get_description()

# Update with method chaining
dataset.set_title("New Title", publish=False) \
       .set_description("New description") \
       .publish()

Using Functions

from huwise_utils_py import get_dataset_title, set_dataset_title

# Read
title = get_dataset_title(dataset_uid="da_abc123")

# Write
set_dataset_title("New Title", dataset_uid="da_abc123")

Bulk Operations

from huwise_utils_py import bulk_get_metadata, bulk_get_metadata_async
import asyncio

# Synchronous
metadata = bulk_get_metadata(["da_123", "da_456", "da_789"])

# Asynchronous (10-100x faster for many datasets)
metadata = asyncio.run(bulk_get_metadata_async(["da_123", "da_456", "da_789"]))

API Key Setup

To use huwise-utils-py, create an API key with these permissions:

  • Browse all datasets
  • Create new datasets
  • Edit all datasets
  • Publish own datasets

For OGD Basel, create your API key here.

Important: Add **/.env to your .gitignore to protect your credentials.

Documentation

Full documentation is available at opendatabs.github.io/huwise-utils-py.

Further Links

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

huwise_utils_py-1.0.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

huwise_utils_py-1.0.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file huwise_utils_py-1.0.0.tar.gz.

File metadata

  • Download URL: huwise_utils_py-1.0.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for huwise_utils_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37db697d7590b09c2daca1eb3cb1a4595eb43a6c2987c1a12bcbbde72fb7bbf7
MD5 504614046e1e33bc0df284a4c76517b7
BLAKE2b-256 bf067919d8f07dc5dc50c255c6b83b3948da34c7ffa00d81505c0c9b33ecca5d

See more details on using hashes here.

File details

Details for the file huwise_utils_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: huwise_utils_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for huwise_utils_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee24de26006826d4dfbe705dd99a185ccefe39c933ebd4fd7227c336a765a38
MD5 ade8720ba4f0f11403ff4849001d22b5
BLAKE2b-256 9f2a35d967254ba22b556a8daf3fe20b365525f5bc495236af0a23b0e2022182

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