Skip to main content

fastsprout-core

PyPI version Python versions License: Apache 2.0 Downloads Typed CI

Core contracts for the FastSprout framework.

Foundation package — base protocols, types, exceptions and the typed-field layer that every other fastsprout-* package builds on. No dependencies on other framework packages.

Install

pip install fastsprout-core

Quick look

from fastsprout_core.schema import BaseSchema
from fastsprout_core.fields import Field


class Hero(BaseSchema):
    id: Field[int]
    name: Field[str]


hero = Hero(id=1, name="SuperMan")
hero.name                    # "SuperMan"   (str)
Hero.name                    # <Hero.name>  (FieldRef[Hero, str, None])
Hero.name.set("Spider")      # FieldAssignment(name='name', value='Spider')

See examples/ for one runnable file per feature.

What's inside

  • Action protocolsBaseAction, BaseSequenceAction, BaseIterableAction, BaseIteratorAction (+ trigger variants), BaseActionGroup. One protocol per return shape: single value, Sequence[O], Iterable[O], AsyncIterator[O].
  • SchemaBaseSchema with snake↔camel aliasing, declares fields as Field[T].
  • Typed fieldsField[T], FieldRef[E, T, OrmCtor], FieldAssignment[T], HasOrm[OrmCtor].
  • Decorators@typed_fields, @typed_dataclass, @typed_pydantic_dataclass, TypedModelMeta.
  • Identifiers, errors, DIIDType (UUID v7), FastSproutError, Depends.
  • mypy plugin — refines FieldRef.orm to OrmCtor[T]. Enable with plugins = ["fastsprout_core.mypy_plugin"] in [tool.mypy].

Python

3.12, 3.13, 3.14. CI runs the full pipeline on each, including PEP 749 lazy-annotation paths.

See CHANGELOG.md for what's in each version.

Links

License

Apache License 2.0 — see LICENSE

Download files

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

Source Distribution

fastsprout_core-1.2.1.tar.gz (93.5 kB view details)

Uploaded Source

Built Distribution

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

fastsprout_core-1.2.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file fastsprout_core-1.2.1.tar.gz.

File metadata

  • Download URL: fastsprout_core-1.2.1.tar.gz
  • Upload date:
  • Size: 93.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for fastsprout_core-1.2.1.tar.gz
Algorithm Hash digest
SHA256 1bce6e5c3302ad72c733bb5fab0f0bb7c22402dc71ea79cdc7be07473314cf15
MD5 c749afdc6072344c02fdb8c4523646de
BLAKE2b-256 68efc88d4b86f2c308eb923ceb4d0c748ef79949b78d6ff0de522e3b589c64ea

See more details on using hashes here.

File details

Details for the file fastsprout_core-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastsprout_core-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27b51abc0b905272ecdd5de72a8e737b11ebd52b1265286ea40d62076a6b0d6a
MD5 0c74ad1859d764860e0aa0f28032f6d8
BLAKE2b-256 0d709634650e8a73566ab84f4535c856156b72f6dcf15424e187fde2f96db2d6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

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