Skip to content

Releases: feldroy/AirField

AirField 0.5.1

20 Mar 07:29
v0.5.1
5283498

Choose a tag to compare

AirField 0.5.1: Agent-tested documentation

AirField ships with AGENTS.md, a guide purpose-built for AI coding assistants. An agent read only this file and produced working models with every presentation type, validating that the documentation is complete enough to code from. The examples/admin_panel.py it generated is included as a realistic reference.

uv add -U AirField

What's new

  • AGENTS.md for AI coding assistants. Covers both declaration paths, every presentation type with field signatures, the parameter reference, metadata discovery, and how to combine Annotated[] with AirField() on the same field.

  • examples/admin_panel.py. Product and UserProfile models that exercise every presentation type together: context-aware visibility, priority sorting, grouped fields, and a render_table_headers() metadata consumer. Generated by an AI agent reading only AGENTS.md.

What's better

  • Docs updated for 0.5.0 features. README and usage guide now cover CsrfToken and the choices-implies-select default.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release.

AirField 0.5.0

19 Mar 13:43
v0.5.0
f052a17

Choose a tag to compare

AirField 0.5.0: CSRF tokens and smarter defaults

AirField's typed metadata system now covers security. CSRF protection tokens, hidden inputs, signature verification, all expressible as a single CsrfToken() marker on your model field, right alongside labels, widgets, and layout hints. And choices fields just got less verbose: pass choices and AirField picks the select widget for you.

uv pip install --upgrade airfield

What's new

  • CsrfToken presentation type. Mark a field as a CSRF protection token and let your form renderer handle the rest: hidden input, signed value, signature verification before processing. Security metadata lives in the same typed system as everything else.

    csrf: str = AirField(CsrfToken())

What's better

  • Choices fields default to a select widget. When you pass choices to AirField(), it automatically attaches Widget(kind="select"). No more spelling out what was already obvious. If you need a different widget, pass widget or type explicitly and the default steps aside.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release.

AirField 0.4.0

18 Mar 16:08
v0.4.0
f7662d0

Choose a tag to compare

AirField 0.4.0: All metadata is typed, all of it

Every AirField() parameter now produces a typed, frozen dataclass in field_info.metadata. primary_key, autofocus, label, widget, type, placeholder, help_text, choices are all discoverable with isinstance checks, the same way Pydantic discovers annotated-types constraints. json_schema_extra is no longer written by AirField.

pip install --upgrade AirField

What's new

  • PrimaryKey type. Primary key fields affect presentation across every context: hidden in create forms, read-only in edit, displayed as links in tables. PrimaryKey is now a first-class BasePresentation type that consumers find with isinstance(m, PrimaryKey).

  • Autofocus type. A renderer-agnostic focus hint. In a form it sets the autofocus attribute; in a CLI it's the first prompted field; in a TUI it receives initial widget focus.

What's changed

  • AirField no longer writes to json_schema_extra. All presentation metadata lives in field_info.metadata as typed objects. Consumers that were reading json_schema_extra for label, widget, autofocus, or primary_key need to switch to isinstance checks on field_info.metadata. If you pass json_schema_extra explicitly, it still flows through to Pydantic as a standard Field parameter.

  • Unknown kwargs go straight to Pydantic. AirField no longer sorts kwargs into "Pydantic-known" and "extra" buckets. Everything AirField doesn't recognize passes directly to pydantic.Field(). Pydantic v2 issues a deprecation warning for unrecognized kwargs; Pydantic v3 will raise. The _PYDANTIC_FIELD_PARAMS frozenset that had to track every Pydantic release is gone.

  • The type="email" encoding bug is fixed. Previously, AirField(type="email") stored {"email": True} in json_schema_extra. Now it produces Widget(kind="email") in metadata, which is what consumers actually need.

  • Both declaration paths converge. AirField(type="email", label="Email") and Annotated[str, Widget("email"), Label("Email")] produce identical metadata. One isinstance loop finds everything regardless of how the field was declared.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release: the typed metadata architecture, PrimaryKey and Autofocus types, and the elimination of json_schema_extra.

AirField 0.3.1

18 Mar 14:15
v0.3.1
d581315

Choose a tag to compare

AirField 0.3.1: Custom metadata just works

Pass any keyword argument to AirField() and it lands in json_schema_extra automatically. Known Pydantic parameters like alias and gt are forwarded to pydantic.Field; everything else becomes metadata. AirField(sortable=True, export_header="Name") does what you'd expect.

uv add AirField>=0.3.1

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release.

AirField 0.3.0

18 Mar 13:58
v0.3.0
896cfa3

Choose a tag to compare

AirField 0.3.0: Define once on the model, render anywhere

Pydantic models can carry a full description of how each field should be presented. Sixteen frozen dataclasses cover labels, widgets, choices, table columns, visibility, grouping, and display formatting. Annotate your fields with Annotated[str, Label("Full name"), Widget("text")] and any form renderer, table builder, or CLI prompt generator can discover exactly what it needs.

uv add AirField>=0.3.0

What's new

  • 16 presentation types in airfield.types, all frozen dataclasses inheriting from BasePresentation: Label, Placeholder, HelpText, Widget, DisplayFormat, Choices, ColumnAlign, ColumnWidth, Filterable, Sortable, Hidden, ReadOnly, Grouped, Priority, and Compact. Consumers find them via isinstance(m, BasePresentation) when traversing field annotations.

  • AirField() accepts form and UI parameters directly: type, label, widget, choices, placeholder, help_text, and autofocus, alongside the existing primary_key. Two ways to attach the same metadata: Annotated types for full type safety, or keyword arguments for quick inline declarations.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release: the presentation type vocabulary and the expanded AirField signature.

AirField 0.2.0

18 Mar 13:32
v0.2.0
c3c0337

Choose a tag to compare

AirField 0.2.0

AirField extends pydantic.Field so models can declare which field is the primary key. AirModel already depends on it for its async PostgreSQL ORM.

uv add AirField

What's new

  • AirField function exported as from airfield import AirField. Accepts all the same arguments as pydantic.Field plus primary_key, stored in json_schema_extra.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release.

AirField 0.1.0: Staking the claim

18 Mar 13:02
v0.1.0
7f0020e

Choose a tag to compare

AirField 0.1.0: Staking the claim

AirField is a library of dataclasses describing how Pydantic model fields should be presented across UI contexts: web forms, CLI prompts, data tables, notebooks, API docs, charts.

This release reserves the PyPI package name and establishes the project scaffold. I'm just getting started here.

uv add AirField

Built with Cookiecutter PyPackage after improving it quite a bit today. With every new package I create, it gets better.

Contributors

@audreyfeldroy (Audrey M. Roy Greenfeld) created AirField.