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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05a6589b0b6600d977e9684aa1ff143efb02231e5275f979ee8a8d19ce60b24a
|
|
| MD5 |
8bc8ec594e9e716fd53a5ec402c968f2
|
|
| BLAKE2b-256 |
2a3076257bdb0df494e5c33275d697f789604cdfd75f3e205e01990ff3cc8984
|
Provenance
The following attestation bundles were made for dev2cloud-0.3.1.tar.gz:
Publisher:
python-publish.yml on d2c-app/dev2cloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dev2cloud-0.3.1.tar.gz -
Subject digest:
05a6589b0b6600d977e9684aa1ff143efb02231e5275f979ee8a8d19ce60b24a - Sigstore transparency entry: 977008518
- Sigstore integration time:
-
Permalink:
d2c-app/dev2cloud@b25ba898274f9007b28e7e847354e513228f5e75 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/d2c-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b25ba898274f9007b28e7e847354e513228f5e75 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32c1d66243deff8d6928dc2592676bb70f8985e4044e4f5269734eb283c2ede
|
|
| MD5 |
0c04ee5ee795bf930500d2e19accb6bc
|
|
| BLAKE2b-256 |
39fec10ae6384b2fb0eaf83b4334774215b36370b3b9dc9a896be6f8d9649e2b
|
Provenance
The following attestation bundles were made for dev2cloud-0.3.1-py3-none-any.whl:
Publisher:
python-publish.yml on d2c-app/dev2cloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dev2cloud-0.3.1-py3-none-any.whl -
Subject digest:
f32c1d66243deff8d6928dc2592676bb70f8985e4044e4f5269734eb283c2ede - Sigstore transparency entry: 977008543
- Sigstore integration time:
-
Permalink:
d2c-app/dev2cloud@b25ba898274f9007b28e7e847354e513228f5e75 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/d2c-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b25ba898274f9007b28e7e847354e513228f5e75 -
Trigger Event:
release
-
Statement type: