Skip to main content

aas-studio — Python SDK for AAS Studio

Typed, zero-dependency client for the AAS Studio public REST API. Drop a PDF datasheet, get a structured Asset Administration Shell extraction back.

Install

pip install aas-studio

Requires Python 3.9+. Uses only the standard library — no requests, no httpx, no pydantic.

Auth

Generate a Bearer key at https://aas-studio.eu/studio/settings/keys. Keys start with sk_aas_ and are shown ONCE — store them in a secret manager.

import os
from aas_studio import AasStudioClient

aas = AasStudioClient(api_key=os.environ["AAS_STUDIO_KEY"])

Quickstart — extract from a PDF

with open("./datasheets/ur10e.pdf", "rb") as f:
    response = aas.extract(
        f.read(),
        file_name="ur10e.pdf",
        id_prefix="urn:acme:aas",
    )

result = response["result"]
print(f"Asset: {result['assetIdShort']} ({len(result['submodels'])} submodels)")
print(f"Provider: {response['provider']}")
for w in response["warnings"]:
    print("warn:", w)

Library — list & fetch saved extractions

# List
page = aas.list_extractions(limit=50)
for ex in page["extractions"]:
    print(f"{ex['id']}  {ex['name']}  ({ex['mode']}, {ex['sourceCount']} sources)")

# Detail — full audit-replay payload
detail = aas.get_extraction(page["extractions"][0]["id"])
print(detail["extraction"]["aas"])    # the AAS itself
print(detail["extraction"]["meta"])   # extractionMeta with traces + cert

Validate / fix existing AAS files

with open("aas.aasx", "rb") as f:
    result = aas.validate(f.read())
if not result["valid"]:
    for err in result["errors"]:
        print(err["message"])

with open("broken.xml", "rb") as f:
    fixed = aas.fix(f.read())
if fixed["changed"]:
    print(fixed["xml"])

Error handling

from aas_studio import (
    AasStudioError,
    AuthError,
    QuotaError,
    FileTooLargeError,
    ProviderError,
)

try:
    aas.extract(pdf_bytes)
except QuotaError as e:
    print(f"Quota: {e.used}/{e.limit} on plan {e.plan}")
except AuthError:
    print("Bad API key — check the dashboard")
except FileTooLargeError:
    print("PDF over 20 MB — split or compress before upload")
except ProviderError as e:
    print(f"Provider failed (id={e.request_id}). Retry-friendly.")
except AasStudioError as e:
    print(f"Other API error: {e} (status={e.status}, request_id={e.request_id})")

Every error carries .request_id (when the server emitted one) for support correlation. Quote it when you contact us.

Configuration

aas = AasStudioClient(
    api_key=os.environ["AAS_STUDIO_KEY"],

    # Self-hosted deployment? Point at your own URL:
    base_url="https://aas.yourcompany.com/api/v1",

    # Default per-call timeout in seconds (per-call override available).
    timeout=60.0,

    # Custom HTTP layer — bring your own `requests`/`httpx` session.
    # Signature: (method, url, headers, body, timeout) -> (status, headers, body_bytes)
    http_client=my_http_client,
)

License

MIT — see LICENSE.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aas_studio-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

aas_studio-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file aas_studio-0.1.0.tar.gz.

File metadata

  • Download URL: aas_studio-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for aas_studio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c150de5332421d4b6e4b4803e516de467171c9aa5a30f35746dca2b858fd3074
MD5 71a35c9649de8538585ab2a9a4a4b3eb
BLAKE2b-256 4ca25a300710f21383d7cbbb268012d7d399671a72e900c375fc0cae5aae312a

See more details on using hashes here.

File details

Details for the file aas_studio-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aas_studio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for aas_studio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e773be5a33ddff99b9528fc5ea73cc664683a8beda9c60e0e8462556d0185719
MD5 143c0711f5250b50fb192b4b227deeea
BLAKE2b-256 e1da15f0fe7e9aae9336a3ff491fb5e5f2c7cc6510c808dc196c32547a1cb9ec

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