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.0.tar.gz (93.4 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.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastsprout_core-1.2.0.tar.gz
  • Upload date:
  • Size: 93.4 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.0.tar.gz
Algorithm Hash digest
SHA256 5c276479987c94abe0c96859ffe31ff10a62520e2d6ba639bfe2daf79234358b
MD5 c6b06c5b7605cc6502f385d04d2915ef
BLAKE2b-256 1273c2e6aadb59a60e9f4cd98f121e4bcf5268b2fb3089261989d672b699e024

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsprout_core-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1676b7b1c9e9eeca6b0e4ce2bc2973bacbf679492f97d0fefa978e1e8dae7a
MD5 b66efeb8b040649abb7f3c95534b45a2
BLAKE2b-256 1e8180112e17b9342bd24fc03aa913bc7af40b7eee12dd4254268249bf9ff1ce

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.1

2 files

This release

1.2.0 This release

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