betty.locale.date module¶
Localize dates.
- class betty.locale.date.Date[source]¶
Bases:
LinkedDataDumpable[Object]A (Gregorian) date.
- __init__(year: int | None = None, month: int | None = None, day: int | None = None, fuzzy: bool = False)[source]¶
- async dump_linked_data(project: Project, context_definition: str | None = None) DumpMapping[Dump][source]¶
Dump this instance to JSON-LD.
- async classmethod linked_data_schema(project: Project) DateSchema[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.locale.date.DateRange[source]¶
Bases:
LinkedDataDumpable[Object]A date range can describe a period of time between, before, after, or around start and/or end dates.
- __init__(start: Date | None = None, end: Date | None = None, start_is_boundary: bool = False, end_is_boundary: bool = False)[source]¶
- async dump_linked_data(project: Project, start_context_definition: str | None = None, end_context_definition: str | None = None) DumpMapping[Dump][source]¶
Dump this instance to JSON-LD.
- async classmethod linked_data_schema(project: Project) DateRangeSchema[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data().
- class betty.locale.date.DateRangeSchema[source]¶
Bases:
ObjectA JSON Schema for
betty.locale.date.DateRange.
- class betty.locale.date.DateSchema[source]¶
Bases:
JsonLdObjectA JSON Schema for
betty.locale.date.Date.
- class betty.locale.date.DateySchema[source]¶
Bases:
OneOfA JSON Schema for
betty.locale.date.Datey.
- exception betty.locale.date.IncompleteDateError[source]¶
Bases:
ValueErrorRaised when a datey was unexpectedly incomplete.