How eclipse-basyx/basyx-python-sdk works
1. This is a Python monorepo for the Eclipse BaSyx ecosystem, split into three publishable pieces: sdk for the core AAS library, server for a containerized HTTP service, and compliance_tool for command-line validation. The top-level repo also includes CI/release automation and shared contribution/legal files.
2. The sdk package is the main architecture center. It defines the Asset Administration Shell metamodel as Python objects under basyx/aas/model, with supporting utilities for identification, traversal, and string constraints. This is the layer other packages build on.
3. The SDK’s data transformation boundary is the adapter layer in basyx/aas/adapter. It contains serializers/deserializers for JSON and XML, plus an AASX adapter for reading and writing package files. In diagram terms, model objects sit in the middle, with format-specific adapters on the edges.
4. Persistence is abstracted through basyx/aas/backend. Two concrete backends are present: local_file for filesystem storage and couchdb for database-backed storage. This indicates a repository-style boundary where AAS objects can be stored either locally or in CouchDB without changing the model layer.
5. The SDK also ships example code and tutorials under basyx/aas/examples, which show the intended flows: create model objects, serialize/deserialize them, package them into AASX, and persist them through a backend. These are not separate subsystems, but they help clarify the library’s end-to-end usage.
6. The server package is a deployment-oriented service wrapper around the AAS functionality. Its app/interfaces and app/util modules suggest a clean separation between HTTP/service interfaces, repository abstractions, and conversion helpers. The server is packaged for Docker and run with uwsgi/supervisord, so runtime concerns are externalized from the core SDK.
7. The server’s role is to expose specification-compliant repositories: an Asset Administration Shell Repository and a Submodel Repository. The test/interfaces/test_repository.py coverage indicates the key boundary is the repository contract, not business logic inside the transport layer.
8. The compliance_tool package is a standalone validator focused on AAS JSON, XML, and AASX inputs. It includes separate checkers for each format, a state_manager for result tracking, and bundled JSON/XSD schemas for formal validation. The tool is CLI-driven and is designed to classify files as compliant, warning, or invalid based on schema and structural checks.
9. The compliance tool’s test fixtures make its pipeline explicit: raw JSON/XML files and AASX package directories are fed into the checkers, including positive examples, empty files, malformed attributes, and deserialization-warning cases. This subsystem is therefore file-in, report-out, with format-specific branching before validation.
10. Cross-cutting repository concerns include test suites for each package, typed-package markers (py.typed), and documentation trees for both SDK and server. The repository is built and verified via GitHub Actions workflows for CI and release, with version-consistency scripts under etc/scripts.
11. From an architecture-diagram perspective, the clearest boundaries are: core AAS model, format adapters, storage backends, HTTP server wrapper, compliance CLI, and external dependencies such as CouchDB, filesystem storage, and AASX package files. The SDK provides the reusable domain core; the server and compliance tool are thin application layers built on top of it.
Main entry points: main.py Service app · model AAS model · adapter Adapters · backend Backends
Components 22
SDK
Core reusable AAS library
- AAS model · Asset Administration Shell metamodel objects
sdk/basyx/aas/model - Adapters · Format adapters for JSON, XML, and AASX
sdk/basyx/aas/adapter - Backends · Persistence abstraction with filesystem and CouchDB implementations
sdk/basyx/aas/backend - Utilities · Identification and traversal helpers
sdk/basyx/aas/util - Examples · Tutorials and sample flows across model, adapters, and storage
sdk/basyx/aas/examples - JSON · JSON serialization and deserialization
sdk/basyx/aas/adapter/json - XML · XML serialization and deserialization
sdk/basyx/aas/adapter/xml - AASX · AASX package read/write adapter
sdk/basyx/aas/adapter/aasx.py - Local file · Filesystem storage backend
sdk/basyx/aas/backend/local_file.py - CouchDB · CouchDB-backed storage backend
sdk/basyx/aas/backend/couchdb.py
Server
HTTP service wrapper around the SDK
- Service app · Server application entrypoint
server/app/main.py - Interfaces · Repository contracts and HTTP-facing interfaces
server/app/interfaces - Converters · Helpers for mapping between transport and domain objects
server/app/util/converters.py - Container runtime · Docker, uWSGI, and supervisord packaging for service execution
server/Dockerfile
Compliance Tool
CLI validator for AAS files
- CLI · Command-line entrypoint for compliance checks
compliance_tool/aas_compliance_tool/cli.py - JSON check · Schema and structure validation for JSON inputs
compliance_tool/aas_compliance_tool/compliance_check_json.py - XML check · Schema and structure validation for XML inputs
compliance_tool/aas_compliance_tool/compliance_check_xml.py - AASX check · Validation of AASX package inputs
compliance_tool/aas_compliance_tool/compliance_check_aasx.py - State manager · Tracks compliance outcomes and statuses
compliance_tool/aas_compliance_tool/state_manager.py
Repo Ops
Shared repository automation and docs
- basyx-python-sdk · Python monorepo for SDK, server, and compliance tool
- CI / release · GitHub Actions workflows for testing and release
.github/workflows - Version scripts · Shared scripts for version and copyright checks
etc/scripts
Connections 27
- basyx-python-sdk → AAS model: contains · Repository includes the SDK domain core
- basyx-python-sdk → Service app: contains · Repository includes the server package
- basyx-python-sdk → CLI: contains · Repository includes the compliance tool
- AAS model → Adapters: feeds · Model objects are serialized and deserialized through adapters
- AAS model → Backends: persists via · Model objects are stored through backend abstractions
- AAS model → Utilities: uses · Domain helpers support identifiers and traversal
- Adapters → JSON: includes · JSON format adapter
- Adapters → XML: includes · XML format adapter
- Adapters → AASX: includes · AASX package adapter
- Backends → Local file: includes · Filesystem backend implementation
- Backends → CouchDB: includes · CouchDB backend implementation
- Examples → AAS model: demonstrates · Examples create and manipulate model objects
- Examples → Adapters: demonstrates · Examples serialize and deserialize formats
- Examples → Backends: demonstrates · Examples show storage flows
- Service app → Interfaces: depends on · Service entrypoint is built around repository interfaces
- Service app → Converters: uses · Runtime converts between transport and SDK types
- Service app → AAS model: serves · HTTP service exposes AAS domain objects
- Service app → Backends: stores through · Service uses SDK backends for persistence
- Container runtime → Service app: runs · Container and supervisor tooling launch the service
- CLI → JSON check: dispatches · CLI routes JSON inputs to the JSON checker
- CLI → XML check: dispatches · CLI routes XML inputs to the XML checker
- CLI → AASX check: dispatches · CLI routes AASX inputs to the package checker
- JSON check → State manager: reports · Checker updates validation state
- XML check → State manager: reports · Checker updates validation state
- AASX check → State manager: reports · Checker updates validation state
- CI / release → basyx-python-sdk: verifies · Workflows validate the monorepo
- Version scripts → CI / release: supports · Shared scripts help enforce repository policy