Skip to main content

A client library for accessing Open Spanner API

Project description

open-spanner

Python client for the Open Spanner API.

Install from PyPI:

pip install open-spanner

Record usage for a meter that already exists:

from datetime import UTC, datetime
from uuid import uuid4

from open_spanner_client import AuthenticatedClient
from open_spanner_client.api.usages import create_usage
from open_spanner_client.models.usage_create_request import UsageCreateRequest

api_key = "..."

client = AuthenticatedClient(
    base_url="https://api.example.com",
    token=api_key,
    raise_on_unexpected_status=True,
)

usage = create_usage.sync(
    client=client,
    body=UsageCreateRequest(
        idempotency_key=str(uuid4()),
        subject="org_123",
        meter="api_requests",
        quantity=1,
        timestamp=datetime.now(UTC).isoformat(),
    ),
)

print(usage.id)

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

open_spanner-0.1.5.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

open_spanner-0.1.5-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file open_spanner-0.1.5.tar.gz.

File metadata

  • Download URL: open_spanner-0.1.5.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for open_spanner-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c0e6855491ecd15d841c9dec8801590af55bda4f4317a50ced0ac6660eddb837
MD5 ab909995d21136b6f43d010131cd0874
BLAKE2b-256 2ffb150ddfcd39f0bd1c15a2bfbda3f0bf9ce67affad29dccd85d380d73b6a78

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_spanner-0.1.5.tar.gz:

Publisher: publish-python-sdk.yml on ssubedir/open-spanner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_spanner-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: open_spanner-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for open_spanner-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c2580e9f8e64bf81276a0ee65c97e1a6d7de9ad6a7a74256164625908e55aa49
MD5 52dd96058dbbecad7b53482af6ee24ea
BLAKE2b-256 0f953313cd1ec91e34c6cfabb2d8515a91e88c49047889ea5fc2bdeb83f88880

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_spanner-0.1.5-py3-none-any.whl:

Publisher: publish-python-sdk.yml on ssubedir/open-spanner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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