HuwiseDataset
Object-oriented interface for dataset operations with method chaining support.
Overview
HuwiseDataset is a dataclass that represents a Huwise dataset and provides:
- Fluent interface: Chain method calls for cleaner code
- Dependency injection: Accept custom configuration
- Type safety: Full type hints for all methods
- Lazy operations: Control when changes are published
Usage
Creating Instances
from huwise_utils_py import HuwiseDataset
# From a dataset ID
dataset = HuwiseDataset.from_id("100123")
# With custom configuration
from huwise_utils_py import HuwiseConfig
config = HuwiseConfig(api_key="key", domain="custom.domain.com")
dataset = HuwiseDataset.from_id("100123", config=config)
# Create a new dataset
created = HuwiseDataset.create(
metadata={"default": {"title": {"value": "My New Dataset"}}},
dataset_id="my-new-dataset",
is_restricted=False,
resource_source_url="https://data-bs.ch/stata/fgi/stac/AFBA_Abfuhrzonen.geojson",
resource_title="my-new-dataset.geojson",
)
# Or let the library build minimal metadata automatically
created2 = HuwiseDataset.create(
dataset_id="my-easy-dataset",
title="My Easy Dataset",
is_restricted=True,
)
Creating datasets (validation and domain templates)
HuwiseDataset.create blocks until the new dataset’s status is idle, so follow-up calls such as field configuration updates are safe immediately afterward.
metadata is optional in this library: if omitted, a minimal payload with
default.title is generated from title, then dataset_id, then
"Untitled dataset" as a fallback.
Metadata on create is validated by your Huwise domain. Templates and allowed
values differ per domain; see Metadata reference
for examples (e.g. DCAT-AP-CH codes, theme hashes). If POST /datasets/
returns 400, inspect HuwiseAutomationError.detail from the HTTP layer.
Recommended pattern when domains reject large initial payloads: create with
a minimal default.title (and optional dataset_id), then use setters
(set_relation, set_dcat_ap_ch_license, etc.) for other templates.
Optional helpers from huwise_utils_py:
strip_empty_metadata_values(metadata)— drop{"value": ""},[], ornullfield entries before create to avoid sending empty cells the API rejects.assert_non_empty_dataset_id(dataset_id)—createalready rejects a blankdataset_idwhen provided; you can reuse this helper in your own pipelines.
from huwise_utils_py import HuwiseDataset, strip_empty_metadata_values
metadata = strip_empty_metadata_values({
"default": {
"title": {"value": "My dataset"},
"description": {"value": ""},
}
})
created = HuwiseDataset.create(metadata=metadata, dataset_id="my-slug")
Reading Metadata
# Basic fields
title = dataset.get_title()
description = dataset.get_description()
keywords = dataset.get_keywords()
language = dataset.get_language()
publisher = dataset.get_publisher()
theme = dataset.get_theme()
license_value = dataset.get_license() # checks internal.license_id, falls back to default.license
# DCAT-AP-CH fields
rights = dataset.get_dcat_ap_ch_rights()
dcat_license = dataset.get_dcat_ap_ch_license()
# DCAT fields
created = dataset.get_created()
issued = dataset.get_issued() # publication date
creator = dataset.get_creator()
contributor = dataset.get_contributor()
contact_name = dataset.get_contact_name()
contact_email = dataset.get_contact_email()
periodicity = dataset.get_accrualperiodicity()
relation = dataset.get_relation()
# Default template fields
modified = dataset.get_modified()
geo_refs = dataset.get_geographic_reference()
tags = dataset.get_tags()
# Custom template fields
publishing_org = dataset.get_custom_field("publizierende_organisation")
model_description = dataset.get_custom_field("geodaten_modellbeschreibung")
# Get all metadata
metadata = dataset.get_metadata()
Updating Metadata
# Single update (publishes automatically)
dataset.set_title("New Title")
# Update without publishing
dataset.set_title("New Title", publish=False)
# Method chaining
dataset.set_title("Title", publish=False).set_description("Description", publish=False).set_keywords(
["tag1", "tag2"], publish=False
).publish()
# DCAT-AP-CH fields
dataset.set_dcat_ap_ch_rights(
"NonCommercialAllowed-CommercialAllowed-ReferenceRequired",
publish=False,
)
dataset.set_dcat_ap_ch_license("terms_by", publish=False)
# DCAT fields
dataset.set_creator("Data Team", publish=False)
dataset.set_contributor("Open Data Basel-Stadt", publish=False)
dataset.set_contact_name("Data Office", publish=False)
dataset.set_contact_email("data@example.com", publish=False)
dataset.set_issued("2024-06-01", publish=False)
dataset.set_created("2024-06-01T10:00:00Z", publish=False)
dataset.set_accrualperiodicity(
"http://publications.europa.eu/resource/authority/frequency/DAILY",
publish=False,
)
dataset.set_relation("https://example.com/related", publish=False)
# Geographic reference
dataset.set_geographic_reference(["ch_40_12"], publish=False)
# Tags (default.tags)
dataset.set_tags(["opendata.swiss", "mobility"], publish=False)
# Custom template fields (custom.*)
dataset.set_custom_field("publizierende_organisation", "Open Data Basel-Stadt", publish=False)
dataset.set_custom_field(
"geodaten_modellbeschreibung",
"Vektormodell gemäss kantonalem Schema v2.",
publish=False,
)
# Modified date with companion flags
dataset.set_modified(
"2024-06-01T12:00:00Z",
updates_on_metadata_change=True,
updates_on_data_change=False,
publish=False,
)
dataset.publish()
Dataset Actions
# Publish changes
dataset.publish()
# Unpublish dataset
dataset.unpublish()
# Refresh dataset (re-process)
dataset.refresh()
# Delete dataset
dataset.delete()
Dataset Schema And Field Configuration
dataset = HuwiseDataset.from_id("100123")
# Update dataset-level configuration (PUT /datasets/{uid}/)
dataset.update_configuration(
dataset_id="renamed-dataset-id",
is_restricted=True,
)
# Field configuration stack (Dataset fields endpoints)
field_processors = dataset.list_field_configurations(limit=100)
one_processor = dataset.retrieve_field_configuration("pr_qf2hyt")
created_processor = dataset.append_field_configuration({
"type": "rename",
"label": "Rename old field",
"from_name": "old_name",
"to_name": "new_name",
})
updated_processor = dataset.update_field_configuration(
created_processor["uid"],
{
"type": "rename",
"label": "Rename old field (updated)",
"from_name": "old_name",
"to_name": "new_name",
},
)
dataset.delete_field_configuration(updated_processor["uid"])
# Resource management
resources = dataset.list_resources(limit=100)
resource = dataset.upsert_http_resource(
source_url="https://data-bs.ch/stata/fgi/stac/AFBA_Abfuhrzonen.geojson",
title="100095stac.geojson",
)
dataset.delete_resource(resource["uid"])
Method Chaining
All setter methods return self, enabling fluent interfaces:
dataset = HuwiseDataset.from_id("100123")
# Chain all updates, then publish once at the end
dataset.set_title("New Title", publish=False).set_description("Updated description", publish=False).set_keywords(
["python", "data", "automation"], publish=False
).set_language("en", publish=False).set_publisher("Open Data Basel-Stadt", publish=False).set_theme(
"environment", publish=False
).set_dcat_ap_ch_rights(
"NonCommercialAllowed-CommercialAllowed-ReferenceRequired", publish=False
).set_dcat_ap_ch_license("terms_by", publish=False).set_creator("Data Team", publish=False).set_contact_email(
"data@example.com", publish=False
).set_geographic_reference(["ch_40_12"], publish=False).publish()
This is more efficient than calling each setter with publish=True because it only makes one publish API call instead of six.
Template assumptions and publish behavior
The helper methods for custom fields and tags assume your domain has:
custom.<field_key>fields configured in the metadata template (for examplecustom.publizierende_organisation)- a
default.tagsmetadata field for dataset tags
If those fields are not present in your domain template, the API returns an error from the metadata field endpoint.
Setter methods default to publish=True for convenience. For batched updates,
set publish=False on each call and publish once at the end.
API Reference
HuwiseDataset(uid: str, config: HuwiseConfig = HuwiseConfig.from_env())
dataclass
Represents a Huwise dataset with metadata operations.
Provides a fluent interface for reading and modifying dataset metadata. Supports method chaining for convenient batch updates.
| ATTRIBUTE | DESCRIPTION |
|---|---|
uid |
The unique string identifier of the dataset.
TYPE:
|
config |
Optional HuwiseConfig (uses default if not provided).
TYPE:
|
Examples:
Create from a dataset ID and modify with method chaining:
dataset = HuwiseDataset.from_id("100123")
dataset.set_title("New Title", publish=False) .set_description("Description") .publish()
Read metadata:
config: HuwiseConfig = field(default_factory=(HuwiseConfig.from_env))
class-attribute
instance-attribute
from_id(dataset_id: str, config: HuwiseConfig | None = None) -> Self
classmethod
Create a dataset instance from a numeric dataset ID.
| PARAMETER | DESCRIPTION |
|---|---|
dataset_id
|
The numeric identifier of the dataset.
TYPE:
|
config
|
Optional HuwiseConfig instance.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
HuwiseDataset instance with resolved UID. |
| RAISES | DESCRIPTION |
|---|---|
IndexError
|
If no dataset is found with the given ID. |
Source code in src/huwise_utils_py/dataset.py
create(metadata: dict[str, Any] | None = None, *, title: str | None = None, dataset_id: str | None = None, is_restricted: bool | None = None, default_security: DatasetSecurity | None = None, resource_source_url: str | None = None, resource_title: str | None = None, resource_extractor_type: str | None = None, resource_headers: list[dict[str, str]] | None = None, config: HuwiseConfig | None = None) -> Self
classmethod
Create a new dataset and return it as a HuwiseDataset instance.
| PARAMETER | DESCRIPTION |
|---|---|
metadata
|
Optional dataset metadata payload. If omitted, a minimal
metadata object is auto-built with
TYPE:
|
title
|
Optional title used when
TYPE:
|
dataset_id
|
Optional human-readable identifier.
TYPE:
|
is_restricted
|
Optional restriction flag.
TYPE:
|
default_security
|
Optional default security ruleset.
TYPE:
|
resource_source_url
|
Optional HTTP(S) source URL to upsert as a resource right after dataset creation.
TYPE:
|
resource_title
|
Optional title used for the created/updated resource.
TYPE:
|
resource_extractor_type
|
Optional extractor type for the resource.
TYPE:
|
resource_headers
|
Optional connection headers for the resource.
TYPE:
|
config
|
Optional HuwiseConfig instance.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
A |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If metadata is provided but is not a dictionary. |
ValueError
|
If response does not contain a UID. |
Source code in src/huwise_utils_py/dataset.py
get_metadata() -> dict[str, Any]
Retrieve the full metadata of the dataset.
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Dictionary containing all metadata templates and fields. |
Source code in src/huwise_utils_py/dataset.py
get_title() -> str | None
Retrieve the dataset title.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The dataset title or None if not set. |
get_description() -> str | None
Retrieve the dataset description.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The dataset description or None if not set. |
get_keywords() -> list[str] | None
Retrieve the dataset keywords.
| RETURNS | DESCRIPTION |
|---|---|
list[str] | None
|
List of keywords or None if not set. |
get_language() -> str | None
Retrieve the dataset language.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The language code or None if not set. |
get_publisher() -> str | None
Retrieve the dataset publisher.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The publisher name or None if not set. |
get_theme() -> str | None
Retrieve the dataset theme.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The theme ID or None if not set. |
get_license() -> str | None
Retrieve the dataset license.
Checks internal.license_id first (where the platform stores the
canonical license ID, e.g. "5sylls5"). Falls back to
default.license (human-readable string used by older datasets,
e.g. "CC BY").
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The license identifier/name, or None if neither field is set. |
Source code in src/huwise_utils_py/dataset.py
get_custom_view() -> dict[str, Any] | None
Retrieve the dataset custom view configuration.
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any] | None
|
Custom view dictionary or None if not set. |
get_dcat_ap_ch_rights() -> str | None
Retrieve the DCAT-AP-CH rights statement.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The rights statement string (e.g. |
str | None
|
|
str | None
|
or None if not set. |
Source code in src/huwise_utils_py/dataset.py
get_dcat_ap_ch_license() -> str | None
Retrieve the DCAT-AP-CH license code.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The license code (e.g. |
get_created() -> str | None
Retrieve the dataset creation date (dcat.created).
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
ISO datetime string or None if not set. |
get_issued() -> str | None
Retrieve the dataset publication date (dcat.issued).
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
ISO datetime string or None if not set. |
get_creator() -> str | None
Retrieve the dataset creator.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The creator name or None if not set. |
get_contributor() -> str | None
Retrieve the dataset contributor.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The contributor name or None if not set. |
get_contact_name() -> str | None
Retrieve the dataset contact name.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The contact name or None if not set. |
get_contact_email() -> str | None
Retrieve the dataset contact email.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The contact email address or None if not set. |
get_accrualperiodicity() -> str | None
Retrieve the dataset accrual periodicity.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
EU frequency URI string (e.g. |
str | None
|
|
str | None
|
or None if not set. |
Source code in src/huwise_utils_py/dataset.py
get_relation() -> str | None
Retrieve the dataset relation URL.
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
The relation URL string or None if not set. |
get_modified() -> str | None
Retrieve the dataset last-modified date (default.modified).
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
ISO datetime string or None if not set. |
get_geographic_reference() -> list[str] | None
Retrieve the dataset geographic reference codes.
| RETURNS | DESCRIPTION |
|---|---|
list[str] | None
|
List of geographic reference codes (e.g. |
list[str] | None
|
|
Source code in src/huwise_utils_py/dataset.py
get_custom_field(field_key: str) -> Any
Retrieve a field from the custom template.
| PARAMETER | DESCRIPTION |
|---|---|
field_key
|
Field key in the
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The stored custom field value or |
Source code in src/huwise_utils_py/dataset.py
get_tags() -> list[str]
Retrieve dataset tags from default.tags.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
List of dataset tags. Returns an empty list if tags are unset. |
Source code in src/huwise_utils_py/dataset.py
set_title(title: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset title.
| PARAMETER | DESCRIPTION |
|---|---|
title
|
The new title for the dataset.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_description(description: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset description.
| PARAMETER | DESCRIPTION |
|---|---|
description
|
The new description for the dataset.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_keywords(keywords: list[str], *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset keywords.
| PARAMETER | DESCRIPTION |
|---|---|
keywords
|
List of keywords for the dataset.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_language(language: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset language.
| PARAMETER | DESCRIPTION |
|---|---|
language
|
Language code (e.g., "en", "de", "fr").
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_publisher(publisher: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset publisher.
| PARAMETER | DESCRIPTION |
|---|---|
publisher
|
Publisher name.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_theme(theme_id: str, *, publish: bool = True) -> Self
Set the dataset theme.
| PARAMETER | DESCRIPTION |
|---|---|
theme_id
|
Theme identifier.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_license(license_id: str, *, license_name: str | None = None, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset license.
Uses per-field PUT endpoints to update default.license_id
(and optionally default.license) without risking overwrites to
other metadata fields. The platform propagates license_id to
internal.license_id automatically.
| PARAMETER | DESCRIPTION |
|---|---|
license_id
|
License identifier (e.g.
TYPE:
|
license_name
|
Optional human-readable name (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_dcat_ap_ch_rights(rights: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the DCAT-AP-CH rights statement.
| PARAMETER | DESCRIPTION |
|---|---|
rights
|
Rights statement string (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_dcat_ap_ch_license(license_code: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the DCAT-AP-CH license code.
| PARAMETER | DESCRIPTION |
|---|---|
license_code
|
License code (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_created(created: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset creation date (dcat.created).
| PARAMETER | DESCRIPTION |
|---|---|
created
|
ISO datetime string (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_issued(issued: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset publication date (dcat.issued).
| PARAMETER | DESCRIPTION |
|---|---|
issued
|
ISO datetime string (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_creator(creator: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset creator.
| PARAMETER | DESCRIPTION |
|---|---|
creator
|
Creator name.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_contributor(contributor: str, *, publish: bool = True) -> Self
Set the dataset contributor.
| PARAMETER | DESCRIPTION |
|---|---|
contributor
|
Contributor name.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_contact_name(name: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset contact name.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Contact name.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_contact_email(email: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset contact email.
| PARAMETER | DESCRIPTION |
|---|---|
email
|
Contact email address.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_accrualperiodicity(frequency: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset accrual periodicity.
| PARAMETER | DESCRIPTION |
|---|---|
frequency
|
EU frequency URI string (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_relation(relation: str, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset relation URL.
| PARAMETER | DESCRIPTION |
|---|---|
relation
|
Relation URL string.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_geographic_reference(references: list[str], *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set the dataset geographic reference codes.
| PARAMETER | DESCRIPTION |
|---|---|
references
|
List of geographic reference codes (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_custom_field(field_key: str, value: Any, *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set a field in the custom metadata template.
| PARAMETER | DESCRIPTION |
|---|---|
field_key
|
Field key in the
TYPE:
|
value
|
Value to set for the field. Must be JSON-serializable.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_tags(tags: list[str], *, publish: bool = True, override_remote_value: bool | None = None) -> Self
Set dataset tags in default.tags.
| PARAMETER | DESCRIPTION |
|---|---|
tags
|
List of tag strings (e.g.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
set_modified(modified: str, *, updates_on_metadata_change: bool | None = None, updates_on_data_change: bool | None = None, publish: bool = True) -> Self
Set the dataset last-modified date (default.modified).
Uses per-field PUT endpoints so that each field is updated
| PARAMETER | DESCRIPTION |
|---|---|
modified
|
ISO datetime string (e.g.
TYPE:
|
updates_on_metadata_change
|
If given, sets whether the modified date should auto-update when metadata changes.
TYPE:
|
updates_on_data_change
|
If given, sets whether the modified date should auto-update when data changes.
TYPE:
|
publish
|
Whether to publish after updating.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
publish() -> Self
Publish the dataset to make changes visible.
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
unpublish() -> Self
Unpublish the dataset.
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
refresh() -> Self
Refresh the dataset (re-process data).
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
delete() -> None
Delete the dataset.
After successful deletion, this instance should no longer be used for API operations that require the dataset to exist.
Source code in src/huwise_utils_py/dataset.py
update_configuration(*, dataset_id: str | None = None, is_restricted: bool | None = None, default_security: DatasetSecurity | None = None) -> Self
Update dataset-level configuration properties.
| PARAMETER | DESCRIPTION |
|---|---|
dataset_id
|
Optional new dataset ID.
TYPE:
|
is_restricted
|
Optional restriction flag.
TYPE:
|
default_security
|
Optional default security ruleset.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If no configuration field is provided. |
Source code in src/huwise_utils_py/dataset.py
list_field_configurations(*, limit: int | None = None, offset: int | None = None) -> dict[str, Any]
List field configurations for the dataset.
| PARAMETER | DESCRIPTION |
|---|---|
limit
|
Optional pagination limit.
TYPE:
|
offset
|
Optional pagination offset.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Paginated response dictionary with field configurations. |
Source code in src/huwise_utils_py/dataset.py
retrieve_field_configuration(field_uid: str) -> dict[str, Any]
Retrieve one field configuration by UID.
| PARAMETER | DESCRIPTION |
|---|---|
field_uid
|
Field configuration UID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Field configuration dictionary. |
Source code in src/huwise_utils_py/dataset.py
append_field_configuration(field_configuration: dict[str, Any]) -> dict[str, Any]
Append a new field configuration processor.
| PARAMETER | DESCRIPTION |
|---|---|
field_configuration
|
Payload for field configuration creation.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Created field configuration response. |
Source code in src/huwise_utils_py/dataset.py
update_field_configuration(field_uid: str, field_configuration: dict[str, Any]) -> dict[str, Any]
Update an existing field configuration processor.
| PARAMETER | DESCRIPTION |
|---|---|
field_uid
|
Field configuration UID.
TYPE:
|
field_configuration
|
Updated field configuration payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Updated field configuration response. |
Source code in src/huwise_utils_py/dataset.py
delete_field_configuration(field_uid: str) -> Self
Delete a field configuration processor.
| PARAMETER | DESCRIPTION |
|---|---|
field_uid
|
Field configuration UID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |
Source code in src/huwise_utils_py/dataset.py
list_resources(*, limit: int | None = None, offset: int | None = None) -> dict[str, Any]
List resources for the dataset.
| PARAMETER | DESCRIPTION |
|---|---|
limit
|
Optional pagination limit.
TYPE:
|
offset
|
Optional pagination offset.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Paginated response dictionary with resources. |
Source code in src/huwise_utils_py/dataset.py
upsert_http_resource(*, source_url: str, title: str | None = None, extractor_type: str | None = None, headers: list[dict[str, str]] | None = None) -> dict[str, Any]
Create or update a dataset HTTP resource idempotently.
| PARAMETER | DESCRIPTION |
|---|---|
source_url
|
Absolute HTTP(S) source URL.
TYPE:
|
title
|
Optional resource title.
TYPE:
|
extractor_type
|
Optional extractor type. Not auto-guessed.
TYPE:
|
headers
|
Optional connection headers list.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Created or updated resource payload. |
Source code in src/huwise_utils_py/dataset.py
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 | |
delete_resource(resource_uid: str) -> Self
Delete a resource by UID.
| PARAMETER | DESCRIPTION |
|---|---|
resource_uid
|
Resource UID.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Self for method chaining. |