Skip to main content

noderings-python

ci live PyPI Python versions OpenSSF Scorecard License: Apache-2.0

The official Python SDK for the NodeRings API. It covers the whole public API: virtual machines, DNS, firewalls, snapshots and backups, game servers, IP address management, the marketplace, billing, access control, support tickets, and the provider side for hosts who sell on NodeRings. That is 485 operations in 69 services, all typed, with a sync and an asyncio client.

pip install noderings

Requires Python 3.10 or later. It depends on httpx and pydantic 2.

Quick start

from noderings import NodeRings
from noderings.models import Distro, DNSRecord, OperationStatus

client = NodeRings()  # reads NODERINGS_TOKEN

# Every virtual machine, page by page.
for vm in client.virtual_machine.list_virtual_machines_all():
    print(vm.hostname, vm.operation_status, vm.ipv4)

# Order a server and wait until it runs.
created = client.virtual_machine.create_virtual_machine(
    hostname="web-1",
    plan_id=plan_id,  # from client.marketplace.list_providers(...)
    region_id=region_id,
    distro=Distro.UBUNTU_26_04,
    ssh_key_ids=[ssh_key_id],
)
vm = client.wait_for_virtual_machine_status(created.virtual_machine.id, OperationStatus.STARTED)

# Give it a DNS name.
client.dns_record.upsert_dns_record(
    zone_id, record=DNSRecord(name="web-1", type="A", ttl=300, rdata=[vm.ipv4])
)

The same with asyncio:

from noderings import AsyncNodeRings

async with AsyncNodeRings() as client:
    async for vm in client.virtual_machine.list_virtual_machines_all():
        print(vm.hostname)

examples/quickstart.py is a complete program.

Authentication

Create a service account in the NodeRings console under Organization → Access Control → Service accounts, give it the permissions your program needs, and pass its token to the client, or set NODERINGS_TOKEN. Keep the token out of source code.

Argument Environment variable Use
token NODERINGS_TOKEN The service account token. Required.
organization_id NODERINGS_ORGANIZATION_ID Act in another organization the token can access (the X-Organization-ID header). By default the token's own organization is used.
base_url NODERINGS_BASE_URL Another API endpoint. The default is https://api.noderings.com.
timeout Seconds per request, or an httpx.Timeout. Default 60. Every method also takes timeout=.
max_retries, min_backoff, max_backoff Retry count and backoff in seconds (default 3, 0.5, 10).
user_agent Add your product to the User-Agent, for example "my-app/1.2".
http_client Your own httpx.Client (or httpx.AsyncClient) for proxies or custom TLS.

Use the client as a context manager, or call close(), to release its connections. The logger noderings writes one debug line per request; tokens and bodies are never logged.

A few user-account operations (sign-in, MFA, linked identities, the OAuth authorize step) only work with a signed-in user's session, not with a service account token.

Services

Every area of the API is an attribute of the client, and every method is one API operation, named as in the API description in snake_case.

Area Attributes
Compute virtual_machine (create, start, stop, restart, reinstall, delete, tags, firewall, backups, extra IPs, console), snapshot, backup, vm_template, cloud_init_user_data, cloud_init_template, instant_app, metadata (distro catalog)
Game servers game_server (lifecycle, files, databases, backups, schedules, allocations), game_server_template
DNS dns_zone, dns_record, dnssec, domain
Network firewall (rulesets, rules, address groups), ipam
Marketplace marketplace (regions, plan codes, offers, plans), region, plan, client_provider_review
Billing subscription, addon, invoice, payment, payment_method, refund, credit, coupon, usage_report, exchange_rate
Organization and access organization, user, service_account, group, role, permission, invite, secret, environment_variable, oauth2
Monitoring monitoring, business_monitoring, metric, metrics_credential, client_dashboard
Support ticket, chat, roadmap
Providers (hosts selling on NodeRings) provider_plan, provider_storefront, provider_customer, provider_dashboard, provider_dashboard_plans_tab, provider_review, provider_network, provider_connect, provider_onboarding, provider_ticket_notification, payout_configuration, payout_invoice, manual_payout, live_validation, preflight, platform, node, node_placement, agent, hook_script

For an operation the SDK does not have yet, client.request("GET", "/v1/...", query=..., body=...) sends a request with the same authentication, retries and error handling and returns the JSON.

How it works

Arguments. Path parameters are positional; query parameters and the fields of the request body are keyword arguments, so your editor completes them. Only arguments you pass are sent, so False and 0 are sent and None is not. Nested objects can be models or plain dicts (with snake_case or camelCase keys). extra_body= and extra_query= add fields the SDK does not know yet.

Models. Every response is a pydantic model in noderings.models (also importable from noderings), with snake_case attributes and the API's camelCase names as aliases. Missing fields have their zero value ("", 0, False, []), as in the API's own JSON; nested objects, timestamps and enums are None when missing. 64-bit numbers, which the API sends as strings, are int; timestamps are datetime. model.to_dict() gives the API's JSON back.

Forward compatible. Enums are str subclasses (OperationStatus.STARTED == "OPERATION_STATUS_STARTED"), and a value this SDK version does not know is kept as a string instead of failing. Fields the API adds later are kept in model.model_extra.

Paging. List operations that take page and page_size have an ..._all variant that yields every result (an async iterator on AsyncNodeRings). It reads 100 rows per page and stops when you stop iterating.

Errors. API errors raise noderings.APIError subclasses by HTTP status: BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, RateLimitError, QuotaExceededError (a plan limit such as the number of servers, with .reason like VM_LIMIT_REACHED) and InternalServerError. Each has .status_code, .code (the API's status code), .message, .details and .is_busy (another operation on the resource is still running; try again later). Network failures raise APIConnectionError and APITimeoutError.

Retries. A request is retried when the API rate-limits it (HTTP 429, unless a plan quota is used up, honoring Retry-After), and on connection errors and HTTP 502, 503 and 504 when it is safe to repeat: reads, PUT, DELETE, and creates that carry an idempotency key.

Idempotency. Creates that take an idempotency key (virtual machines, game servers) get a new UUID automatically, so a retry never orders a second server. Pass idempotency_key= yourself to retry a create safely after your program restarts.

Waiting. wait_for_virtual_machine_status, wait_for_virtual_machine_deleted and the general wait_for_virtual_machine(id, until=...) poll until a condition holds, with interval and timeout in seconds. They raise WaitTimeoutError with the last state read.

Testing

Suite What it checks
pytest Calls every one of the 485 generated methods, sync and async, against a fake API and checks the HTTP method, the path and its escaping, every query parameter's name, every body field's name and the auth headers against the API description. Also covers retries, Retry-After, errors, idempotency keys, paging, waiting, nulls, unknown enum values, and 64-bit and bytes encoding.
pytest -m live Against the real API: every read that needs no ID, checked for fields the description lacks; SSH keys, a DNS zone with records, firewall rulesets and rules, and cloud-init data created and deleted; async reads. With NODERINGS_TEST_BILLED=1, a virtual machine is created, started, stopped, started, restarted, tagged, snapshotted, given a firewall and deleted.

The live suite runs nightly in CI. See CONTRIBUTING.md.

Versioning

The SDK is generated from api/openapi.json by tools/generate.py. A weekly job fetches the published description and opens a pull request when it changed. Releases follow semantic versioning; while the version is 0.x, a minor release can rename a field when the API itself renames it, and CHANGELOG.md says so. RELEASING.md describes how a release is published.

Not included: the payment-provider webhook endpoint (it receives calls, it does not make them) and NodeRings staff-only enforcement endpoints.

Go SDK · Terraform provider · Pulumi · Ansible · Apache Libcloud driver · Salt extension

License

Apache 2.0

Metadata

Release files for noderings 0.1.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 noderings 0.1.0
File Size Uploaded Provenance Actions
noderings-0.1.0.tar.gz 293.4 kB With provenance Details for noderings-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for noderings 0.1.0
File Interpreter ABI Platform Actions
noderings-0.1.0-py3-none-any.whl Python 3 none any Details for noderings-0.1.0-py3-none-any.whl

Total release size: 484.8 kB

Release files / noderings-0.1.0.tar.gz

Download URL noderings-0.1.0.tar.gz
Size 293.4 kB
Tags Source
SHA-256 checksum
How to use checksums
37c6a02d4d2f9080626113211b3f61c24cc90d76c4a1f3ec3bc69c767383ccab
BLAKE2b-256 checksum
How to use checksums
336c5ee6296188ebce0be88e8a245d25d94cd88589fe251ad8a209b460f69c75
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 29, 2026.

Transparency log

Release files / noderings-0.1.0-py3-none-any.whl

Download URL noderings-0.1.0-py3-none-any.whl
Size 191.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c53e8083e661e796762606b88a2d09fe52ae2f0489717afcfa81da594d05e70
BLAKE2b-256 checksum
How to use checksums
a232404c1d98481315571d76aaa639e9cb39a00e5d89f8e816aed516b9f329ec
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 29, 2026.

Transparency log

Security for noderings 0.1.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 noderings-0.1.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 29, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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