Skip to main content

VWP Python SDK — primitives for vibe-coded backends (rate limiting, auth, notifications, and more).

Project description

vwp-sdk

Python SDK for VWP — primitives for vibe-coded backends.

pip install vwp-sdk

Quickstart

import vwp

client = vwp.Client(api_key="vwp_test_...")  # or set VWP_API_KEY in env

result = client.rate_limit.check(
    key="login:user@example.com",
    limit=5,
    window="15m",
)
if not result.allowed:
    # Block this request — your handler returns 429 to the end user.
    print(f"Try again in {result.retry_after_seconds}s")

Or, async:

import asyncio
import vwp

async def main():
    async with vwp.AsyncClient(api_key="vwp_test_...") as client:
        result = await client.rate_limit.check(
            key="login:user@example.com", limit=5, window="15m",
        )
        print(result)

asyncio.run(main())

What's in this release (0.1.0a1)

  • vwp.rate_limit.check(...)SECURITY-RATE-LIMIT-001, fully wired against https://api.vibewithprimitiveai.com/v1.
  • vwp.Client / vwp.AsyncClient — explicit clients for connection reuse.
  • Typed errorsApiKeyError (401), BadRequestError (400), MetaRateLimitedError (429), ServerError (5xx), NetworkError (no response).

Other modules (vwp.auth, vwp.notify, vwp.data, vwp.queue) are present as stubs and will be implemented in Phase 2. Calling them raises NotImplementedError with a pointer to the docs.

Errors

Every error subclasses vwp.VWPError. Catch the base class to handle anything:

try:
    result = vwp.rate_limit.check(key="...", limit=5, window="15m")
except vwp.ApiKeyError as e:
    print("Bad API key:", e.request_id)
except vwp.BadRequestError as e:
    print("Bad input:", e.field, e.message)
except vwp.VWPError as e:
    print("Other VWP error:", e)

Compatibility

Python 3.9+. Production-tested on 3.12.

License

Apache-2.0.

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

vwp_sdk-0.1.0a1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

vwp_sdk-0.1.0a1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file vwp_sdk-0.1.0a1.tar.gz.

File metadata

  • Download URL: vwp_sdk-0.1.0a1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vwp_sdk-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 807723c2369178f9a2e0a43a0d45ec04e20b25bcd7f9fe32a92d797bcea6ba8a
MD5 fd18e31e44c5d937e0f52c22381ab7af
BLAKE2b-256 04784da889de9302ead0dbf644e09b7bec0eeacad14e84510886d0acf15bfa54

See more details on using hashes here.

File details

Details for the file vwp_sdk-0.1.0a1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for vwp_sdk-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c723e41ebe03976ca0b34c1ed4b029035b2b336c372e65ac79f40dae50cf54a8
MD5 71fd56c782ccf1e40ddf2a5620a9df42
BLAKE2b-256 bef9d3554e6d284f4bb0bab286ee72b6023c2c0525e7792e566a4fe7ac588ed9

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