chitose.app.bsky.feed package#
Submodules#
chitose.app.bsky.feed.defs module#
- class chitose.app.bsky.feed.defs.BlockedAuthor(did: str, viewer: ViewerState | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.BlockedPost(uri: str, blocked: bool, author: BlockedAuthor)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.FeedViewPost(post: PostView, reply: ReplyRef | None = None, reason: ReasonRepost | ReasonPin | None = None, feed_context: str | None = None)#
Bases:
Object- Parameters:
feed_context – Context provided by feed generator that may be passed back alongside interactions.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.GeneratorView(uri: str, cid: str, did: str, creator: ProfileView, display_name: str, indexed_at: str, description: str | None = None, description_facets: list[Facet] | None = None, avatar: str | None = None, like_count: int | None = None, accepts_interactions: bool | None = None, labels: list[Label] | None = None, viewer: GeneratorViewerState | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.GeneratorViewerState(like: str | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.Interaction(item: str | None = None, event: Literal['app.bsky.feed.defs#requestLess', 'app.bsky.feed.defs#requestMore', 'app.bsky.feed.defs#clickthroughItem', 'app.bsky.feed.defs#clickthroughAuthor', 'app.bsky.feed.defs#clickthroughReposter', 'app.bsky.feed.defs#clickthroughEmbed', 'app.bsky.feed.defs#interactionSeen', 'app.bsky.feed.defs#interactionLike', 'app.bsky.feed.defs#interactionRepost', 'app.bsky.feed.defs#interactionReply', 'app.bsky.feed.defs#interactionQuote', 'app.bsky.feed.defs#interactionShare'] | None = None, feed_context: str | None = None)#
Bases:
Object- Parameters:
feed_context – Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.NotFoundPost(uri: str, not_found: bool)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.PostView(uri: str, cid: str, author: ProfileViewBasic, record: Any, indexed_at: str, embed: View | View | View | View | View | None = None, reply_count: int | None = None, repost_count: int | None = None, like_count: int | None = None, quote_count: int | None = None, viewer: ViewerState | None = None, labels: list[Label] | None = None, threadgate: ThreadgateView | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.ReasonRepost(by: ProfileViewBasic, indexed_at: str)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.ReplyRef(root: PostView | NotFoundPost | BlockedPost, parent: PostView | NotFoundPost | BlockedPost, grandparent_author: ProfileViewBasic | None = None)#
Bases:
Object- Parameters:
grandparent_author – When parent is a reply to another post, this is the author of that post.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.SkeletonFeedPost(post: str, reason: SkeletonReasonRepost | SkeletonReasonPin | None = None, feed_context: str | None = None)#
Bases:
Object- Parameters:
feed_context – Context that will be passed through to client and may be passed to feed generator back alongside interactions.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.SkeletonReasonRepost(repost: str)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.ThreadViewPost(post: PostView, parent: ThreadViewPost | NotFoundPost | BlockedPost | None = None, replies: list[ThreadViewPost | NotFoundPost | BlockedPost] | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.ThreadgateView(uri: str | None = None, cid: str | None = None, record: Any | None = None, lists: list[ListViewBasic] | None = None)#
Bases:
Object- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.defs.ViewerState(repost: str | None = None, like: str | None = None, thread_muted: bool | None = None, reply_disabled: bool | None = None, embedding_disabled: bool | None = None, pinned: bool | None = None)#
Bases:
ObjectMetadata about the requesting account’s relationship with the subject content. Only has meaningful content for authed requests.
- to_dict() dict[str, Any]#
chitose.app.bsky.feed.describe_feed_generator module#
chitose.app.bsky.feed.generator module#
- class chitose.app.bsky.feed.generator.Generator(did: str, display_name: str, created_at: str, description: str | None = None, description_facets: list[Facet] | None = None, avatar: Blob | None = None, accepts_interactions: bool | None = None, labels: SelfLabels | None = None)#
Bases:
Record- Parameters:
accepts_interactions – Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions
labels – Self-label values
- to_dict() dict[str, Any]#
chitose.app.bsky.feed.get_actor_feeds module#
chitose.app.bsky.feed.get_actor_likes module#
chitose.app.bsky.feed.get_feed module#
chitose.app.bsky.feed.get_feed_generator module#
chitose.app.bsky.feed.get_feed_generators module#
chitose.app.bsky.feed.get_feed_skeleton module#
chitose.app.bsky.feed.get_likes module#
- class chitose.app.bsky.feed.get_likes.Like(indexed_at: str, created_at: str, actor: ProfileView)#
Bases:
Object- to_dict() dict[str, Any]#
chitose.app.bsky.feed.get_list_feed module#
chitose.app.bsky.feed.get_post_thread module#
chitose.app.bsky.feed.get_posts module#
chitose.app.bsky.feed.get_quotes module#
chitose.app.bsky.feed.get_reposted_by module#
chitose.app.bsky.feed.get_suggested_feeds module#
chitose.app.bsky.feed.get_timeline module#
chitose.app.bsky.feed.like module#
chitose.app.bsky.feed.post module#
- class chitose.app.bsky.feed.post.Entity(index: TextSlice, type: str, value: str)#
Bases:
ObjectDeprecated: use facets instead.
- Parameters:
type – Expected values are ‘mention’ and ‘link’.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.post.Post(text: str, created_at: str, entities: list[Entity] | None = None, facets: list[Facet] | None = None, reply: ReplyRef | None = None, embed: Images | Video | External | Record | RecordWithMedia | None = None, langs: list[str] | None = None, labels: SelfLabels | None = None, tags: list[str] | None = None)#
Bases:
Record- Parameters:
text – The primary post content. May be an empty string, if there are embeds.
created_at – Client-declared timestamp when this post was originally created.
entities – DEPRECATED: replaced by app.bsky.richtext.facet.
facets – Annotations of text (mentions, URLs, hashtags, etc)
langs – Indicates human language of post primary text content.
labels – Self-label values for this post. Effectively content warnings.
tags – Additional hashtags, in addition to any included in post text and facets.
- to_dict() dict[str, Any]#
chitose.app.bsky.feed.postgate module#
- class chitose.app.bsky.feed.postgate.DisableRule#
Bases:
ObjectDisables embedding of this post.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.postgate.Postgate(created_at: str, post: str, detached_embedding_uris: list[str] | None = None, embedding_rules: list[DisableRule] | None = None)#
Bases:
Record- Parameters:
post – Reference (AT-URI) to the post record.
detached_embedding_uris – List of AT-URIs embedding this post that the author has detached from.
- to_dict() dict[str, Any]#
chitose.app.bsky.feed.repost module#
chitose.app.bsky.feed.search_posts module#
chitose.app.bsky.feed.send_interactions module#
chitose.app.bsky.feed.threadgate module#
- class chitose.app.bsky.feed.threadgate.FollowingRule#
Bases:
ObjectAllow replies from actors you follow.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.threadgate.ListRule(list: str)#
Bases:
ObjectAllow replies from actors on a list.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.threadgate.MentionRule#
Bases:
ObjectAllow replies from actors mentioned in your post.
- to_dict() dict[str, Any]#
- class chitose.app.bsky.feed.threadgate.Threadgate(post: str, created_at: str, allow: list[MentionRule | FollowingRule | ListRule] | None = None, hidden_replies: list[str] | None = None)#
Bases:
Record- Parameters:
post – Reference (AT-URI) to the post record.
hidden_replies – List of hidden reply URIs.
- to_dict() dict[str, Any]#
Module contents#
- class chitose.app.bsky.feed.Feed_(call: Callable[[str, list[tuple[str, str | None | int | list[str]]], bytes | dict[str, Any] | None, dict[str, str]], bytes], subscribe: Callable[[str, list[tuple[str, str | None | int | list[str]]], Callable[[str | bytes], None]], None])#
Bases:
objectWe recommend calling methods in this class via the chitose.BskyAgent class instead of creating instances of this class directly.
- describe_feed_generator() bytes#
Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).
- get_actor_feeds(actor: str, limit: int | None = None, cursor: str | None = None) bytes#
Get a list of feeds (feed generator records) created by the actor (in the actor’s repo).
- get_actor_likes(actor: str, limit: int | None = None, cursor: str | None = None) bytes#
Get a list of posts liked by an actor. Requires auth, actor must be the requesting account.
- get_author_feed(actor: str, limit: int | None = None, cursor: str | None = None, filter: Literal['posts_with_replies', 'posts_no_replies', 'posts_with_media', 'posts_and_author_threads'] | None = None, include_pins: bool | None = None) bytes#
Get a view of an actor’s ‘author feed’ (post and reposts by the author). Does not require auth.
- Parameters:
filter – Combinations of post/repost types to include in response.
- get_feed(feed: str, limit: int | None = None, cursor: str | None = None) bytes#
Get a hydrated feed from an actor’s selected feed generator. Implemented by App View.
- get_feed_generator(feed: str) bytes#
Get information about a feed generator. Implemented by AppView.
- Parameters:
feed – AT-URI of the feed generator record.
- get_feed_generators(feeds: list[str]) bytes#
Get information about a list of feed generators.
- get_feed_skeleton(feed: str, limit: int | None = None, cursor: str | None = None) bytes#
Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.
- Parameters:
feed – Reference to feed generator record describing the specific feed being requested.
- get_likes(uri: str, cid: str | None = None, limit: int | None = None, cursor: str | None = None) bytes#
Get like records which reference a subject (by AT-URI and CID).
- Parameters:
uri – AT-URI of the subject (eg, a post record).
cid – CID of the subject record (aka, specific version of record), to filter likes.
- get_list_feed(list: str, limit: int | None = None, cursor: str | None = None) bytes#
Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.
- Parameters:
list – Reference (AT-URI) to the list record.
- get_post_thread(uri: str, depth: int | None = None, parent_height: int | None = None) bytes#
Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.
- Parameters:
uri – Reference (AT-URI) to post record.
depth – How many levels of reply depth should be included in response.
parent_height – How many levels of parent (and grandparent, etc) post to include.
- get_posts(uris: list[str]) bytes#
Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as ‘hydrating’ a ‘feed skeleton’.
- Parameters:
uris – List of post AT-URIs to return hydrated views for.
- get_quotes(uri: str, cid: str | None = None, limit: int | None = None, cursor: str | None = None) bytes#
Get a list of quotes for a given post.
- Parameters:
uri – Reference (AT-URI) of post record
cid – If supplied, filters to quotes of specific version (by CID) of the post record.
- get_reposted_by(uri: str, cid: str | None = None, limit: int | None = None, cursor: str | None = None) bytes#
Get a list of reposts for a given post.
- Parameters:
uri – Reference (AT-URI) of post record
cid – If supplied, filters to reposts of specific version (by CID) of the post record.
- get_suggested_feeds(limit: int | None = None, cursor: str | None = None) bytes#
Get a list of suggested feeds (feed generators) for the requesting account.
- get_timeline(algorithm: str | None = None, limit: int | None = None, cursor: str | None = None) bytes#
Get a view of the requesting account’s home timeline. This is expected to be some form of reverse-chronological feed.
- Parameters:
algorithm – Variant ‘algorithm’ for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism.
- search_posts(q: str, sort: Literal['top', 'latest'] | None = None, since: str | None = None, until: str | None = None, mentions: str | None = None, author: str | None = None, lang: str | None = None, domain: str | None = None, url: str | None = None, tag: list[str] | None = None, limit: int | None = None, cursor: str | None = None) bytes#
Find posts matching search criteria, returning views of those posts.
- Parameters:
q – Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.
sort – Specifies the ranking order of results.
since – Filter results for posts after the indicated datetime (inclusive). Expected to use ‘sortAt’ timestamp, which may not match ‘createdAt’. Can be a datetime, or just an ISO date (YYYY-MM-DD).
until – Filter results for posts before the indicated datetime (not inclusive). Expected to use ‘sortAt’ timestamp, which may not match ‘createdAt’. Can be a datetime, or just an ISO date (YYY-MM-DD).
mentions – Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions.
author – Filter to posts by the given account. Handles are resolved to DID before query-time.
lang – Filter to posts in the given language. Expected to be based on post language field, though server may override language detection.
domain – Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization.
url – Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching.
tag – Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with ‘AND’ matching.
cursor – Optional pagination mechanism; may not necessarily allow scrolling through entire result set.
- send_interactions(interactions: list[Interaction]) bytes#
Send information about interactions with feed items back to the feed generator that served them.