Skip to main content

dreamverse-core

Shared backend infrastructure for Dreamverse FastAPI services.

Install

The package is published to PyPI. Install it directly with the extras your service needs:

pip install dreamverse-core
pip install "dreamverse-core[supertokens,sentry,postgres]"

Tagged releases also attach the built wheel and source distribution to GitHub Releases for pinned or offline installs.

Quickstart

from fastapi import APIRouter
from dreamverse.app import MiddlewareConfig, create_app
from dreamverse.config import BaseAppSettings

settings = BaseAppSettings()
router = APIRouter()

@router.get("/hello")
async def hello() -> dict[str, str]:
    return {"message": "hello"}

app = create_app(
    title="Example API",
    version="1.0.0",
    settings=settings,
    routers=[router],
    middleware_config=MiddlewareConfig(),
)

What it provides

  • Config-driven settings with strict validation
  • Unified API envelope and exception hierarchy
  • Observability protocol/factory/manager stack
  • Security, rate-limit, correlation, and logging middleware
  • Provider-agnostic auth interfaces and dependencies
  • SuperTokens signup lifecycle hooks for project role validation and bindings
  • Database engine + session dependency helpers
  • Event envelope + idempotency utilities
  • Provider-neutral LLM interface for shared adapter contracts
  • Reusable LLM adapter conformance suite with recorded fixture replay
  • Shared LLM provider/model registry with packaged provider catalogs
  • OpenAI Chat Completions compatible LLM adapter
  • Audit-log sinks, explicit recording, replay, and FastAPI middleware
  • Feature-flag provider contracts, targeting context, and config-driven factories
  • Cached feature-flag fallback decorator with project-owned cache repositories
  • Event bus with subscribe decorators, retries, and transport overrides
  • Idempotency-key stores, FastAPI middleware, and dependency helpers
  • Notification provider contracts, templated sends, and delivery audit records
  • Email-template registry with project override hooks
  • Server-side analytics capture with PostHog and custom provider support
  • Payment provider contracts for Stripe, PayFast, in-memory tests, and project overrides
  • Background-job queues with retry, DLQ, audit, and event hooks
  • Search provider contracts for in-memory, Meilisearch, Typesense, and project overrides
  • Media upload, storage, processing, and serve-policy helpers for S3/R2-style storage
  • Image variant processing from a declared TOML profile, with focal crops and metadata stripping
  • App factory and testing helpers

Media processing profiles

Install the media-processing extra and declare, in one TOML file per project, the variants every uploaded image is processed into:

schema_version = 1

[profiles.card_image]
purposes = ["category", "cover"]
max_input_pixels = 40_000_000

[profiles.card_image.variants.card]
width = 1200
aspect = "1.91:1"
crop = "focal"
format = "jpeg"
quality = 85
channels = ["whatsapp"]

[profiles.card_image.variants.thumb]
width = 320
crop = "fit"
format = "webp"
quality = 80
channels = ["web"]
from pathlib import Path
from dreamverse.media.processing import Focal, load_profiles, process_image

profile = load_profiles(Path("config/media-processing.toml")).profiles["card_image"]
result = process_image(upload_bytes, profile=profile, focal=Focal(0.5, 0.4))

load_profiles raises MediaProfileError listing every violation by TOML path, including any variant whose format a listed channel does not accept. process_image does no I/O: it applies EXIF orientation, converts to sRGB, crops focal variants around the focal point, never upscales, and re-encodes each variant from pixel data only, so no EXIF, GPS, XMP or ICC metadata survives. Its errors (ImageDecodeError, ImageTooLargeError, VariantTooLargeError) are permanent for the given bytes.

Verification

python -m build
pytest tests/ -q

Release

dreamverse-core uses a two-workflow release flow:

  1. Run .github/workflows/release.yml from master with:
    • tag: vX.Y.Z
    • changelog: one bullet per line or a markdown bullet list
  2. The workflow updates pyproject.toml and CHANGELOG.md, verifies the package, commits the release, and pushes the tag.
  3. The tag triggers .github/workflows/publish.yml, which publishes to PyPI and updates the GitHub release with the built artifacts.

Metadata

Release files for dreamverse-core 1.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dreamverse-core 1.10.1
File Size Uploaded Provenance Actions
dreamverse_core-1.10.1.tar.gz 422.6 kB With provenance Details for dreamverse_core-1.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dreamverse-core 1.10.1
File Interpreter ABI Platform Actions
dreamverse_core-1.10.1-py3-none-any.whl Python 3 none any Details for dreamverse_core-1.10.1-py3-none-any.whl

Total release size: 728.7 kB

Release files / dreamverse_core-1.10.1.tar.gz

Download URL dreamverse_core-1.10.1.tar.gz
Size 422.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec37b8df987124786698b2506ed7e4be5e99af062deca3fef368befe6ea14ee
BLAKE2b-256 checksum
How to use checksums
30306834e896cfdd036e20d46d31cdda3af7be7cb711a7edf72840f2d0359048
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / dreamverse_core-1.10.1-py3-none-any.whl

Download URL dreamverse_core-1.10.1-py3-none-any.whl
Size 306.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6284d6a63dbd1c6ba511e1ca5d077ee014ad6c5a2398d44b3270a501cfab81ee
BLAKE2b-256 checksum
How to use checksums
4e2adbd1f28000b7f2862b25c4b2c003f641c5711ebf7a5e54bee0feebd2fca3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Security for dreamverse-core 1.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dreamverse_core-1.10.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.10.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page