praxicraft-shared
Stateless Python utilities shared by Praxicraft backends (Practice, auth, notifications, billing, support, Tutor, LLM clients). Products pin a PyPI version. No Django ORM, settings, or product business logic lives here.
| PyPI | https://pypi.org/project/praxicraft-shared/ |
| Current version | 0.8.1 (see pyproject.toml) |
| Python | 3.11+ |
Contents
- About
- Install in a product
- Local development
- What’s in the package
- Release
- Docs and deeper integrations
About
Hard rules:
- Stateless — no Django models, ORM, Celery, or package-owned Redis singletons
- No
django.conf.settings— callers inject URLs and keys - No product logic (XP, Assess scoring, Tutor mastery)
- Semver via git tags + PyPI — breaking JWT/auth contracts = major bump
Planning history: Practice shared docs.
Install in a product
Published on PyPI:
pip install praxicraft-shared==0.8.1
Docker / CI need no GitHub token — public index only.
Local editable (sibling checkout):
pip install -e ~/Desktop/praxicraft-shared
Local development
cd ~/Desktop/praxicraft-shared
pip install -e ".[dev]"
ruff check src tests
pytest
What’s in the package
| Module | Role |
|---|---|
jwt_utils |
Validate RS256 access JWTs (JWKS / PEM) |
auth_client |
HTTP client for praxicraft-auth |
org_client |
Auth organisation directory |
billing_client |
Entitlements, checkout, cancel/resume |
notifications_client |
Send, events, prefs, push, inbox |
support_client |
Support tickets API |
ai_service |
Thin client for praxicraft-llm (chat, streaming, tools, get_speech_audio) |
s3_client |
Injectable MinIO/S3 helpers |
service_token |
Parse product:token / JSON maps |
error_envelope |
Standard success/error shapes |
events |
Event envelope helpers |
email/ |
Shared HTML/text email templates (rendered by notifications) |
secret_crypto |
Fernet encrypt/decrypt (inject key) |
work_email / hibp |
Email helpers / HIBP check |
Release
- Bump
versioninpyproject.tomland__version__insrc/praxicraft_shared/__init__.py. - Merge to
main. - Tag
vX.Y.Zand push the tag (triggers Publish), or Actions → Publish → Run workflow with that existing tag. - GitHub Actions publishes to PyPI via Trusted Publishing and creates a GitHub Release.
Pushing main alone runs CI only — it does not publish to PyPI until a v* tag exists.
Docs and deeper integrations
| Link | Topic |
|---|---|
| notifications PRODUCT-INTEGRATION | How products call notifications_client |
| support PRODUCT-INTEGRATION | How products call support_client |
| auth README | Application registry + JWT |
| billing README | Entitlements client |
| Tutor README | End-to-end product wiring |
| praxicraft-llm | Gateway tokens for ai_service |
Release files for praxicraft-shared 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| praxicraft_shared-0.8.1.tar.gz | 70.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| praxicraft_shared-0.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 198.2 kB