Skip to main content

Canonical Pydantic schemas for QueryTek Education Benefits Manager (EBM)

Project description

ebm-schemas

Canonical Pydantic models used across the QueryTek EBM services.

This package provides small, stable, and extensible Pydantic models used as the single source of truth for API contracts, worker payloads, and OpenAPI generation.

Included models (Phase‑0)

  • Person
  • Course
  • Milestone
  • Refund
  • Entitlement
  • Provider
  • Enrollment
  • Transaction
  • Organization
  • WebhookEvent
  • EntitlementAssignment

Purpose

  • Provide canonical, backwards-compatible shapes for payloads exchanged between services.
  • Make the OpenAPI spec authoritative by using the same models in the service code and the exporter.
  • Allow other services to import the models and validate provider payloads with a shared contract.

Extension rules & versioning

  • Backwards-compatible changes:
    • Add new optional fields freely.
    • Add new models in minor releases.
  • Breaking changes:
    • Avoid removing or renaming existing fields.
    • If you must break a model, introduce a new versioned model and bump the package major version.
  • Versioning policy:
    • The package follows semantic-style versioning for consumer consumption (0.x for early development). When stable, move to 1.0.0.

How to use locally

Install editable during development:

cd /path/to/repo
. services/ebm-api/venv/bin/activate
pip install -e libs/ebm_schemas

Import in code:

from ebm_schemas import Person, Provider, WebhookEvent

Building a wheel locally

Recommended: use the build module (PEP 517):

python -m pip install --upgrade build
cd libs/ebm_schemas
python -m build --wheel
# wheel will be in libs/ebm_schemas/dist/

Publishing

  • To create a git tag and GitHub release:
    • Tag: git tag -a v0.2.0 -m "ebm-schemas 0.2.0"
    • Push: git push origin v0.2.0
    • Create release and attach wheel (or let CI create release artifacts).
  • To publish to PyPI (if desired), use twine:
python -m pip install --upgrade twine
python -m twine upload dist/ebm_schemas-0.2.0-*.whl

(Only publish to PyPI if you want the package publicly available.)

Notes

  • The package depends on email-validator because models use pydantic.EmailStr.
  • The exporter script has been made robust to automatically import and inject these canonical schemas into the OpenAPI export used by the ebm-api service.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ebm_schemas-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file ebm_schemas-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ebm_schemas-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ebm_schemas-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99eeb912b30ae40957421dd4ecf5eaf24eab06c9307228248ff9b6587c4f041a
MD5 2aa4c6d2635af9924811c58d749a2e91
BLAKE2b-256 097778ff8e3c4ff8be9808c2c2435a4adf96eda2e88ba21c7a4f3e54759a050a

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