chitose.com.atproto.repo package#

Submodules#

chitose.com.atproto.repo.apply_writes module#

class chitose.com.atproto.repo.apply_writes.Create(collection: str, value: Any, rkey: str | None = None)#

Bases: Object

to_dict() dict#
class chitose.com.atproto.repo.apply_writes.Delete(collection: str, rkey: str)#

Bases: Object

to_dict() dict#
class chitose.com.atproto.repo.apply_writes.Update(collection: str, rkey: str, value: Any)#

Bases: Object

to_dict() dict#

chitose.com.atproto.repo.create_record module#

chitose.com.atproto.repo.delete_record module#

chitose.com.atproto.repo.describe_repo module#

chitose.com.atproto.repo.get_record module#

chitose.com.atproto.repo.list_records module#

class chitose.com.atproto.repo.list_records.Record(uri: str, cid: str, value: Any)#

Bases: Object

to_dict() dict#

chitose.com.atproto.repo.put_record module#

chitose.com.atproto.repo.rebase_repo module#

chitose.com.atproto.repo.strong_ref module#

A URI with a content-hash fingerprint.

class chitose.com.atproto.repo.strong_ref.StrongRef(uri: str, cid: str)#

Bases: Object

to_dict() dict#

chitose.com.atproto.repo.upload_blob module#

Module contents#

class chitose.com.atproto.repo.Repo_(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.

apply_writes(repo: str, writes: list[Create | Update | Delete], validate: bool | None = None, swap_commit: str | None = None) bytes#

Apply a batch transaction of creates, updates, and deletes.

Parameters:
  • repo – The handle or DID of the repo.

  • validate – Validate the records?

create_record(repo: str, collection: str, record: Any, rkey: str | None = None, validate: bool | None = None, swap_commit: str | None = None) bytes#

Create a new record.

Parameters:
  • repo – The handle or DID of the repo.

  • collection – The NSID of the record collection.

  • record – The record to create.

  • rkey – The key of the record.

  • validate – Validate the record?

  • swap_commit – Compare and swap with the previous commit by cid.

delete_record(repo: str, collection: str, rkey: str, swap_record: str | None = None, swap_commit: str | None = None) bytes#

Delete a record, or ensure it doesn’t exist.

Parameters:
  • repo – The handle or DID of the repo.

  • collection – The NSID of the record collection.

  • rkey – The key of the record.

  • swap_record – Compare and swap with the previous record by cid.

  • swap_commit – Compare and swap with the previous commit by cid.

describe_repo(repo: str) bytes#

Get information about the repo, including the list of collections.

Parameters:

repo – The handle or DID of the repo.

get_record(repo: str, collection: str, rkey: str, cid: str | None = None) bytes#

Get a record.

Parameters:
  • repo – The handle or DID of the repo.

  • collection – The NSID of the record collection.

  • rkey – The key of the record.

  • cid – The CID of the version of the record. If not specified, then return the most recent version.

list_records(repo: str, collection: str, limit: int | None = None, cursor: str | None = None, rkey_start: str | None = None, rkey_end: str | None = None, reverse: bool | None = None) bytes#

List a range of records in a collection.

Parameters:
  • repo – The handle or DID of the repo.

  • collection – The NSID of the record type.

  • limit – The number of records to return.

  • rkey_start – DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)

  • rkey_end – DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)

  • reverse – Reverse the order of the returned records?

put_record(repo: str, collection: str, rkey: str, record: Any, validate: bool | None = None, swap_record: str | None = None, swap_commit: str | None = None) bytes#

Write a record, creating or updating it as needed.

Parameters:
  • repo – The handle or DID of the repo.

  • collection – The NSID of the record collection.

  • rkey – The key of the record.

  • record – The record to write.

  • validate – Validate the record?

  • swap_record – Compare and swap with the previous record by cid.

  • swap_commit – Compare and swap with the previous commit by cid.

rebase_repo(repo: str, swap_commit: str | None = None) bytes#

Simple rebase of repo that deletes history

Parameters:
  • repo – The handle or DID of the repo.

  • swap_commit – Compare and swap with the previous commit by cid.

upload_blob(input_: bytes) bytes#

Upload a new blob to be added to repo in a later request.