calendaring_sync.objects.edit module#

A local edit your application recorded and the server doesn’t have yet.

class calendaring_sync.objects.edit.EditKind(*values)[source]#

Bases: StrEnum

What a local edit does to its object.

CHANGE = 'change'#

Changes an object the server has.

DELETE = 'delete'#

Deletes an object the server has.

CREATE = 'create'#

Creates an object the server doesn’t have yet.

class calendaring_sync.objects.edit.LocalEdit(kind, content, fingerprint, containers, logical_key, recorded_at)[source]#

Bases: object

One pending edit of a record.

kind#

What the edit does.

Type:

EditKind

content#

The object’s content after the edit, None for a delete.

Type:

bytes | None

fingerprint#

The fingerprint of content, None for a delete, or after a fingerprint scheme change until the object is edited again.

Type:

str | None

containers#

The containers the object belongs to after the edit.

Type:

frozenset[str]

logical_key#

The object’s logical key after the edit, if it has one.

Type:

str | None

recorded_at#

When the edit was last recorded.

Type:

datetime

class calendaring_sync.objects.edit.EditFields(fingerprint, containers=frozenset({}), logical_key=None)[source]#

Bases: object

What an edit records about an object beside its content.

An adapter reads these from content the same way for the server’s copy and for an edit, so an edit back to the synced copy cancels, and the server’s copy of your own edit isn’t a conflict. To build them for content you made, such as a Merge, call the adapter’s edit_fields().

fingerprint#

The content’s fingerprint.

Type:

str

containers#

The containers the object belongs to.

Type:

frozenset[str]

logical_key#

The object’s logical key, if it has one.

Type:

str | None

Raises:

TypeError – If a field has the wrong type.

Examples

>>> from calendaring_sync import EditFields
>>> fields = EditFields("fp-a2", frozenset({"work"}), "meeting-1")
>>> fields.logical_key
'meeting-1'

Last updated on 2026-11-11.