JSON Schemas

Marshmallow schemas for loading AuthoritySpoke objects from JSON.

Intended for use with machine-generated API responses. Should be suitable for generating an OpenAPI specification.

class authorityspoke.io.schemas_json.CAPCitationSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Decision citations in CAP API response.

make_object(data, **kwargs)

Load citation.

Return type

CAPCitation

class authorityspoke.io.schemas_json.OpinionSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Opinions, of which there may be several in one Decision.

format_data_to_load(data, **kwargs)

Standardize author name before loading object.

Return type

Dict[str, str]

class authorityspoke.io.schemas_json.DecisionSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for decisions retrieved from Caselaw Access Project API.

format_data_to_load(data, **kwargs)

Transform data from CAP API response for loading.

Return type

Dict[str, Union[str, int, Sequence[Dict[str, str]]]]

class authorityspoke.io.schemas_json.FactSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Facts, which may contain arbitrary levels of nesting.

make_object(data, **kwargs)

Make Fact.

Return type

Fact

class authorityspoke.io.schemas_json.ExhibitSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for an object that may embody a statement.

make_object(data, **kwargs)

Make Exhibit.

Return type

Exhibit

class authorityspoke.io.schemas_json.PleadingSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for a document to link Allegations to.

class authorityspoke.io.schemas_json.AllegationSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for an Allegation of a Fact.

class authorityspoke.io.schemas_json.EvidenceSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for an Exhibit and a reference to the Fact it would support.

class authorityspoke.io.schemas_json.FactorSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema that directs data to “one of” the other schemas.

get_obj_type(obj)

Return name of object schema.

Return type

str

class authorityspoke.io.schemas_json.ProcedureSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Procedure; does not require separate TermSequence schema.

“FactorSchema, many=True” is an equivalent of a TermSequence.

class authorityspoke.io.schemas_json.RuleSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Holding; can also hold Procedure fields.

class authorityspoke.io.schemas_json.HoldingSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)

Schema for Holding; can also hold Rule and Procedure fields.

class authorityspoke.io.schemas_json.NamedAnchors(name, anchors)
name: nettlesome.factors.Factor

Alias for field number 0

anchors: List[anchorpoint.textselectors.TextQuoteSelector]

Alias for field number 1

class authorityspoke.io.schemas_json.NamedAnchorsSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
class authorityspoke.io.schemas_json.AnchoredEnactments(enactment, anchors)
enactment: legislice.enactments.Enactment

Alias for field number 0

anchors: List[anchorpoint.textselectors.TextQuoteSelector]

Alias for field number 1

class authorityspoke.io.schemas_json.AnchoredEnactmentsSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
authorityspoke.io.schemas_json.get_schema_for_item(classname)

Find the Marshmallow schema for an AuthoritySpoke object.

Return type

Schema