objects: Change sets, records, scopes, and feed entries#

The data an adapter hands the core, and what the core returns.

What an adapter hands the core after asking the server what changed.

class calendaring_sync.objects.change_set.ChangeSet(scope: str, since: str | None, token: str, changes: Mapping[str, Changed | Removed | Unchanged], full_listing: bool = False, truncated: bool = False)[source]#

Bases: object

One change set, or one truncated page of it, for one scope.

Variables:
changes: Mapping[str, Changed | Removed | Unchanged]#
full_listing: bool = False#
scope: str#
since: str | None#
token: str#
truncated: bool = False#

The three ways an object can appear in a change set.

calendaring_sync.objects.change.Change = calendaring_sync.objects.change.Changed | calendaring_sync.objects.change.Removed | calendaring_sync.objects.change.Unchanged#

Any one of the three.

class calendaring_sync.objects.change.Changed(version: str | None, fingerprint: str, content: str, containers: frozenset[str] = frozenset({}), logical_key: str | None = None)[source]#

Bases: object

The object changed on the server, or is new there.

Variables:
containers: frozenset[str] = frozenset({})#
content: str#
fingerprint: str#
logical_key: str | None = None#
version: str | None#
class calendaring_sync.objects.change.Removed[source]#

Bases: object

The object is gone from the server.

class calendaring_sync.objects.change.Unchanged[source]#

Bases: object

The object hasn’t changed since the version the store holds.

Only a full listing reports this, so the object isn’t fetched again.

A record: everything the core stores about one object.

class calendaring_sync.objects.record.Record(local_key: int, scope: str, object_id: str | None, state: RecordState, version: str | None, fingerprint: str | None, content: str, containers: frozenset[str], logical_key: str | None, synced_at: datetime | None, last_entry: int)[source]#

Bases: object

One record.

Variables:
containers: frozenset[str]#
content: str#
fingerprint: str | None#
last_entry: int#
local_key: int#
logical_key: str | None#
object_id: str | None#
scope: str#
state: RecordState#
synced_at: datetime | None#
version: str | None#
class calendaring_sync.objects.record.RecordState(*values)[source]#

Bases: StrEnum

The five states a record can be in.

CONFLICT = 'conflict'#

Holds an open conflict.

IN_FLIGHT = 'in_flight'#

Its push was sent, and how it ended isn’t known yet.

PENDING = 'pending'#

Holds a pending edit.

REMOVED = 'removed'#

Gone from the server, kept until it’s purged.

SYNCED = 'synced'#

Matches the server’s copy.

A scope as the store keeps it.

class calendaring_sync.objects.scope.Scope(id: str, token: str | None, fingerprint_scheme: str, media_type: str, last_sync_at: datetime | None = None, last_full_listing_at: datetime | None = None, listing_token: str | None = None)[source]#

Bases: object

One scope.

Variables:
  • id (str) – The id the adapter gave the scope.

  • token (str | None) – The scope’s sync token, or None before its first full listing finishes and after a reset.

  • fingerprint_scheme (str) – The fingerprint scheme of the scope’s records.

  • media_type (str) – The media type of the scope’s content.

  • last_sync_at (datetime.datetime | None) – When an ingest of the scope last finished, or None.

  • last_full_listing_at (datetime.datetime | None) – When a full listing of the scope last finished, or None.

  • listing_token (str | None) – The token of the full listing in progress, or None. A page of any other listing is refused, so two processes listing the scope at once can’t mix their results.

fingerprint_scheme: str#
id: str#
last_full_listing_at: datetime | None = None#
last_sync_at: datetime | None = None#
listing_token: str | None = None#
media_type: str#
token: str | None#

An entry in the change feed.

class calendaring_sync.objects.feed.FeedEntry(number: int, scope: str, kind: FeedEntryKind, local_key: int | None, object_id: str | None, at: datetime)[source]#

Bases: object

One feed entry.

Variables:
  • number (int) – The entry’s number. Each entry’s is larger than the one before it.

  • scope (str) – The id of the scope the entry is about.

  • kind (calendaring_sync.objects.feed.FeedEntryKind) – What happened.

  • local_key (int | None) – The local key of the record the entry is about, None for a dropped scope. The record may since have been purged.

  • object_id (str | None) – The record’s object id when the entry was written, None for a dropped scope.

  • at (datetime.datetime) – When the entry was written.

at: datetime#
kind: FeedEntryKind#
local_key: int | None#
number: int#
object_id: str | None#
scope: str#
class calendaring_sync.objects.feed.FeedEntryKind(*values)[source]#

Bases: StrEnum

What a feed entry records.

CHANGED = 'changed'#

the object is new, changed, or back on the server.

Type:

A remote change was applied

REMOVED = 'removed'#

A remote removal was applied.

SCOPE_DROPPED = 'scope_dropped'#

A scope was dropped, with every record in it.

What drop_scope() discards.

class calendaring_sync.objects.dropped_scope.DroppedScope(scope: str, pending: tuple[Record, ...], conflicts: tuple[Record, ...])[source]#

Bases: object

The local work a drop discarded, for your application to save or show.

Variables:
conflicts: tuple[Record, ...]#
pending: tuple[Record, ...]#
scope: str#

See Errors for the exception hierarchy.

Last updated on 2026-10-13.