Skip to main content

Dev2Cloud client library

Project description

dev2cloud

Python client for the Dev2Cloud API — spin up ephemeral Postgres and Redis sandboxes in seconds.

Installation

pip install dev2cloud

Quick Start

Sign up at dev2.cloud and grab your API key from the dashboard.

Create a Postgres sandbox

from dev2cloud import Dev2Cloud, SandboxType

client = Dev2Cloud(api_key="your-api-key")

sandbox = client.create_sandbox(SandboxType.POSTGRES)

print(sandbox.url)
# postgresql://user:pass@connect.dev2.cloud:5432/postgres

Create a Redis sandbox

sandbox = client.create_sandbox(SandboxType.REDIS)

print(sandbox.url)
# redis://user:pass@connect.dev2.cloud:6379/0

Manage sandboxes

# List all active sandboxes
sandboxes = client.list_sandboxes()

# Get a sandbox by ID
sandbox = client.get_sandbox("sandbox-id")

# Delete a sandbox
client.delete_sandbox("sandbox-id")

# Delete all sandboxes
deleted_ids = client.delete_all()

Async support

from dev2cloud.asyncio import Dev2Cloud
from dev2cloud import SandboxType

client = Dev2Cloud(api_key="d2c_...")

sandbox = await client.create_sandbox(SandboxType.POSTGRES)
print(sandbox.url)

Configuration

The API key can be provided directly or through the D2C_API_KEY environment variable:

export D2C_API_KEY="d2c_..."
from dev2cloud import Dev2Cloud

client = Dev2Cloud()  # reads from D2C_API_KEY

References

License

MIT

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

dev2cloud-0.3.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

dev2cloud-0.3.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file dev2cloud-0.3.1.tar.gz.

File metadata

  • Download URL: dev2cloud-0.3.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dev2cloud-0.3.1.tar.gz
Algorithm Hash digest
SHA256 05a6589b0b6600d977e9684aa1ff143efb02231e5275f979ee8a8d19ce60b24a
MD5 8bc8ec594e9e716fd53a5ec402c968f2
BLAKE2b-256 2a3076257bdb0df494e5c33275d697f789604cdfd75f3e205e01990ff3cc8984

See more details on using hashes here.

Provenance

The following attestation bundles were made for dev2cloud-0.3.1.tar.gz:

Publisher: python-publish.yml on d2c-app/dev2cloud

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

File details

Details for the file dev2cloud-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dev2cloud-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dev2cloud-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f32c1d66243deff8d6928dc2592676bb70f8985e4044e4f5269734eb283c2ede
MD5 0c04ee5ee795bf930500d2e19accb6bc
BLAKE2b-256 39fec10ae6384b2fb0eaf83b4334774215b36370b3b9dc9a896be6f8d9649e2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dev2cloud-0.3.1-py3-none-any.whl:

Publisher: python-publish.yml on d2c-app/dev2cloud

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