Metadata-Version: 2.4
Name: keyvane
Version: 0.1.0
Summary: Python SDK for Keyvane: license keys, plans, feature access and usage limits, synced with Stripe.
License: MIT
Project-URL: Homepage, https://github.com/Ravenium22/Keyvane
Project-URL: Documentation, https://github.com/Ravenium22/Keyvane/blob/main/docs/python.md
Project-URL: Source, https://github.com/Ravenium22/Keyvane/tree/main/packages/python
Project-URL: Issues, https://github.com/Ravenium22/Keyvane/issues
Keywords: licensing,license-keys,entitlements,usage-limits,stripe,saas
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# keyvane (Python)

Python SDK for [Keyvane](https://github.com/Ravenium22/Keyvane): license keys, plans, feature access and usage limits for software you sell, kept in sync with Stripe. Standard library only; Python 3.9+.

```bash
pip install keyvane
```

```python
from keyvane import Keyvane

kv = Keyvane()  # KEYVANE_URL and KEYVANE_SECRET_KEY from the environment

kv.customers.upsert(external_id=user.id, email=user.email)

access = kv.entitlements.get(customer=user.id)
if not access.can("export"):
    raise PermissionError("Export is on the Pro plan")

usage = kv.usage.record(customer=user.id, feature="ai_requests", idempotency_key=request_id)
if not usage["allowed"]:
    return {"error": usage["message"]}, 402
```

Full documentation: [docs/python.md](https://github.com/Ravenium22/Keyvane/blob/main/docs/python.md). MIT licensed.
