Skip to main content

Python client for the ditto ephemeral database copy service

Project description

ditto Python SDK

Python client for provisioning ephemeral database copies from a running ditto host.

Install

pip install "ditto-sdk[pytest]"

For development from a repository checkout:

pip install -e "./sdk/python[pytest]"

Usage

import os

from ditto import Client

client = Client(
    server_url="http://ditto.internal:8080",
    token=os.environ["DITTO_TOKEN"],
    ttl_seconds=600,
)

copy = client.create()
print(copy["connection_string"])
client.destroy(copy["id"])

Use the context manager for automatic cleanup:

from ditto import Client

client = Client(server_url="http://ditto.internal:8080")

with client.with_copy() as dsn:
    print(dsn)

Environment variables

Client reads these variables by default:

  • DITTO_SERVER_URL
  • DITTO_TOKEN (typically a bearer JWT in shared-host mode)
  • DITTO_TTL

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

ditto_sdk-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

ditto_sdk-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ditto_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d49a4acfeec1c1f2da5505d9b6ad552dcc9da511b16bedf3a350983b544bbcfe
MD5 f012df99de6dd8befdab9f1981d857c2
BLAKE2b-256 cc145c2c5255325ab77d32228d8b19782f06a4a15e6db7eb29fe6b115299193a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ditto_sdk-0.2.0.tar.gz:

Publisher: release-python-sdk.yml on attaradev/ditto

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

File details

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

File metadata

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

File hashes

Hashes for ditto_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1be5ec6c0d0d8c4b58ad624fdab966d5aebb0425edb47a36039dc262e01666ea
MD5 aef35073b84e1d132cd291a2a30d13ae
BLAKE2b-256 7c0aac0b2f47bcfed654a417c95d8131cf3eb301b5e2e742a0cc1eb39e0802af

See more details on using hashes here.

Provenance

The following attestation bundles were made for ditto_sdk-0.2.0-py3-none-any.whl:

Publisher: release-python-sdk.yml on attaradev/ditto

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