Skip to main content

UIO API

A Python library for interacting with UIO APIs, featuring built‑in authentication, robust retries, secure token storage, and pagination utilities.

Documentation Map

  • User Guide (usage, configuration, examples): uio_api/README.md
  • Developer Guide (architecture, internals, patterns): uio_api/INTERNAL.md

Features

  • 🔐 Authentication: Interactive login, static tokens, or system accounts
  • ⚡ Retries: Configurable retry strategy with exponential backoff
  • 🛡️ Secure Storage: Keyring or TOML‑based token storage
  • 📄 Pagination: DRF‑style pagination helpers and safeguards

Installation

pip install uio-api

Quick Start

from uio_api import mreg_client
from uio_api.modules.mreg.endpoints import Endpoint

with mreg_client() as m:
    hosts = m.get_all(Endpoint.Hosts)
    print(f"Found {len(hosts)} hosts")

For full usage, configuration, and advanced examples, see uio_api/README.md.

Token helpers

You can store credentials/tokens via the client instances (URLs resolved automatically):

from uio_api import mreg_client, nivlheim_client

# MREG: add system user (uses MREG_URL from config)
with mreg_client() as client:
    client.add_system_user(username="svc", password="secret")

# MREG: add token with knobs (uses MREG_URL from config)
with mreg_client() as client:
    client.add_token(
        username="bob",
        token="abc123",
        scheme="Token",
        timeout=60.0,
        retry_attempts=5,
        page_size=1000,
    )

# Nivlheim: add API key (uses https://nivlheim.uio.no default)
with nivlheim_client() as client:
    client.add_token(
        username="svc",
        token="apikey123",
        scheme="APIKEY",
    )

# Or use explicit URLs
with mreg_client() as client:
    client.add_token(
        username="bob",
        token="abc123",
        url="https://custom.mreg.uio.no"
    )

Release files for uio-api 0.1.1

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

Source distribution (sdist)

Source distribution for uio-api 0.1.1
File Size Uploaded
uio_api-0.1.1.tar.gz 82.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uio-api 0.1.1
File Interpreter ABI Platform
uio_api-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 189.3 kB

Release files / uio_api-0.1.1.tar.gz

Download URL uio_api-0.1.1.tar.gz
Size 82.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1daadf91dab309341a542c543d19a0ecc5e90e0ea66b772807e7232798958b8f
BLAKE2b-256 checksum
How to use checksums
f3c2e292e2c21b644873e946311678551aed319c23d4bfaca1a20dc8bcddeb89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / uio_api-0.1.1-py3-none-any.whl

Download URL uio_api-0.1.1-py3-none-any.whl
Size 106.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04bb403b88cc3f1dffdb34967747848e03453ce1d2a02d99f7838e865a199128
BLAKE2b-256 checksum
How to use checksums
5ffe6b8c91115abcc32354dbb6e2baaa0de0a311a7bae263e0e85886fd609f3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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