# Fields

ACME JSON fields.

class acme.fields.Fixed(json_name: str, value: Any)

  Fixed field.

  decode(value: Any) → Any

    Decode a value, optionally with context JSON object.

  encode(value: Any) → Any

    Encode a value, optionally with context JSON object.

class acme.fields.RFC3339Field(json_name: str, default: Any = None, omitempty: bool = False, decoder: Callable[[Any], Any] = None, encoder: Callable[[Any], Any] = None)

  RFC3339 field encoder/decoder.

  Handles decoding/encoding between RFC3339 strings and aware (not naive) `datetime.datetime` objects (e.g. `datetime.datetime.now(pytz.UTC)`).

  classmethod default_encoder(value: datetime) → str

    Default (passthrough) encoder.

  classmethod default_decoder(value: str) → datetime

    Default decoder.

    Recursively deserialize into immutable types ( `josepy.util.frozendict` instead of `dict()`, `tuple()` instead of `list()`).

acme.fields.fixed(json_name: str, value: Any) → Any

  Generates a type-friendly Fixed field.

acme.fields.rfc3339(json_name: str, omitempty: bool = False) → Any

  Generates a type-friendly RFC3339 field.