Skip to main content

aioscaleway

Asynchronous, fully typed Python client for every Scaleway API, built on httpx2, pydantic and whenever.

Documentation: https://aioscaleway.businessagile.eu

from aioscaleway import Scaleway

async with Scaleway() as scw:  # SCW_* from the environment
    server = await scw.compute.servers(server_id)  # load
    print(server.name, server.state)
    await server.reboot()

    async for server in scw.compute.servers.filter(name="web"):
        await server.power_off()

    async for line in scw.billing.consumptions.filter(billing_period="2026-10"):
        print(line.sku, line.value.to_decimal() if line.value else 0)

Why it exists

The official SDK, scaleway and scaleway-async, sends its requests through requests: the async def methods of scaleway-async block the event loop while they wait. It also mirrors the API's own layout, one class per product and version (InstanceV1API, BillingV2Beta1API) with flat methods.

aioscaleway is asynchronous down to the socket and organised around what you manipulate rather than where Scaleway files it:

  • business areas shared with its sibling aioovh: compute, storage, network, kubernetes, databases, billing...;
  • collections you iterate with async for, narrowed with filter(), every page read for you;
  • references (scw.compute.servers(server_id)) that act without a request to read them first, and that await loads;
  • objects that are references too, with typed fields;
  • one method per action: server.reboot(), server.power_off(), server.attach_volume(volume_id=volume);
  • no API version in any name: the library picks the latest stable version of each API, else the latest preview, and says so in the docstring.

Everything is generated from the OpenAPI files Scaleway publishes, committed in specs/: 59 API versions and about 1,500 operations. Every operation is reachable, either through the objects or through scw.raw, and docs/coverage.md says where.

Installation

uv add aioscaleway

Python 3.12 or later.

Usage

Client

scw = Scaleway(
    secret_key="...",
    default_region="fr-par",
    default_zone="fr-par-1",
    default_project_id="...",
)
nl = scw.with_options(default_zone="nl-ams-1")  # same connections, other defaults

Every value left out is read from the variables of the Scaleway CLI (SCW_SECRET_KEY, SCW_DEFAULT_REGION, SCW_DEFAULT_ZONE, SCW_DEFAULT_PROJECT_ID, SCW_DEFAULT_ORGANIZATION_ID, SCW_API_URL). Use it as an async context manager, or call await scw.aclose().

Collections, references, objects

You write You get Requests
scw.compute.servers a collection none
scw.compute.servers.filter(name="web") the same collection, narrowed none
async for s in scw.compute.servers loaded objects one per page
scw.compute.servers(server_id) a reference none
await scw.compute.servers(server_id) a loaded object one
await scw.compute.servers(server_id).reboot() the action's result one
await scw.compute.servers.create(name=..., commercial_type=...) the created object one

pages() yields each page response instead, for the totals and sums an item does not carry (page.total_discount_untaxed_value of the billing consumptions).

A loaded object is also a reference: anything that takes a reference takes an object. It cannot load itself when printed or read, because those are synchronous; mypy flags a field read on a bare reference. repr() tells which one you hold.

Sub-resources hang off their parent:

async for pool in scw.kubernetes.clusters(cluster_id).pools:
    print(pool.name, pool.size)
async for nic in scw.compute.servers(server_id).nics:
    ...

A resource with a zone or a region takes it as a keyword (scw.compute.servers(server_id, zone="nl-ams-1"), servers.filter(zone="nl-ams-1")), defaulting to the client's.

Types

Arguments and fields are typed. Enumerations and nested models of an area live in its types module:

from aioscaleway.compute.types import ServerState, BootType

Dates are whenever.Instant, amounts Money (.to_decimal()). Enumerations are open: a value Scaleway adds later is accepted instead of failing the response.

Errors

from aioscaleway import ResourceNotFoundError, ScalewayAPIError

try:
    await scw.compute.servers(server_id)
except ResourceNotFoundError:
    ...
except ScalewayAPIError as error:
    print(error.status_code, error.type, error.message)

ScalewayTransportError reports a request that got no answer. Throttling and transient failures are retried with stamina, honouring Retry-After; a POST is only retried when Scaleway cannot have processed it.

The raw layer

scw.raw is the underlying client, for a call the objects do not cover:

await scw.raw.request_json("GET", "/instance/v1/zones/fr-par-1/dashboard")

Development

See CONTRIBUTING.md and docs/architecture.md. The full object tree is in docs/objects.md.

The source lives on GitLab, mirrored to GitHub, where issues and pull requests are welcome.

Author

Created by Alexandre BERREBI, maintained by Business Agile.

License

MIT, see LICENSE.

Metadata

Release files for aioscaleway 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 aioscaleway 0.1.0
File Size Uploaded Provenance Actions
aioscaleway-0.1.0.tar.gz 750.0 kB Without provenance Details for aioscaleway-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / aioscaleway-0.1.0.tar.gz

Download URL aioscaleway-0.1.0.tar.gz
Size 750.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90fc0db388a98570757e45a2e03cdbce588e67422a97b54b1cbe70ad1855d609
BLAKE2b-256 checksum
How to use checksums
2b5d6cb7f4738227da73848f3af1faad93404f0900d957d29d4527bef09ebcb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL aioscaleway-0.1.0-py3-none-any.whl
Size 791.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
458eb71d4a52b3202e9519563ef625c7746b36807f23a113733af5e13692cf87
BLAKE2b-256 checksum
How to use checksums
f799b0005e1f7f23ad227413304914c101e569c28b6904bb669e39b19f3c1dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for aioscaleway 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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 No 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