Skip to main content

aqt-connector

License

AQT logo

An SDK and lightweight CLI to authenticate with AQT's Arnica platform using OIDC (Auth0).

It supports:

  • Device Authorization Flow (QR code + verification URL)
  • Client Credentials Flow (machine-to-machine)
  • Local token storage and verification against JWKS
  • Simple Python API and a small CLI (via python -m aqt_connector)

Unless you were explicitly sent here, you probably want to instead use an AQT provider for another library, where this library has already been integrated. We already have those for:

Requirements

  • Python >= 3.9, < 3.14

Installation

pip install aqt-connector

Quickstart

Python API

By obtaining an access token through one of the following methods, it will be verified and stored locally. The stored token is re-used in later log_in attempts and does thus not require you to authenticate again, unless the token has expired.

from aqt_connector import ArnicaApp, ArnicaConfig, log_in, get_access_token

# Configure (use client credentials OR device flow)
config = ArnicaConfig()

# Option A: client credentials
# config.client_id = "YOUR_CLIENT_ID"
# config.client_secret = "YOUR_CLIENT_SECRET"

# Option B: device flow (no client credentials set)

# Optional: change base API URL
# config.arnica_url = "https://arnica.aqt.eu/api"

app = ArnicaApp(config)

# Acquire token (stored by default when obtained)
token = log_in(app)
print("Access token:", token[:10] + "…")

# Later, get current token (if still valid and stored)
maybe_token = get_access_token(app)

CLI: log in

The CLI is exposed via the module entry point. Run:

python -m aqt_connector --help
python -m aqt_connector log-in

By default, this starts the device flow and prints a QR code and verification URL. Once you complete the flow in your browser, an ID token is obtained, verified, and stored locally.

You can also provide client credentials (machine-to-machine):

python -m aqt_connector log-in \
    --client-id YOUR_CLIENT_ID \
    --client-secret YOUR_CLIENT_SECRET

Optional override of the Arnica API URL:

python -m aqt_connector log-in --arnica-url https://arnica.aqt.eu/api

Where are things stored?

  • When using the CLI, configuration and the token are stored in your OS application directory for "aqt" (e.g. Linux: ~/.config/aqt; macOS: ~/Library/Application Support/aqt; Windows: %APPDATA%\aqt).
  • The token is saved as a file named access_token in that directory.

Configuration

The SDK loads configuration from two places, in this order of precedence (last wins):

  1. A local config file at {app_dir}/config
  2. Environment variables prefixed with AQT_

app_dir defaults to:

  • Library usage (Python API): ~/.aqt
  • CLI usage: your OS app directory for "aqt" (see Quickstart)

Config file (TOML)

Create a file named config in the app_dir or a custom location which you then pass to the ArnicaConfig (config = ArnicaConfig("~/myconfig")). TOML dotted keys or tables are supported. Example:

[default]
arnica_url = "https://arnica.aqt.eu/api"
client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"
store_access_token = true

Notes:

  • store_access_token=true will persist the obtained token to {app_dir}/access_token
  • To disable persistence, set store_access_token=false in this file

Environment variables

Environment variables use the AQT_ prefix and map to the same lowercase keys. Examples:

  • AQT_ARNICA_URL
  • AQT_CLIENT_ID
  • AQT_CLIENT_SECRET
  • AQT_STORE_ACCESS_TOKEN

Tip: Prefer the config file to disable persistence reliably (see notes above).

Testing

Install the dependencies

uv sync --group test

Unit tests:

pytest -q tests/commit

Integration tests (require Auth0 test credentials and a browser via Playwright):

# Required environment variables
# AUTH0_TEST_TENANT_DOMAIN
# AUTH0_TEST_CLIENT_CREDENTIALS_AUDIENCE
# AUTH0_TEST_CLIENT_CREDENTIALS_CLIENT_ID
# AUTH0_TEST_CLIENT_CREDENTIALS_CLIENT_SECRET
# AUTH0_TEST_DEVICE_FLOW_CLIENT_ID
# AUTH0_TEST_DEVICE_FLOW_USER_EMAIL
# AUTH0_TEST_DEVICE_FLOW_USER_PASSWORD

pytest -q tests/integration

Contributing

Issues and PRs are welcome. For local development, we use UV to manage virtual environments and install the package:

uv sync  # includes dev tools by default

Run linters and tests before submitting changes.

uvx pyproject-fmt pyproject.toml --check
uvx ruff check
uvx typos
uvx ruff format --check
uv run mypy .

License

Copyright (c) Alpine Quantum Technologies GmbH.

This software is licensed under the Apache License 2.0. See the LICENSE file for details.

Metadata

Release files for aqt-connector 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aqt-connector 0.6.0
File Size Uploaded Provenance Actions
aqt_connector-0.6.0.tar.gz 179.5 kB With provenance Details for aqt_connector-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aqt-connector 0.6.0
File Interpreter ABI Platform Actions
aqt_connector-0.6.0-py3-none-any.whl Python 3 none any Details for aqt_connector-0.6.0-py3-none-any.whl

Total release size: 212.0 kB

Release files / aqt_connector-0.6.0.tar.gz

Download URL aqt_connector-0.6.0.tar.gz
Size 179.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f5330cf32cbddf9139f6f1bfbbf5d988cb3dc050ddc0a54ce0900eeee49b5511
BLAKE2b-256 checksum
How to use checksums
a96e20f09f3727cd38ca52b4e5a4e2e8b55a1bc141d38fed3ba8d9a8546344da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / aqt_connector-0.6.0-py3-none-any.whl

Download URL aqt_connector-0.6.0-py3-none-any.whl
Size 32.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e61eba97ab38600d9c40460c514266138f8548ef09df3716ca0926551f85550
BLAKE2b-256 checksum
How to use checksums
22eb80b1a62da35c1d3f7d94a4e39d593e17cd3e93b3af42dffbf814362ba361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for aqt-connector 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aqt_connector-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page