Skip to main content

Python SDK for the Movix QC API

Project description

movix-qc-sdk

Production-ready Python SDK for the Movix QC API. It keeps the surface small, handles authentication safely, and focuses on the core QC workflow.

For a full API surface description, see overview.md.

Requirements

  • Python 3.11+
  • Validation requires numpy, trimesh, and DracoPy (installed automatically).

Base URLs

The API is available in two environments. Use staging during integration and testing, and switch to production for go-live.

  • Staging: https://api-staging.movixtech.com
  • Production: https://api.movixtech.com

Installation

python -m pip install -e .

Quick start

You can initialize the client in two ways.

Environment variables + Client():

export MOVIX_QC_API_URL="https://api-staging.movixtech.com"
export MOVIX_QC_USERNAME="user@example.com"
export MOVIX_QC_PASSWORD="..."

Explicit arguments:

from movix_qc_sdk import Client

client = Client(
    api_url="https://api-staging.movixtech.com",
    username="user@example.com",
    password="...",
    timeout=45,
    retries=10,
    user_agent="Movix/1.2 (+example@movixtech.com)",
)

If you use Client() or with Client() as client: without arguments, make sure the environment variables are set first.

Full example (submit, then poll for completion). submit() creates the default validation task for the case:

from movix_qc_sdk import Client

with Client() as client:
    case = client.cases.submit(
        paths=["/path/to/upper.stl", "/path/to/lower.stl"],
        metadata={"note": "Demo", "client": "ACME-001"},
    )

    tasks = client.tasks.list(case_id=case.case_id)
    if tasks:
        task = client.tasks.wait(task_id=tasks[0].task_id, case_id=case.case_id)
        print(task.status)

Upload from public URLs (two files):

from movix_qc_sdk import Client

with Client() as client:
    case = client.cases.submit_urls(
        urls=[
            "https://files.example.com/upper.stl",
            "https://files.example.com/lower.stl",
        ],
        metadata={"note": "Demo", "client": "ACME-001"},
    )

Generate result summary

After all validation tasks complete, generate a narrative summary ready to share with stakeholders:

from movix_qc_sdk import Client, TasksNotCompletedError

with Client() as client:
    # Wait for tasks to complete first
    tasks = client.tasks.list(case_id=case.case_id)
    for task in tasks:
        client.tasks.wait(task_id=task.task_id, case_id=case.case_id)

    # Generate summary (uses user's language by default)
    summary = client.cases.generate_summary(case_id=case.case_id)
    if summary.message:
        print("Issues found:")
        print(summary.message)
    else:
        print("No issues detected")

    # Or generate summary in a specific language
    summary_es = client.cases.generate_summary(
        case_id=case.case_id,
        language_code="es"
    )

Generate viewer link

After Occlusal Evaluation and IQC Holes Detection tasks complete, generate a secure link to share visualization results:

from movix_qc_sdk import Client, TasksNotCompletedError

with Client() as client:
    try:
        link = client.cases.generate_viewer_link(case_id=case.case_id)
        print(f"Viewer URL: {link.url}")
        print(f"Expires at: {link.expires_at}")

        # Share link.url with stakeholders
        # The link is valid for 24 hours by default
    except TasksNotCompletedError:
        print("Required tasks (Occlusal Evaluation and IQC Holes Detection) not complete yet")

The viewer link endpoint is idempotent—if a valid link already exists, it returns that link. Only one link per case can be active at a time.

Configuration

All settings can be passed to Client(...) or set via environment variables.

Environment variables

Variable Client arg Required Default Description Example
MOVIX_QC_API_URL api_url Yes None Base URL of the Movix QC API. Use https://api-staging.movixtech.com for staging or https://api.movixtech.com for production. The SDK strips a trailing slash. https://api-staging.movixtech.com
MOVIX_QC_USERNAME username Yes None Login username (typically an email) for password-based auth. user@example.com
MOVIX_QC_PASSWORD password Yes None Login password for password-based auth. s3cr3t
MOVIX_QC_TIMEOUT timeout No 45 Per-request timeout in seconds. Must be greater than zero. 30
MOVIX_QC_RETRIES retries No 10 Number of retries for transient errors (network errors, 429, 5xx). Must be zero or greater. 2
MOVIX_QC_USER_AGENT user_agent No movix-qc-sdk/0.1.0 Custom user-agent string. Recommended format: <Company>/<AppVersion> (+contact) for traceability. Movix/1.2 (+example@movixtech.com)

Authentication

The SDK logs in with username and password and refreshes tokens automatically.

Error handling

Exceptions raised by the SDK:

  • ValidationError for invalid input or unexpected payload shapes
  • AuthenticationError, AuthorizationError, NotFoundError, RateLimitError
  • TasksNotCompletedError when required tasks are not complete for an operation
  • ApiError for other HTTP failures (includes status_code when available)
  • MovixQCError as the base class

Security notes

  • The SDK never logs tokens or passwords.
  • Authorization headers and cookies are redacted if logging is enabled.
  • Tokens are stored in memory by default and refreshed automatically.
  • Credentials (username, password) and tokens are stored in plaintext in memory during the session. In high-security environments, ensure proper process isolation and avoid core dumps.
  • URL uploads are capped at 256 MB per file; clients must validate/approve URLs.
  • Presigned URLs are validated against an allowed list of storage domains to prevent unauthorized upload destinations.

SSRF Protection

When using submit_urls() or upload_urls() on a server that accepts URLs from untrusted users, you are responsible for validating those URLs to prevent SSRF (Server-Side Request Forgery) attacks.

Example of safe usage:

from urllib.parse import urlparse

ALLOWED_DOMAINS = {"your-storage.com", "trusted-cdn.com"}

def validate_user_urls(urls: list[str]) -> None:
    """Validate URLs from untrusted users before passing to SDK."""
    for url in urls:
        parsed = urlparse(url)
        if parsed.netloc not in ALLOWED_DOMAINS:
            raise ValueError(f"Domain not allowed: {parsed.netloc}")

# In your API endpoint:
@app.post("/upload")
def upload(urls: list[str]):
    validate_user_urls(urls)  # Validate BEFORE passing to SDK
    client.cases.submit_urls(urls=urls)

Risk: If you pass untrusted URLs directly to the SDK without validation, attackers may access your internal services (localhost, private networks, cloud metadata endpoints).

Async task results

Tasks are typically polled until they complete. The SDK provides a wait() helper to do this safely. Confirm with the Movix team before choosing the long-term approach. Options to consider:

  • Polling (simple, current default)
  • Webhooks/callbacks (preferred if available)
  • Long-polling or server-sent events (only if supported)

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

movix_qc_sdk-0.1.1.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

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

movix_qc_sdk-0.1.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file movix_qc_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: movix_qc_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for movix_qc_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 93668f1960c2d3a156b38cf475ebc303e6b32e7f5362268f064c2a9d5038b32c
MD5 7e919e39bd7714d4203ac0b809739703
BLAKE2b-256 672fe65460761877214251c8ff6e7fca59a0018458ef9738c9794086ce6a527e

See more details on using hashes here.

Provenance

The following attestation bundles were made for movix_qc_sdk-0.1.1.tar.gz:

Publisher: publish.yml on Movixtech-Workspace/movix-qc-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file movix_qc_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: movix_qc_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for movix_qc_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22f64e9abc88a260f5ac77e5f8376a31bc4a7300a3156c13d6f9a5a67ce61249
MD5 d8b24705c25f8333ec8fcb9a391446c7
BLAKE2b-256 4450756da6e6f2161298529e0e58005be87f76532a085c254eab782c7e0202f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for movix_qc_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Movixtech-Workspace/movix-qc-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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