chitose.com.atproto.sync package#

Submodules#

chitose.com.atproto.sync.get_blob module#

chitose.com.atproto.sync.get_blocks module#

chitose.com.atproto.sync.get_checkout module#

chitose.com.atproto.sync.get_commit_path module#

chitose.com.atproto.sync.get_head module#

chitose.com.atproto.sync.get_latest_commit module#

chitose.com.atproto.sync.get_record module#

chitose.com.atproto.sync.get_repo module#

chitose.com.atproto.sync.list_blobs module#

chitose.com.atproto.sync.list_repos module#

class chitose.com.atproto.sync.list_repos.Repo(did: str, head: str)#

Bases: Object

to_dict() dict[str, Any]#

chitose.com.atproto.sync.notify_of_update module#

chitose.com.atproto.sync.request_crawl module#

chitose.com.atproto.sync.subscribe_repos module#

class chitose.com.atproto.sync.subscribe_repos.Commit(seq: int, rebase: bool, too_big: bool, repo: str, commit: Any, rev: str, since: str, blocks: Any, ops: list[RepoOp], blobs: list[Any], time: str, prev: Any | None = None)#

Bases: Object

Parameters:
  • rev – The rev of the emitted commit

  • since – The rev of the last emitted commit from this repo

  • blocks – CAR file containing relevant blocks

to_dict() dict[str, Any]#
class chitose.com.atproto.sync.subscribe_repos.Handle(seq: int, did: str, handle: str, time: str)#

Bases: Object

to_dict() dict[str, Any]#
class chitose.com.atproto.sync.subscribe_repos.Info(name: Literal['OutdatedCursor'], message: str | None = None)#

Bases: Object

to_dict() dict[str, Any]#
class chitose.com.atproto.sync.subscribe_repos.Migrate(seq: int, did: str, migrate_to: str, time: str)#

Bases: Object

to_dict() dict[str, Any]#
class chitose.com.atproto.sync.subscribe_repos.RepoOp(action: Literal['create', 'update', 'delete'], path: str, cid: Any)#

Bases: Object

A repo operation, ie a write of a single record. For creates and updates, cid is the record’s CID as of this operation. For deletes, it’s null.

to_dict() dict[str, Any]#
class chitose.com.atproto.sync.subscribe_repos.Tombstone(seq: int, did: str, time: str)#

Bases: Object

to_dict() dict[str, Any]#

Module contents#

class chitose.com.atproto.sync.Sync_(call: Callable[[str, list[tuple[str, str | None | int | list[str]]], bytes | dict | None, dict[str, str]], bytes], subscribe: Callable[[str, list[tuple[str, str | None | int | list[str]]], Callable[[str | bytes], None]], None])#

Bases: object

We recommend calling methods in this class via the chitose.BskyAgent class instead of creating instances of this class directly.

get_blob(did: str, cid: str) bytes#

Get a blob associated with a given repo.

Parameters:
  • did – The DID of the repo.

  • cid – The CID of the blob to fetch

get_blocks(did: str, cids: list[str]) bytes#

Gets blocks from a given repo.

Parameters:

did – The DID of the repo.

get_checkout(did: str) bytes#

DEPRECATED - please use com.atproto.sync.getRepo instead

Parameters:

did – The DID of the repo.

get_head(did: str) bytes#

DEPRECATED - please use com.atproto.sync.getLatestCommit instead

Parameters:

did – The DID of the repo.

get_latest_commit(did: str) bytes#

Gets the current commit CID & revision of the repo.

Parameters:

did – The DID of the repo.

get_record(did: str, collection: str, rkey: str, commit: str | None = None) bytes#

Gets blocks needed for existence or non-existence of record.

Parameters:
  • did – The DID of the repo.

  • commit – An optional past commit CID.

get_repo(did: str, since: str | None = None) bytes#

Gets the did’s repo, optionally catching up from a specific revision.

Parameters:
  • did – The DID of the repo.

  • since – The revision of the repo to catch up from.

list_blobs(did: str, since: str | None = None, limit: int | None = None, cursor: str | None = None) bytes#

List blob cids since some revision

Parameters:
  • did – The DID of the repo.

  • since – Optional revision of the repo to list blobs since

list_repos(limit: int | None = None, cursor: str | None = None) bytes#

List dids and root cids of hosted repos

notify_of_update(hostname: str) bytes#

Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break.

Parameters:

hostname – Hostname of the service that is notifying of update.

request_crawl(hostname: str) bytes#

Request a service to persistently crawl hosted repos.

Parameters:

hostname – Hostname of the service that is requesting to be crawled.

subscribe_repos(handler: Callable[[str | bytes], None], cursor: int | None = None) None#

Subscribe to repo updates

Parameters:

cursor – The last known event to backfill from.