Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
dotnet_repo_server:
image: engineeringmethodsag/fluid-basyx-dotnet-repo-server:latest
container_name: dotnetaasserver
pull_policy: always
networks:
- bridge
ports:
Expand All @@ -10,6 +11,7 @@ services:
python_aas_server:
image: engineeringmethodsag/fluid-basyx-python-aasx-server:latest
container_name: pythonaasserver
pull_policy: always
networks:
- bridge
ports:
Expand Down Expand Up @@ -113,6 +115,7 @@ services:
go_aas_configuration:
container_name: aas_basyx_configuration
image: eclipsebasyx/basyxconfigurationservice-go:latest
pull_policy: always
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
Expand All @@ -132,6 +135,7 @@ services:
go_aas_environment:
container_name: goaasserver
image: eclipsebasyx/aasenvironment-go:latest
pull_policy: always
command: ["/app/aasenvironmentservice"]
ports:
- "8070:8082"
Expand Down
42 changes: 21 additions & 21 deletions aas_http_client/classes/wrapper/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@ class ShellPaginatedData:
"""Class representing paginated data for Asset Administration Shells."""

paging_metadata: PagingMetadata
results: list[model.AssetAdministrationShell]
result: list[model.AssetAdministrationShell]

def __init__(self, cursor: str, results: list[model.AssetAdministrationShell]) -> None:
def __init__(self, cursor: str, result: list[model.AssetAdministrationShell]) -> None:
"""Initialize a paginated data object.

:param paging_metadata: Paging metadata
:param results: list of results
"""
self.paging_metadata = PagingMetadata(cursor)
self.results = results
self.result = result


class ReferencePaginatedData:
"""Class representing paginated data for References."""

paging_metadata: PagingMetadata
results: list[model.ModelReference]
result: list[model.ModelReference]

def __init__(self, cursor: str, results: list[model.ModelReference]) -> None:
def __init__(self, cursor: str, result: list[model.ModelReference]) -> None:
"""Initialize a paginated data object.

:param paging_metadata: Paging metadata
:param results: list of results
"""
self.paging_metadata = PagingMetadata(cursor)
self.results = results
self.result = result


class SubmodelPaginatedData:
"""Class representing paginated data for Submodels."""

paging_metadata: PagingMetadata
results: list[model.Submodel]
result: list[model.Submodel]

def __init__(self, cursor: str, results: list[model.Submodel]) -> None:
"""Initialize a paginated data object.
Expand All @@ -67,30 +67,30 @@ def __init__(self, cursor: str, results: list[model.Submodel]) -> None:
:param results: list of results
"""
self.paging_metadata = PagingMetadata(cursor)
self.results = results
self.result = results


class SubmodelElementPaginatedData:
"""Class representing paginated data for Submodel Elements."""

paging_metadata: PagingMetadata
results: list[model.SubmodelElement]
result: list[model.SubmodelElement]

def __init__(self, cursor: str, results: list[model.SubmodelElement]) -> None:
def __init__(self, cursor: str, result: list[model.SubmodelElement]) -> None:
"""Initialize a paginated data object.

:param paging_metadata: Paging metadata
:param results: list of results
"""
self.paging_metadata = PagingMetadata(cursor)
self.results = results
self.result = result


class ShellDescriptorPaginatedData:
"""Class representing paginated data for Shell Descriptors."""

paging_metadata: PagingMetadata
results: list[model.SubmodelElement]
result: list[model.SubmodelElement]

def __init__(self, cursor: str, results: list[model.SubmodelElement]) -> None:
"""Initialize a paginated data object.
Expand All @@ -99,7 +99,7 @@ def __init__(self, cursor: str, results: list[model.SubmodelElement]) -> None:
:param results: list of results
"""
self.paging_metadata = PagingMetadata(cursor)
self.results = results
self.result = results


def create_shell_paging_data(content: dict) -> ShellPaginatedData | None:
Expand All @@ -113,7 +113,7 @@ def create_shell_paging_data(content: dict) -> ShellPaginatedData | None:
results: list = content.get("result", [])
if not results or len(results) == 0:
_logger.warning("No shells found on server.")
return ShellPaginatedData(cursor="", results=[])
return ShellPaginatedData(cursor="", result=[])

for result in results:
if not isinstance(result, dict):
Expand All @@ -133,7 +133,7 @@ def create_shell_paging_data(content: dict) -> ShellPaginatedData | None:

return ShellPaginatedData(
cursor=cursor,
results=aas_list,
result=aas_list,
)


Expand Down Expand Up @@ -183,7 +183,7 @@ def create_submodel_element_paging_data(content: dict) -> SubmodelElementPaginat
results: list = content.get("result", [])
if not results or len(results) == 0:
_logger.warning("No shells found on server.")
return SubmodelElementPaginatedData(cursor="", results=[])
return SubmodelElementPaginatedData(cursor="", result=[])

for result in results:
if not isinstance(result, dict):
Expand All @@ -203,7 +203,7 @@ def create_submodel_element_paging_data(content: dict) -> SubmodelElementPaginat

return SubmodelElementPaginatedData(
cursor=cursor,
results=sme_list,
result=sme_list,
)


Expand All @@ -218,7 +218,7 @@ def create_shell_descriptor_paging_data(content: dict) -> SubmodelElementPaginat
results: list = content.get("result", [])
if not results or len(results) == 0:
_logger.warning("No shells found on server.")
return SubmodelElementPaginatedData(cursor="", results=[])
return SubmodelElementPaginatedData(cursor="", result=[])

for result in results:
if not isinstance(result, dict):
Expand All @@ -238,7 +238,7 @@ def create_shell_descriptor_paging_data(content: dict) -> SubmodelElementPaginat

return SubmodelElementPaginatedData(
cursor=cursor,
results=sme_list,
result=sme_list,
)


Expand All @@ -253,7 +253,7 @@ def create_reference_paging_data(content: dict) -> ReferencePaginatedData | None
results: list = content.get("result", [])
if not results or len(results) == 0:
_logger.warning("No shells found on server.")
return ReferencePaginatedData(cursor="", results=[])
return ReferencePaginatedData(cursor="", result=[])

for result in results:
if not isinstance(result, dict):
Expand All @@ -273,5 +273,5 @@ def create_reference_paging_data(content: dict) -> ReferencePaginatedData | None

return ReferencePaginatedData(
cursor=cursor,
results=ref_list,
result=ref_list,
)
59 changes: 59 additions & 0 deletions aas_http_client/utilities/model_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,62 @@ def create_reference(id: str) -> model.ModelReference:
:return: ModelReference instance
"""
return model.ModelReference.from_referable(model.Submodel(id))


def create_embedded_data_specification(
preferred_name: model.PreferredNameTypeIEC61360,
definition: model.DefinitionTypeIEC61360 | None,
short_name: model.ShortNameTypeIEC61360 | None,
unit: str | None,
unit_id: model.Reference | None,
data_type: model.DataTypeIEC61360 | None,
source_of_definition: str | None,
symbol: str | None,
value_format: str | None,
value_list: set[model.ValueReferencePair] | None,
value: str | None,
level_types: list[model.IEC61360LevelType] | None,
) -> model.EmbeddedDataSpecification | None:
"""Create an embedded data specification with the given parameters.

:param preferred_name: The preferred name of the concept description.
:param definition: The definition of the concept description.
:param short_name: The short name of the concept description.
:param unit: The unit of the concept description.
:param unit_id: The unit reference of the concept description.
:param data_type: The data type of the concept description.
:param source_of_definition: The source of definition of the concept description.
:param symbol: The symbol of the concept description.
:param value_format: The value format of the concept description.
:param value_list: The value list of the concept description.
:param value: The value of the concept description.
:param level_types: The level types of the concept description.
:return: An instance of EmbeddedDataSpecification if successful, None otherwise.
"""
if not preferred_name:
_logger.warning("Preferred name is missing for the embedded data specification.")
return None

return model.EmbeddedDataSpecification(
data_specification=model.ExternalReference(
(
model.Key(
type_=model.KeyTypes.GLOBAL_REFERENCE, value="https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/1"
),
)
),
data_specification_content=model.DataSpecificationIEC61360(
preferred_name=preferred_name,
definition=definition,
short_name=short_name,
unit=unit,
unit_id=unit_id,
data_type=data_type,
source_of_definition=source_of_definition,
symbol=symbol,
value_format=value_format,
value_list=value_list,
value=value,
level_types=level_types or (),
),
)
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 📝 Changelog

## [1.2.9] - 2026-09-01

* 🧹Chore: Refactor wrapper pagination classes to use singular 'result' instead of plural 'results' for consistency with JSON.
* ✨Feat: Add create_embedded_data_specification function to model builder.
* 🚀Improvement: Update dependencies in pyproject.toml and requirements.txt for consistency and version upgrades

## [1.2.8] - 2026-08-26

* 🚀Improvement: Add delete concept descriptions functions to experimental implementations.
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ build-backend = "setuptools.build_meta"

[project]
name = "aas-http-client"
version = "1.2.8"
version = "1.2.9"
description = "Flexible Python HTTP client for communication with various types of AAS servers."
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "Daniel Klein", email = "daniel.klein@em.ag" }]
requires-python = ">=3.13"
dependencies = [
"pydantic>=2.13.4",
"pydantic>=2.13.5",
"requests>=2.34.2",
"basyx-python-sdk>=2.0.1",
"puremagic==1.30",
"types-requests>=2.33.0.20260518",
"basyx-python-sdk==2.1.0",
"puremagic==2.2.0",
]
[project.urls]
Homepage = "https://github.com/fluid40/aas-http-client"
Expand Down
17 changes: 10 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@

pydantic>=2.13.4
# Runtime dependencies
pydantic>=2.13.5
requests>=2.34.2
pytest>=9.1.1
pytest-cov>=7.1.0
build>=1.5.0
python-json-logger>=4.1.0
pre_commit>=4.6.2
commitizen>=4.17.0
basyx-python-sdk==2.1.0
puremagic==2.2.0

# Development and tooling
pytest>=9.1.1
pytest-cov>=7.1.0
python-json-logger>=4.2.0
build>=1.6.0
pre-commit>=4.6.2
commitizen>=4.18.0
types-requests>=2.33.0.20260712
Loading