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 againsthttps://api.vibewithprimitiveai.com/v1.vwp.Client/vwp.AsyncClient— explicit clients for connection reuse.- Typed errors —
ApiKeyError(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
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 vwp_sdk-0.2.0a1.tar.gz.
File metadata
- Download URL: vwp_sdk-0.2.0a1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dad364dce0607fe7f24c5ce8e445775d18781f9fa59e85433ebfce252643962e
|
|
| MD5 |
1bdcff17b552c7de0874666e4a04ab6c
|
|
| BLAKE2b-256 |
704f30c2d817d8d001a7f7b0f1a91853a4b779598bad748e87ec489b81578c19
|
File details
Details for the file vwp_sdk-0.2.0a1-py3-none-any.whl.
File metadata
- Download URL: vwp_sdk-0.2.0a1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0327352a82ce0af0400e9036413bc363038fddb4104a73ac7166cc03b883ce0
|
|
| MD5 |
3463e3e9b129278742370ee3a75bf50d
|
|
| BLAKE2b-256 |
758ff21cfb5b1fbe769478a5c0c83d5b3890cb960f6e49b919adaad365311a72
|