Fields

ACME JSON fields.

class acme.fields.Fixed(json_name, value)[source]

Bases: josepy.json_util.Field

Fixed field.

decode(value)[source]

Decode a value, optionally with context JSON object.

encode(value)[source]

Encode a value, optionally with context JSON object.

class acme.fields.RFC3339Field(json_name, default=None, omitempty=False, decoder=None, encoder=None)[source]

Bases: josepy.json_util.Field

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)[source]

Default (passthrough) encoder.

classmethod default_decoder(value)[source]

Default decoder.

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

class acme.fields.Resource(resource_type, *args, **kwargs)[source]

Bases: josepy.json_util.Field

Resource MITM field.

decode(value)[source]

Decode a value, optionally with context JSON object.