module documentation

Serialize Scheduler and the calls scheduled with it to JSON.

To use this module:

Class HasTypeCode The HasTypeCode protocol describes an object with a typeCodeForJSON method; this is used as a bound on other types such as JSONableCallable, JSONableRepeatable, and JSONableInstance.
Class JSONable Methods that allow a JSONRegistry to serialize an object as JSON.
Class JSONableBoundMethod A bound method that conforms to JSONable and can be serialized and deserialized.
Class JSONableBoundRepeatable Like JSONableBoundMethod, but for repeating calls.
Class JSONableCallable A callable that can be serialized as JSON.
Class JSONableInstance A class that conforms to JSONableInstance can be both serialized to and deserialized from JSON by a JSONRegistry. JSONableInstance.
Class JSONableMethodDescriptor A descriptor that can bind methods into JSONableBoundMethods.
Class JSONableRepeatable A callable that can be serialized as JSON, with a signature that can be used for repeated calls with JSONRegistry.repeatedly.
Class JSONableRepeatableDescriptor A descriptor that can bind methods into JSONableBoundRepeatables.
Class JSONRegistry A JSONRegistry maintains a set of functions and methods (and the classes those methods are defined on) that can scheduled against a Scheduler and then persisted into a JSON blob to reconstitute that scheduler later.
Class LoadProcess A LoadProcess collects the parameters to one top-level call to JSONRegistry.loadScheduler.
Class RuleJSONIfier External serializer for a recurrence rule.
Class SerializableFunction Wrapper around a function that conforms with JSONable.
Exception MissingPersistentCall A serialized persistent-call handle was missing.
Function dateTypeAsJSON Undocumented
Function dateTypeFromJSON Undocumented
Function schedulerAtPath Undocumented
Constant DTZI Undocumented
Type Variable BootstrapT Undocumented
Type Variable BootstrapTCo Each JSONRegistry has its own special object passed along to JSONableInstance.fromJSON, which can be any object. This TypeVar describes its type.
Type Variable BootstrapTInv Like BootstrapT but invariant.
Type Variable JSONableSelf TypeVar for binding self on methods that want to be serialized by JSONRegistry.method.
Type Variable RRuleT Undocumented
Type Variable RRuleTx Undocumented
Type Alias JSONObject A loose description of a JSON-dumpable object.
Variable JSONableScheduler A JSONable scheduler is a Scheduler which tracks time as a ZoneInfo-aware datetype.DateTime and only accepts JSONableCallable objects as work to be performed, so that they can be serialized later.
Variable JSONHandle Undocumented
Variable JSONRepeater A Repeater that is constrained to accept only JSON-serializable types.
Variable SomeSignature A description of the parameters passed to a serializable function.
Class _EveryDeltaJSONifier Undocumented
Class _JSONableMethodBinder Separated description of JSONableMethodDescriptor.__get__ that wraps _JSONableRepeaterWrapper.repeat to work around this issue.
Class _JSONableRepeaterWrapper Since a Scheduler can only contain work of a given type, which must have a 0-argument, None-returning signature, and JSONRegistry serializes the schedulers it creates or loads by enumerating the ScheduledCall...
Class _SelfReferentialCall No class docstring; 4/4 properties, 0/2 class variable, 1/1 method documented
Class _SpecificTypeRegistration General container for registering a specific kind of type (instances, plain callables, repeated callables).
Class _YearlyJSONifier Undocumented
Function _copyUniversal Derive a registry type registration from the universal registry type registration.
Function _whatJSON Convert a JSONable into a standard JSON-serializable object format.
Constant __JC Undocumented
Constant _TC Undocumented
Type Variable _JSONableCallableT Undocumented
Type Variable _JSONableType Binding for internal generic tracking of JSONable types.
Type Alias _Repeater Undocumented
Variable _JSONableHeap Undocumented
Variable _universal Create a registry for universally-serializable types. Right now its only member is _JSONableRepeaterWrapper, to allow for its `repeat` method to appear as serializable to all serializable schedulers.
def dateTypeAsJSON(dt: DTZI) -> dict[str, str]: (source)

Undocumented

def dateTypeFromJSON(dtjs: dict[str, str]) -> DTZI: (source)

Undocumented

@contextmanager
def schedulerAtPath(registry: JSONRegistry[BootstrapT], driver: TimeDriver[DTZI], path: Path, bootstrap: BootstrapT) -> Iterator[JSONableScheduler[BootstrapT]]: (source)

Undocumented

Undocumented

Value
DateTime[ZoneInfo]
BootstrapT = (source)

Undocumented

Value
TypeVar('BootstrapT',
        contravariant=True)
BootstrapTCo = (source)

Each JSONRegistry has its own special object passed along to JSONableInstance.fromJSON, which can be any object. This TypeVar describes its type.

Value
TypeVar('BootstrapTCo',
        covariant=True)
BootstrapTInv = (source)

Like BootstrapT but invariant.

Value
TypeVar('BootstrapTInv')
JSONableSelf = (source)

TypeVar for binding self on methods that want to be serialized by JSONRegistry.method.

Value
TypeVar('JSONableSelf',
        bound=JSONableInstance[Any])

Undocumented

Value
TypeVar('RRuleT',
        bound=RecurrenceRule[DTZI, Any])

Undocumented

Value
TypeVar('RRuleTx',
        bound=RecurrenceRule[DTZI, Any], contravariant=True)
JSONObject = (source)

A loose description of a JSON-dumpable object.

Value
dict[str, Any]
JSONableScheduler = (source)

A JSONable scheduler is a Scheduler which tracks time as a ZoneInfo-aware datetype.DateTime and only accepts JSONableCallable objects as work to be performed, so that they can be serialized later.

Note
The type-checker can make sure that your callalbles are json-able, but they can't make sure that they're registered with the correct JSONRegistry; mixing and matching different registries will be a runtime error.
JSONHandle = (source)

Undocumented

JSONRepeater = (source)

A Repeater that is constrained to accept only JSON-serializable types.

SomeSignature = (source)

A description of the parameters passed to a serializable function.

Derive a registry type registration from the universal registry type registration.

Convert a JSONable into a standard JSON-serializable object format.

_JSONableCallableT = (source)

Undocumented

Value
TypeVar('_JSONableCallableT',
        bound=JSONableCallable[Any]|JSONableRepeatable[Any, Any])
_JSONableType = (source)

Binding for internal generic tracking of JSONable types.

Value
TypeVar('_JSONableType',
        bound=HasTypeCode)
_JSONableHeap = (source)

Undocumented

_universal = (source)

Create a registry for universally-serializable types. Right now its only member is _JSONableRepeaterWrapper, to allow for its `repeat` method to appear as serializable to all serializable schedulers.