Qpost

class qpy.Qpost(token: str)

Represents the connection of the user to qpost

Parameters

token (str) – Token of said user

get_badges()

Get information for the badges in the top navigation bar for the current use

Returns

dict

clear_notifications()

Clears all unread notifications

clear_messages()

Clears all unread messages

get_notifications(max_: int)

Gets notifications for the user

Returns

list[Notification]

get_user(user: str)

Gets a User object by their username

Parameters

user – username of the user

Returns

User

post_status(message: str, is_nsfw: bool = False, attachments: list = None, parent: int = None)

Creates a new FeedEntry with either the type POST or REPLY, depending on whether the parent parameter is present

Parameters
  • message – Content to be sent

  • is_nsfw – A flag to mark your content as nsfw. Default to False

  • attachments – A list consisting of base64 strings (can be constructed with MediaBuilder)

  • parent – id of a status to be replied to

Returns

FeedEntry

delete_status(feedid: int)

Deletes a specific FeedEntry by it’s ID (type has to be POST or REPLY)

Parameters

feedid – id of the status to be removed

get_status(feedid: int)

Gets a specific FeedEntry by it’s ID (type has to be POST or REPLY)

Parameters

feedid – id of the status to get

Returns

FeedEntry

block(targetid: int)

Creates a new Block from the current user to a specific user

Parameters

targetid – id of a User to be blocked

unblock(targetid: int)

Deletes a Block from the current user to a specific user

Parameters

targetid – id of a blocked User to be unblocked

get_block(targetid: int)

Get information of a block created by the current user, targeting a specific user

Returns

Block

get_blocks(max_: int)

Gets all blocked users for the current user

Parameters

max – The maximum blocks to look for

Returns

list[Notification]

favorite(feedid)

Creates a new Favorite from the current user to a specific FeedEntry

Parameters

feedid – id of the status to be favorited

Returns

Favorite

unfavorite(feedid: int)

Deletes a Favorite from the current user to a specific FeedEntry

Parameters

feedid – The ID of the target FeedEntry

get_favorites(userid: int, max_: int)

Gets all created favorites for a specific User

Parameters
  • userid – The ID of the user to look for

  • max – The maximum ID for favorites to look for

Returns

list[Favorite]

get_feeds(userid: int, max_: int = None, min_: int = None, type_: str = 'posts')

Gets entries on a feed, by specific parameters

Parameters
  • userid – The ID of the user to filter the feed entries by

  • max – The maximum ID for feed entries to look for (can not be combined with min_)

  • min – The minimum ID for feed entries to look for (can not be combined with max_)

  • type – The type of feed entries to load, either posts or replies, defaults to posts

Returns

list[FeedEntry]

get_follow(from_: int, to: int)

Gets info about a specific follow relationship

Parameters
  • from – The ID of the sending User

  • to – The ID of the target User

Returns

Follow

get_follows(from_: int, to: int, max_: int = None)

Gets all follow relationships for a specific user

Parameters
  • from – The ID of the user to look for

  • to – The ID of the user to look for

  • max – The maximum ID for follows to look for

Returns

list[Follow]

follow(to: int)

Creates a new Follow from the current user to a specific user

Parameters

to – The ID of the target User

unfollow(to: int)

Deletes a follow relationship from the current user to a specific FeedEntry

Parameters

to – The ID of the target User

known_followers(targetid: int, offset: int = None, limit: int = None)

Gets all followers, the current user follows for the target user

Parameters
  • targetid – The ID of the target user

  • offset – The amount of users to skip in the query

  • limit – The maximum amount of users to return

Returns

list[User]

accept_follow_request(requestid: int)

Accepts a follow request

Parameters

requestid – The ID of the target FollowRequest

decline_follow_request(requestid: int)

Declines a follow request

Parameters

requestid – The ID of the target FollowRequest

get_follow_requests(max_: int)

Gets all open follow requests for a specific user

Parameters

max – The maximum ID for follow requests to look for

Returns

list[FollowRequest]

get_replies(feedid: int, page: int)

Gets all replies to the specified status

Parameters
  • feedid – The ID of the status to look for

  • page – Used for pagination

Returns

list[list[Notification]]

search_users(query: str, offset: int = None, limit: int = None)

Searches for specific users on qpost

Parameters
  • query – The search query to use

  • offset – The offset to use for the query

  • limit – The maximum objects to return

Returns

list[User]

search_feeds(query: str, offset: int = None, limit: int = None)

Searches for specific posts on qpost

Parameters
  • query – The search query to use

  • offset – The offset to use for the query

  • limit – The maximum objects to return

Returns

list[FeedEntry]

share(postid: int)

Creates a new share from the current user to a specific FeedEntry

Parameters

postid – The ID of the target FeedEntry

Returns

FeedEntry

unshare(postid: int)

Deletes a share from the current user to a specific FeedEntry

Parameters

postid – The ID of the target FeedEntry (parent)

me()

Gets the curent User object

Returns

User