Skip to main content

Async-first Python SDK and CLI for Rackspace Spot

Project description

rsspot

rsspot is a Python SDK and CLI for Rackspace Spot with unified sync/async ergonomics, sqlite-backed runtime state, and profile-based configuration.

Highlights

  • Unified client API:
    • SpotClient for sync + async access on one object
    • AsyncSpotClient for explicit async-only usage
  • Persistent sqlite state (state.db) for:
    • defaults/preferences
    • HTTP cache
    • redacted CLI command history
    • VM registration ledger entries
  • Config precedence + migration:
    • new default path: ~/.config/rsspot/config.yml
    • legacy ~/.spot_config auto-imported/migrated
  • Strong typing via pydantic models
  • Multi-profile workflows + global singleton helpers
  • OpenAPI sync/index scripts for upstream tracking

Install

uv sync

Quickstart (CLI)

uv run rsspot configure \
  --profile default \
  --org <org-name> \
  --region us-central-dfw-1 \
  --refresh-token "$SPOT_REFRESH_TOKEN"

uv run rsspot organizations list --output table

Quickstart (SDK)

Unified client

from rsspot import SpotClient

client = SpotClient(profile="default")
orgs = client.organizations.list()
print([org.name for org in orgs.organizations])
client.close()
import asyncio
from rsspot import SpotClient

async def main() -> None:
    client = SpotClient(profile="default")
    orgs = await client.aorganizations.list()
    print([org.name for org in orgs.organizations])
    await client.aclose()

asyncio.run(main())

Async-only client

import asyncio
from rsspot import AsyncSpotClient

async def main() -> None:
    async with AsyncSpotClient(profile="default") as client:
        regions = await client.regions.list()
        print([r.name for r in regions])

asyncio.run(main())

Configuration

Resolution precedence:

  1. Runtime config dict/model passed to client constructor
  2. Explicit config_path=...
  3. Env path (RSSPOT_CONFIG, RSSPOT_CONFIG_FILE, SPOT_CONFIG_FILE)
  4. Default search in ~/.config/rsspot/config.{yml,yaml,toml,json}
  5. Legacy fallback ~/.spot_config (auto-migrated)

VM Registration Workflow Primitives

rsspot includes registration state helpers for composing with external orchestrators (including separate omni-sdk scripts) without taking a direct dependency.

Core entrypoint:

  • rsspot.workflows.RegistrationWorkflow

OpenAPI Tracking

uv run python scripts/sync_openapi.py
uv run python scripts/generate_openapi_index.py

Development

uv run ruff check src tests
uv run mypy src
uv run pytest -q

Changelog

See CHANGELOG.md.

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

rsspot-0.2.0.tar.gz (82.8 kB view details)

Uploaded Source

Built Distribution

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

rsspot-0.2.0-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file rsspot-0.2.0.tar.gz.

File metadata

  • Download URL: rsspot-0.2.0.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rsspot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d4655a4f983bcd22fc0032fbb65d31430fff043a1012ef1705b09625e8321b77
MD5 d82b94031eef4cbecb1b273f8d7ff36f
BLAKE2b-256 63db8820cc6ba6e237bca7a5232a3ee6b4d9f64ac5cb5481a7290584dca5b9a7

See more details on using hashes here.

File details

Details for the file rsspot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rsspot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rsspot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b943130f455b29e059dde4ac8b4bf56780e35a5cb4900c9174848d6d26ad939
MD5 f92a3aff9c262be11611bd2df2ec8a53
BLAKE2b-256 dd338341788618426beb82a6e79b3c5a58dae97b4430f7d889dc198cb716e4f6

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