Skip to main content

Python SDK for the Deployzy deploy & tunnel platform

Project description

deployzy

Official Python SDK for Deployzy — deploy & tunnel platform.

Install

pip install deployzy

Quick Start

import asyncio
from deployzy import Deployzy

async def main():
    async with Deployzy(authtoken="sm_live_...") as client:
        # List active tunnels
        tunnels = await client.tunnels.list()
        print(tunnels)

        # Get captured requests
        requests = await client.inspect.list(tunnels[0].url)
        for req in requests:
            print(f"{req.method} {req.path} -> {req.status_code} ({req.duration_ms}ms)")

asyncio.run(main())

Live Traffic Streaming

async with Deployzy(authtoken="sm_live_...") as client:
    async for req in client.inspect.subscribe("https://abc123.deployzy.com"):
        print(f"{req.method} {req.path} -> {req.status_code}")

API Keys

async with Deployzy(authtoken="sm_live_...") as client:
    # List keys
    keys = await client.api_keys.list()

    # Create a new key
    full_token, info = await client.api_keys.create("my-app")
    print(full_token)  # sm_live_... (save this!)

    # Delete a key
    await client.api_keys.delete(info.id)

Custom Domains

async with Deployzy(authtoken="sm_live_...") as client:
    # Add a domain
    domain, instructions = await client.domains.create("api.example.com")
    print(f"Add CNAME: {instructions['name']} -> {instructions['target']}")

    # Verify DNS
    result = await client.domains.verify(domain.id)
    print(result)

    # List domains
    domains = await client.domains.list()

Error Handling

from deployzy import Deployzy, AuthError, RateLimitError, ApiError

try:
    async with Deployzy(authtoken="invalid") as client:
        await client.tunnels.list()
except AuthError:
    print("Bad token")
except RateLimitError as e:
    print(f"Rate limited, retry in {e.retry_after}s")
except ApiError as e:
    print(f"API error {e.status_code}: {e}")

Self-Hosted

client = Deployzy(
    authtoken="sm_live_...",
    server_url="https://tunnel.mycompany.com",
)

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

deployzy-1.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

deployzy-1.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file deployzy-1.1.0.tar.gz.

File metadata

  • Download URL: deployzy-1.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for deployzy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7d7cd18647339b0655d4efed226e1553327b51169e2ad07df901da9b2073adba
MD5 36e9241b4bffca59420bf1aba0a26a99
BLAKE2b-256 c72f04e067de0eccff1c97e941e76fc9bbb15c7c1023e9b846c8f44a83e9f83f

See more details on using hashes here.

File details

Details for the file deployzy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: deployzy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for deployzy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 322e6efb0163a98c34894b7533f78a07f477b22531b46e7e3a5e647eba29b99b
MD5 dabd952881b273b3750ebde8e581710f
BLAKE2b-256 14e11e9ecf8c6bed1d1a7e3a9e4f64faadfd7f1eb07dcea8b7f3122e0718e8f4

See more details on using hashes here.

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