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)

Bases: Object

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

Bases: Object

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

Bases: Object

to_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()

chitose.com.atproto.repo.put_record module

chitose.com.atproto.repo.strong_ref module

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

Bases: Object

to_dict()

chitose.com.atproto.repo.upload_blob module

Module contents

class chitose.com.atproto.repo.Repo_(service: str, headers: dict[str, str])

Bases: object

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

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: str | None = None, swap_commit: str | None = None)

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)

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)

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)

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: str | None = None)

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: str | None = None, swap_record: str | None = None, swap_commit: str | None = None)

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.

upload_blob()

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