praxicraft-shared
Stateless Python utilities shared by Praxicraft backends (Practice, auth, notifications, billing, and future services). Products pin a PyPI version; no Django ORM, settings, or product business logic lives here.
Planning & milestones: Gamified-Application/docs/praxicraft-shared/README.md
Prerequisites
- Python 3.11+
Install (in a product)
Published on PyPI:
praxicraft-shared==0.7.2
pip install praxicraft-shared==0.7.2
Docker / CI need no GitHub token for this package — 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
Release
- Bump
versioninpyproject.tomland__version__insrc/praxicraft_shared/__init__.py. - Merge to
main, tagvX.Y.Z, push the tag (or run Publish → workflow_dispatch with that tag). - GitHub Actions publishes to PyPI via Trusted Publishing and creates a GitHub Release.
What’s in the package
| Module | Role |
|---|---|
jwt_utils |
Validate RS256 access JWTs (JWKS / PEM) |
auth_client |
HTTP client for praxicraft-auth (token exchange, me, …) |
org_client |
HTTP client for the auth organisation directory (org, membership, role, teams) |
billing_client |
HTTP client for praxicraft-billing (entitlements, checkout, cancel/resume) |
s3_client |
Injectable MinIO/S3 helpers (make_s3_client, put/get/presign, prefix download) |
notifications_client |
HTTP client for praxicraft-notifications (send, events, prefs, push, inbox) |
service_token |
Parse product:token / JSON service-token maps (no DRF) |
ai_service |
Thin client for praxicraft-llm (gateway + circuit-breaker fallback) |
error_envelope |
Standard success/error dict shapes |
events |
Event envelope helpers + events/SCHEMA.md |
email/ |
Shared HTML/text email templates (rendered by notifications) |
secret_crypto |
Fernet encrypt/decrypt (inject key) |
work_email |
Email normalize / consumer-domain helpers |
hibp |
Have I Been Pwned password check |
org_client ships ahead of the auth A7 cutover: directory reads hit /api/v1/internal/orgs/…, and list helpers return [] while an endpoint is not deployed yet, so products can pin 0.7.0 before auth exposes the API.
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
Related
Release files for praxicraft-shared 0.7.2
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.7.2.tar.gz | 65.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| praxicraft_shared-0.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 188.9 kB