chitose.com.atproto.label package#

Submodules#

chitose.com.atproto.label.defs module#

class chitose.com.atproto.label.defs.Label(src: str, uri: str, val: str, cts: str, cid: str | None = None, neg: bool | None = None)#

Bases: Object

Metadata tag on an atproto resource (eg, repo or record)

Parameters:
  • src – DID of the actor who created this label

  • uri – AT URI of the record, repository (account), or other resource which this label applies to

  • val – the short string name of the value or type of this label

  • cts – timestamp when this label was created

  • cid – optionally, CID specifying the specific version of ‘uri’ resource this label applies to

  • neg – if true, this is a negation label, overwriting a previous label

to_dict() dict[str, Any]#
class chitose.com.atproto.label.defs.SelfLabel(val: str)#

Bases: Object

Metadata tag on an atproto record, published by the author within the record. Note – schemas should use #selfLabels, not #selfLabel.

Parameters:

val – the short string name of the value or type of this label

to_dict() dict[str, Any]#
class chitose.com.atproto.label.defs.SelfLabels(values: list[SelfLabel])#

Bases: Object

Metadata tags on an atproto record, published by the author within the record.

to_dict() dict[str, Any]#

chitose.com.atproto.label.query_labels module#

chitose.com.atproto.label.subscribe_labels module#

class chitose.com.atproto.label.subscribe_labels.Info(name: Literal['OutdatedCursor'], message: str | None = None)#

Bases: Object

to_dict() dict[str, Any]#
class chitose.com.atproto.label.subscribe_labels.Labels(seq: int, labels: list[Label])#

Bases: Object

to_dict() dict[str, Any]#

Module contents#

class chitose.com.atproto.label.Label_(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.

query_labels(uri_patterns: list[str], sources: list[str] | None = None, limit: int | None = None, cursor: str | None = None) bytes#

Find labels relevant to the provided URI patterns.

Parameters:
  • uri_patterns – List of AT URI patterns to match (boolean ‘OR’). Each may be a prefix (ending with ‘*’; will match inclusive of the string leading to ‘*’), or a full URI

  • sources – Optional list of label sources (DIDs) to filter on

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

Subscribe to label updates

Parameters:

cursor – The last known event to backfill from.