Skip to main content

vexxhost-clientcore

The code every VEXXHOST API client would otherwise copy: a Keystone transport, RFC 9457 error handling, OpenStackClient plugin wiring, CLI argument parsers and model generation. Each service keeps its own client package, version and release cadence, and only service-specific code lives there.

Client Commands
vexxhost-costexplorerclient openstack cost report/forecast …
vexxhost-budgetclient openstack budget …

It builds on keystoneauth1, openstack.config and osc-lib, the same libraries every OpenStack client uses. docs/naming.md records how clients are named and packaged, and which upstream code the core reuses.

pip install vexxhost-clientcore

What is shared

Module Provides
vexxhost_clientcore.http SessionClient, a keystoneauth1 Adapter: catalog lookup by service type, region and interface; endpoint override with validation; the API version prefix appended once; percent-encoded path segments; redirects never followed, so the token never leaves the host; problem documents turned into exceptions; the client named in User-Agent.
vexxhost_clientcore.client ServiceClient, the base of each service's versioned client. It is built from a keystoneauth session, or with from_cloud_region() from openstack.config, which applies the cloud's per-service settings (<service>_endpoint_override, _interface, _region_name, _status_code_retries, api_timeout).
vexxhost_clientcore.exceptions ClientException carrying status_code, problem, request_id and retry_after, with BadRequest, NotFound, Conflict, TooManyRequests, ServiceUnavailable and others. Each is also the matching keystoneauth1.exceptions class, so except keystoneauth1.exceptions.NotFound works as it does for other OpenStack clients.
vexxhost_clientcore.osc Plugin, the make_client and build_option_parser hooks OpenStackClient calls, giving every plugin --os-<name>-endpoint / OS_<NAME>_ENDPOINT and --os-<name>-api-version, and building the client from OSC's cloud region. versioned_factory builds the Client("1", session=...) entry point.
vexxhost_clientcore.cli timestamp (dates and RFC 3339 times normalized to UTC, refusing times without an offset) and bounded_int.
vexxhost_clientcore.fields choices(Model, field) reads the allowed values of a generated Literal, so CLI choices follow the API's schema.
vexxhost_clientcore.codegen python -m vexxhost_clientcore.codegen --service budget --spec <url> --output <models.py> generates TypedDict models from the OpenAPI 3.0 schema a deployment serves, with a pinned generator and a SPEC_VERSION naming the server build.
.github/workflows/python-client-ci.yml Reusable test workflow: Python 3.10/3.12/3.13, ruff, pytest, build, and a CLI smoke command.
.github/workflows/release.yml Publishes this package to PyPI on a v* tag through trusted publishing.
.github/workflows/regenerate-models.yml Reusable workflow that regenerates a client's models from its reference deployment and opens a pull request when they changed.

Service clients keep what is specific to them: their resource managers, OSC commands, generated models and tests.

Writing a client

# exampleclient/v1/client.py
from vexxhost_clientcore.client import ServiceClient


class Client(ServiceClient):
    service_type = "example"  # Keystone catalog type
    title = "Example"  # used in error messages
    endpoint_option = "--os-example-endpoint"
    client_name = "vexxhost-exampleclient"
    client_version = "0.1.0"

    def setup(self, http_client):
        self.things = ThingManager(http_client)


class ThingManager:
    def __init__(self, api):
        self.api = api

    def list(self):
        return self.api.get_json("things")["things"]

    def get(self, thing_id):
        return self.api.get_json(self.api.path("things", thing_id))
# exampleclient/osc/plugin.py
from vexxhost_clientcore import osc

API_NAME = "example"
API_VERSION_OPTION = "os_example_api_version"
API_VERSIONS = {"1": "exampleclient.v1.client.Client"}

_plugin = osc.Plugin(API_NAME, "Example", API_VERSIONS)
make_client = _plugin.make_client
build_option_parser = _plugin.build_option_parser

Depend on vexxhost-clientcore>=0.1,<0.2 and call the reusable workflows at a release tag. Name the client as docs/naming.md describes.

Development

python -m venv .venv
. .venv/bin/activate
pip install -e '.[test]' ruff
pytest
ruff check . && ruff format --check .

Changes here reach every client, so keep the API small and backwards compatible. To release, bump version in pyproject.toml and push a matching vX.Y.Z tag; the release workflow publishes it to PyPI.

Metadata

Release files for vexxhost-clientcore 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 vexxhost-clientcore 0.1.1
File Size Uploaded
vexxhost_clientcore-0.1.1.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vexxhost-clientcore 0.1.1
File Interpreter ABI Platform
vexxhost_clientcore-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / vexxhost_clientcore-0.1.1.tar.gz

Download URL vexxhost_clientcore-0.1.1.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0af4815c2e71ee1166092c8d7e9a912bb467b24b201d6461c9874a18812c162b
BLAKE2b-256 checksum
How to use checksums
38a6ff4cbc77c9f45f891d266997890e4a61dfddcc4a15fd2baf71cbea46d255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

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

Download URL vexxhost_clientcore-0.1.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0f4535e4ea3d67f8ee4c0bea74ca44269209e153f9da40bbd4b45c00b949dc3
BLAKE2b-256 checksum
How to use checksums
44c1d8efcd5cc2510c73320a98f51413136b8cb509d5e8edf81aec52b353074a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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