stips packageο
Submodulesο
stips.client moduleο
π οΈ 12/08/2023 The main client class, provides access to all of stipsβs API endpoints.
- class stips.client.StipsClient(email: str | None = None, password: str | None = None, cookies: str | dict | None = None, safe_filter: bool = False)ο
Bases:
objectA client class provides access to stipsβs API endpoints. Both non-user and user methods are available.
- To use user methods you must pass either a pair of email & password, or auth cookies:
StipsClient(email=βmy.email@gmail.comβ, password=βmypasswordβ)
StipsClient(cookies=βLogin%5FUser=hashedpassword=β¦β)
- Parameters:
email β email for authentication, must go with the password param
password β password for authentication, must go with the email param
cookies β cookies for authentication, can be either a dictionary or the raw string (document.cookie)
safe_filter β whether to use the safe filter option when fetching content
- answer(question_id: int, text: str, name: str = None, link_url: str = None, link_name: str = None, anonymous: bool = False, **kw) intο
Add an answer to a Question
- Parameters:
question_id β The Question ID to add the answer to
text β The answer content
name β The Username to send the answer as, works with anonymous=True
link_url β The URL of the Link
link_name β The URL Title of the Link
anonymous β Whether or not to send the answer anonymously
- ask(title: str, content: str = '', name: str = '', photo: str = None, link: str = '', tags: list = [], anonymous: bool = False, **kw) intο
Ask a Question
- Parameters:
title β The question to ask
content β The additional content for the question
name β The Username to ask the Question as
photo β The unsplash photo
link β The link in the question
tags β The questionβs tags
anonymous β Whether or not to post the question Anonymously
- can_send_penfriends(**kw) PenfriendsLimitο
Check if you can send any Penfriends Message (Due to Time Limit).
If allowed, then minutes_left will be a negative number (~minutes since last pen)
- decline_reports(id: int, **kw) boolο
Decline/Remove all reports of an item from the reports list
- Parameters:
id β The item id to decline reports for
- delete_answer(id: int, title: str = '', points: int | None = None, message: str = '', ban: bool = False, **kw) boolο
Delete an answers
- Parameters:
id β The answer id to delete
title β Title reason
points β Points to remove
message β Message reason
ban β Whether to ban the user for 24 hours
:returns Whether successfully deleted the answer
- delete_penfriend(id: int, title: str = '', points: int | None = None, message: str = '', ban: bool = False, fake_delete: bool = False, **kw) boolο
Delete a penfriends item
- Parameters:
id β The penfriend item id to delete
title β Title reason
points β Points to remove
message β Message reason
ban β Whether to ban the user for 24 hours
fake_delete β If this is true, the item will not be deleted but a notification will be sent to the author
:returns Whether successfully deleted the penfriends item
- delete_question(id: int, title: str = '', points: int | None = None, message: str = '', ban: bool = False, **kw) boolο
Delete a question
- Parameters:
id β The question id to delete
title β Title reason
points β Points to remove
message β Message reason
ban β Whether to ban the user for 24 hours
:returns Whether successfully deleted the question
- delete_thank(id: int, title: str = '', points: int | None = None, message: str = '', ban: bool = False, fake_delete=False, **kw) boolο
Delete a wall item
- Parameters:
id β The wall item id to delete
title β Title reason
points β Points to remove
message β Message reason
ban β Whether to ban the user for 24 hours
fake_delete β If this is true, the item will not be deleted but a notification will be sent to the author
:returns Whether successfully deleted the wall item
- disable_question_notifications(id: int, **kw) boolο
Disable receiving Question Notifications
- Parameters:
id β The Question ID to Disable the Notifications in
- disable_safe_mode(user_id: int = None, **kw) boolο
Disable Safe Mode
- Parameters:
user_id β The User ID to Disable Safe Mode for (I assume admins can change peopleβs safe mode setting)
- downvote(id: int, **kw) boolο
Downvote an answer
- Parameters:
id β The Answer ID to downvote
- edit_answer(id: int, text: str, name: str, link_url: str = None, link_name: str = None, **kw) boolο
Edit an answer
- Parameters:
id β The Answer ID to edit
text β The answer content
link1 β The URL of the Link
link1name β The URL Title of the Link
- edit_question(id: int, title: str = None, content: str = None, tags: list = None, photo: str = None, **kw) boolο
Modify a Question
- Parameters:
id β The Question to Modify
title β The question title
content β The additional content for the question
tags β The questionβs tags
photo β The unsplash photo
- edit_wall(text: str, user_id: int = None, **kw) boolο
Edit wall content (bio)
- Parameters:
text_status β The wall content (bio content)
user_id β The User ID to edit the wall content (I assume admins can edit peopleβs wall)
- enable_question_notifications(id: int, **kw) boolο
Enable receiving Question Notifications
- Parameters:
id β The Question ID to Enable the Notifications in
- enable_safe_mode(user_id: int = None, **kw) boolο
Enable Safe Mode
- Parameters:
user_id β The User ID to Enable Safe Mode for (I assume admins can change peopleβs safe mode setting)
- flower(id: int, **kw) boolο
Send a Flower to an Answer
- Parameters:
id β The Message ID to send the Flower to
- get_answer_history(id: int, page: int = 1, **kw) List[RevisionAnswer]ο
Get a Answerβs History
- Parameters:
id β The ID of the Answer to get the History from
page β Items page to get (Gets first page by default)
- get_answers(question_id: int, page: int = 1, **kw) List[Answer]ο
Get answers for a question
- Parameters:
question_id β The Question ID to receive answers from
page β Items page to get (Gets first page by default)
- get_category_hot_questions(channel: ChannelType | str, section: TimeType | str = TimeType.week, page: int = 1, **kw) List[Question]ο
Get hot questions in a certain category
- Parameters:
channel β The category to get questions from
section β Filter hot questions type (week, month)
page β Items page to get (Gets first page by default)
- get_category_new_questions(channel: ChannelType | str, page: int = 1, **kw) List[Question]ο
Get new questions in a certain category
- Parameters:
channel β The category to get questions from
page β Items page to get (Gets first page by default)
- get_channels(use_cache: bool = True, **kw) List[ChannelConfig]ο
Get a list of the channels that are shown in the right navbar
- Parameters:
use_cache β Whether to use the cache for better performance but a chance for misleading data
- get_contacts(page: int = 1, get_all: bool = True, **kw) List[User]ο
Get Users that the User has Texted With
- Parameters:
page β Items page to get (Gets first page by default)
get_all β Whether to recieve all users at once, will ignore the page argument if set to True
- get_hot_questions(section: TimeType | str = TimeType.now, page: int = 1, **kw) List[Question]ο
Get hot questions
- Parameters:
section β Filter hot questions type (now, today, week)
page β Items page to get (Gets first page by default)
- get_images_gallery(tags: list, **kw) List[GalleryImage]ο
Get images loaded/generated/filtered by tags
- Parameters:
tags β The tags to load the images from
- get_messages(user_id: int, message_id: int = 0, first_load: bool = False, history: bool = False, **kw) bool | List[MessageItem]ο
Get Private Messages from a User
- Parameters:
user_id β The User ID to get the Private Messages from
message_id β The Message ID to receive the Messages Since (ie: msgid=15 all messages_id >= 15 will be returned). If set to 0 first_load
first_load β Whether to load most recent (22?) messages, can be used with message_id=0
history β Whether fetching historical messages
- Returns:
A list of messages OR False if the user is blocked
- get_messages_list(page: int = 1, **kw) List[MessagesListItem]ο
Get most recent Users that the User has Texted With
- Parameters:
page β Items page to get (Gets first page by default)
- get_new_questions(page: int = 1, **kw) List[Question]ο
Get new questions
- Parameters:
page β Items page to get (Gets first page by default)
- get_notifications_count(**kw) NotificationsCountο
Get notifications
- get_notifications_list(page: int = 1, **kw) List[NotificationItem]ο
Get notifications list
- Parameters:
page β Items page to get (Gets first page by default)
- get_penfriend(id: int, **kw) PenfriendsItemο
Get a penfriends item
- Parameters:
id β The ID of the penfriends item
- get_penfriends(page: int = 1, **kw) List[PenfriendsItem]ο
Get Penfriends Messages
- Parameters:
page β Items page to get (Gets first page by default)
- get_profile(user_id: int, **kw) Profileο
Get public profile details for a user (age, answers, badges, flowers, active_since, questions, status)
- Parameters:
user_id β The User ID to check the details for
- get_profile_activity(user_id: int, action: ActivityType | str = ActivityType.answers, **kw) List[ChartData]ο
Get User activity
- Parameters:
user_id β The User ID to get activity from
action β The activity action to get (ans, ask, flowers)
- get_question(id: int, **kw) Questionο
Get info about a question
- Parameters:
id β The Question ID to receive data from
- get_question_history(id: int, page: int = 1, **kw) List[RevisionQuestion]ο
Get a Questionβs History
- Parameters:
id β The ID of the Question to get the History from
page β Items page to get (Gets first page by default)
- get_questions_limit(**kw) QuestionsLimitο
Get how many questions you have asked and if you can ask more (Stips limit: 10 Per Day)
- get_reports(page: int = 1, **kw) List[ReportItem]ο
Get reports list
- Parameters:
page β Items page to get (Gets first page by default)
- get_tags(title: str, **kw) List[str]ο
Get automatically generated tags by title
- Parameters:
title β The Title to generate the tags from
- get_user(id: int, **kw) Userο
Get more public profile details for a user (gender, photo, nickname, points, online, perm_blocked)
- Parameters:
user_id β The User ID to check the details for
- get_user_flowers(user_id: int, page: int = 1, **kw) List[Answer]ο
Get Userβs answers that were flowered
- Parameters:
user_id β The User ID to get flowered answers from
page β Items page to get (Gets first page by default)
- get_user_questions(section: MyQuestionType | str = MyQuestionType.asked, page: int = 1, **kw) List[Question]ο
Get questions by you (either βaskedβ, βansweredβ or βpinnedβ)
- Parameters:
section β Filter questions type (βaskedβ, βansweredβ, βpinnedβ)
page β Items page to get (Gets first page by default)
- get_user_thanks(user_id: int, page: int = 1, **kw) List[Thank]ο
Get wall messages
- Parameters:
user_id β The User ID to get wall messages from
page β Items page to get (Gets first page by default)
- has_questions_notifications(id: int, **kw) boolο
Check if you have Question Notifications Enabled or not
- Parameters:
id β The Question ID to Check the Notifications in
- pin(id: int, **kw) boolο
Add a pin to a question
- Parameters:
id β The Question ID to pin
- remove_profile_image(user_id: int = None, **kw) boolο
Remove current profile image
- Parameters:
user_id β The User ID to remove the profile image for
- remove_question_from_channel(id: int, channel_id: int = None, channel_name: str = None, **kw) boolο
Warns a questions author
- Parameters:
id β The id of the question to remove from the channel
channel_id β id of the channel that the question is attached to, channel name can be passed instead
channel_name β name of the channel that the question is attached to, channel id can be passed instead
:returns Whether successfully removed the question from the channel
- report_answer(id: int, reason: str, **kw) boolο
Report bad content
- Parameters:
id β The ID of the Answer reporting
reason β The reason for reporting
- report_question(id: int, reason: str, **kw) boolο
Report bad content
- Parameters:
id β The ID of the Question reporting
reason β The reason for reporting
- reset_vote(id: int, **kw) boolο
Resets votes for an answer
- Parameters:
id β The Answer ID to reset the votes for
- resize_profile_image(x0: int = 0, x1: int = 0, y0: int = 0, y1: int = 0, user_id: int = None, **kw) boolο
Resize a profile image
- Parameters:
x0 β Used to modify the image size in the first X coordinate
x1 β Used to modify the image size in the second X coordinate
y0 β Used to modify the image size in the first Y coordinate
y1 β Used to modify the image size in the second Y coordinate
user_id β The User ID to resize the profile image (I assume admins can resize peopleβs profile image)
- search_profile(keyword: str, fuzz=True, get_ratio=False, **kw) PartialUser | Noneο
Shortcut for the first item in search_profiles(keyword=keyword) :param keyword: The Keyword to search with :param fuzz: Try to find the closest match instead of getting the first result from search_profiles :param get_ratio: Whether to return the ratio for keyword and user name
- search_profiles(keyword: str, fuzz=True, get_ratio=False, **kw) List[PartialUser]ο
Search profiles (includes Full Usernames and IDs) by Username Keyword
- Parameters:
keyword β The Keyword to search with
fuzz β Whether to sort the results with a better search
get_ratio β Whether to return the ratio for keyword and user name
- search_topic(keyword: str, **kw) List[str]ο
Search for Questions Tags by Tag Keyword
- Parameters:
keyword β The Keyword to search with
- send_message(user_id: int, text: str, **kw) intο
Send a Private Message to a User
- Parameters:
user_id β The User ID to send the Message to
text β The Message to send to the User
- send_penfriends(text: str, **kw) intο
Send a Penfriends Message
- Parameters:
text β The Message to send
- send_thank(user_id: int, text: str, **kw) intο
Send wall message
- Parameters:
user_id β The User ID to send the wall message to
text β The Message to send
- set_answer_anonymous(id: int, **kw) boolο
Turn an Answer into Anonymous
- Parameters:
id β The Answer ID to set anonymous
- set_question_anonymous(id: int, **kw) boolο
Turn a Question into Anonymous
- Parameters:
id β The Question ID to set anonymous
- unpin(id: int, **kw) boolο
Remove a pin from a question
- Parameters:
id β The Question ID to unpin
- update_details(name: str = None, birth_date: datetime | str = None, gender: Gender | str = None, user_id: int = None, **kw) boolο
Update Details for a User
- Parameters:
name β The Userβs Nickname
birth_date β The Userβs Birth Date (DD/MM/YYYY eg. 17/05/2000)
gender β The Userβs Gender (male, female)
user_id β The User ID to update the details for (I assume admins can edit peopleβs details)
- upload_profile_image(image: str | BytesIO | bytes, **kw) boolο
Upload and validate an image
- Parameters:
image β Image to upload, can be either an Image URL, io.BytesIO object, bytes, or a Filename
04/01/2021: Implemented!
- upvote(id: int, **kw) boolο
Upvote an answer
- Parameters:
id β The Answer ID to upvote
- warn_answer(id: int, title: str = '', message: str = '', **kw) boolο
Warns an answers author
- Parameters:
id β The id of the answer to warn its author
title β Title reason
message β Message reason
:returns Whether successfully warned the answers author
- warn_question(id: int, title: str = '', message: str = '', **kw) boolο
Warns a questions author
- Parameters:
id β The id of the question to warn its author
title β Title reason
message β Message reason
:returns Whether successfully warned the questions author
stips.enums moduleο
π οΈ 12/08/2023 This module contains all the enums such as Rank, Gender, etcβ¦
- class stips.enums.ActivityType(value)ο
Bases:
ExtendedEnumGet the userβs activity based on their answers / questions / flowers
- answers = 'ans'ο
- flowers = 'flowers'ο
- questions = 'ask'ο
- class stips.enums.Badge(value)ο
Bases:
ExtendedEnumThe badge of the user
- custom = 'custom'ο
- moderator = 'moderator'ο
- old_expert = 'old_expert'ο
- senior_advisor = 'senior_advisor'ο
- senior_moderator = 'senior_moderator'ο
- class stips.enums.ChannelType(value)ο
Bases:
ExtendedEnumThe type of the channel
- internet = 'ΧΧΧ ΧΧ¨Χ Χ ΧΧΧΧ ΧΧΧΧΧΧ'ο
- music = 'ΧΧΧ‘ΧΧ§Χ'ο
- pets = 'ΧΧ’ΧΧ ΧΧΧΧ'ο
- philosophy = 'Χ€ΧΧΧΧ‘ΧΧ€ΧΧ'ο
- studies = 'ΧΧΧΧΧΧΧ'ο
- tv = 'Χ‘ΧΧ¨ΧΧͺ ΧΧ‘Χ¨ΧΧΧ'ο
- class stips.enums.ExtendedEnum(value)ο
Bases:
EnumAn enumeration.
- class stips.enums.Gender(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)ο
Bases:
MultiValueEnumThe gender of the user
- female = 2ο
- male = 0ο
- class stips.enums.ItemEditor(value)ο
Bases:
ExtendedEnumNotes who edited an item, a moderator or the owner of the item
- moderator = 2ο
- owner = 1ο
- class stips.enums.MyQuestionType(value)ο
Bases:
ExtendedEnumFetch questions that you asked / answered / pinned
- ansed = 'ansed'ο
- answered = 'ansed'ο
- asked = 'asked'ο
- pinned = 'pinned'ο
- class stips.enums.NotificationType(value)ο
Bases:
ExtendedEnumThe type of the notification
- answer_deleted = 2ο
- new_answer = 7ο
- new_flower = 8ο
- penfriends_deleted = 4ο
- question_deleted = 1ο
- report_accepted = 5ο
- thank_deleted = 3ο
- wall_message = 6ο
- class stips.enums.PhotoType(value)ο
Bases:
ExtendedEnumThe type of the photo builtin: The photo is stored in some database in the stipsβ server unsplash: The photo is taken from https://unsplash.com
- builtin = 1ο
- unsplash = 2ο
- class stips.enums.Rank(value)ο
Bases:
ExtendedEnumThe rank of the user (if any)
- admin = 3ο
- moderator = 1ο
- senior_moderator = 2ο
- class stips.enums.ReportType(value)ο
Bases:
ExtendedEnumThe type of the report
- answer = 2ο
- question = 1ο
- class stips.enums.Role(value)ο
Bases:
ExtendedEnumNotes who deleted an item, a moderator or the system
- moderators = 1ο
- system = 2ο
- class stips.enums.TimeType(value)ο
Bases:
ExtendedEnumFetch questions by TimeType (now, today, week, month)
- month = 'month'ο
- now = 'now'ο
- today = 'today'ο
- week = 'week'ο
- stips.enums.get_enum(var)ο
stips.errors moduleο
π οΈ 12/08/2023 Contains custom library errors
- exception stips.errors.AnonymousPartialUserο
Bases:
StipsExceptionPartialUser is anonymous so no user id
- exception stips.errors.HttpUnknownο
Bases:
StipsExceptionStips fucks up
- exception stips.errors.InvalidCredentialsο
Bases:
StipsExceptionInvalid email / password
- exception stips.errors.InvalidImageο
Bases:
StipsExceptionInvalid image provided
- exception stips.errors.MissingCredentialsο
Bases:
StipsExceptionNeither email & password or cookies were provided
- exception stips.errors.NoAccountο
Bases:
StipsExceptionCookies not provided
- exception stips.errors.NotAModeratorο
Bases:
StipsExceptionβNot a moderator
- exception stips.errors.StipsExceptionο
Bases:
ExceptionBase of Stips Exceptions
stips.helpers moduleο
π οΈ 12/08/2023 Helpers decorators for the HTTP functions.
- class stips.helpers.ABCHelpersο
Bases:
object- moderator_endpoint()ο
The moderator_endpoint decorator notes that the function is a moderator method and requires the user to be a moderator (or above)
- require_cookies()ο
The require_cookies decorator notes that the function is a user method and required either cookies or email&password to be passed to the class.
- safe_filter()ο
The safe_filter decorator passes the safe_filter parameter to the function based on the configuration in StipsClient.
stips.models moduleο
π οΈ 12/08/2023 All the models are created by methods from the formatter.py file. These models represent the data that is returned from the API, and some of them (like the User class) allow chaining methods.
Exmaple: ```py from stips import StipsClient
bot = StipsClient(email=ββ¦β, password=ββ¦β)
user = bot.get_user(id=123456) profile = user.get_profile() # chaining ```
- class stips.models.Answer(_state: StipsClient, id: int, question_id: int, question_url: str, question_title: Optional[str], text: str, anonymous: bool, deleted: Union[bool, DeletedItem], link: Optional[Link], author: PartialUser, flowered: bool, time: datetime.datetime, hebrew_time: str, has_revisions: bool, votes: int, upvotes: int, downvotes: int, me_vote: int, permissions: Permissions)ο
Bases:
objectRepresents an answer
- Parameters:
_state β The state of the client to use for methods
id β The id of the answer
question_id β The id of the question the answer belongs to
question_url β The url of the question the answer belongs to
question_title β The title of the question the answer belongs to
text β The text of the answer
anonymous β Whether the answer is anonymous
deleted β Whether the answer is deleted, and information in case it is
link β The link in the answer (if there is)
author β The author of the answer (partial)
flowered β Whether the answer is flowered
time β The time the answer was posted
hebrew_time β The hebrew time the answer was posted
has_revisions β Whether the answer has revisions (was edited)
votes β The amount of votes the answer has that is displayed (upvotes - downvotes)
upvotes β The amount of upvotes the answer has
downvotes β The amount of downvotes the answer has
me_vote β The vote of the client (if there is)
permissions β The permissions of the client on the answer
- anonymous: boolο
- author: PartialUserο
- delete(title: str = '', points: int | None = None, message: str = '', ban: bool = False, **kw) boolο
- deleted: Union[bool, DeletedItem]ο
- downvote(**kw) boolο
- downvotes: intο
- edit(text: str, name: str, link_url: str | None = None, link_name: str | None = None, **kw) boolο
- flower(**kw) boolο
- flowered: boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- has_revisions: boolο
- hebrew_time: strο
- history(page: int = 1, **kw) List[RevisionAnswer]ο
- id: intο
- me_vote: intο
- permissions: Permissionsο
- question_id: intο
- question_title: Optional[str]ο
- question_url: strο
- report(reason: str, **kw) boolο
- reset_vote(**kw) boolο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- set_anonymous(**kw) boolο
- text: strο
- time: datetime.datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- upvote(**kw) boolο
- upvotes: intο
- votes: intο
- warn(title: str = '', message: str = '', **kw) boolο
- class stips.models.AppUser(id: int, ban: bool | Ban, birth_date: datetime, rank: Rank | None, permissions: dict, phone_validated: bool, points: int, safe_filter: bool, email: str, flowers: int, gender: Gender)ο
Bases:
objectRepresents the client details
- Parameters:
id β The id of the client
ban β Whether the client is banned, and information in case it is
birth_date β The birth date of the client
rank β The rank of the client
permissions β The permissions of the client
phone_validated β Whether the client validated their phone
points β The points of the client
safe_filter β Whether the client has the safe filter on
email β The email of the client
flowers β The amount of flowers the client has
gender β The gender of the client
- birth_date: datetimeο
- email: strο
- flowers: intο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: intο
- permissions: dictο
- phone_validated: boolο
- points: intο
- safe_filter: boolο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.Ban(reason: str, ends_at: datetime | None)ο
Bases:
objectRepresents a ban
- Parameters:
reason β The reason of the ban
ends_at β The time the ban ends at (unless permanent)
- ends_at: datetime | Noneο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- reason: strο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.ChannelConfig(id: int, name: str, background_color_css: str, background_url: str, icon_name: str, no_channel_remove_notification: bool, slogan: Any | None)ο
Bases:
objectRepresents a channelβs config from the remote config
- Parameters:
id β The id of the channel
name β The name of the channel (ΧΧΧ‘ΧΧ§Χ, ΧΧΧ ΧΧΧΧΧΧ, β¦)
background_color_css β The background color of the channel in css format
background_url β The background url of the channel
icon_name β The icon name of the channel
no_channel_remove_notification β Whether the user that asked a question in this channel, and it got removed should get a notification
slogan β The slogan of the channel (not sure what it could be yet)
- background_color_css: strο
- background_url: strο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- icon_name: strο
- id: intο
- name: strο
- no_channel_remove_notification: boolο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- slogan: Any | Noneο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.ChartData(time: datetime, count: int)ο
Bases:
objectRepresents a data item as part of a chart (user answers, questions, flowers)
- Parameters:
time β Data item time
count β Data item value
- count: intο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.ContactUserItem(_state: StipsClient, id: int, url: str, gender: Gender, photo: Optional[UserPhoto], photo_updated_stamp: Optional[datetime.datetime], points: int, online: bool, name: str, permissions: Permissions, blocked: bool)ο
Bases:
UserRepresents a user in the contact list
- Parameters:
blocked β Whether the user is blocked
permissions β The permissions that the client has on the user
β¦ rest of the params are the same as User
- blocked: boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- permissionsο
alias of
Permissions
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.DeletedItem(time: datetime, hebrew_time: str, reason: str, deletor: str, points: int)ο
Bases:
objectRepresents a deleted item
- Parameters:
time β The time the item was deleted
hebrew_time β The time the item was deleted in hebrew
reason β The reason the item was deleted
deletor β The user who deleted the item (or the role)
points β The amount of points the user lost
- deletor: strο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- points: intο
- reason: strο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.GalleryImage(id: int, url: str)ο
Bases:
objectRepresents an image from stipsβ database (gallery)
- Parameters:
id β The id of the image
url β The url of the image
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- class stips.models.Link(url: str, name: str | None = None)ο
Bases:
objectRepresents a link in a question or an answer
- Parameters:
url β The url of the link
name β The name of the link (that is displayed)
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- name: str | None = Noneο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- class stips.models.MessageItem(id: int, from_id: int, to_id: int, time: datetime, hebrew_time: str, view_time: datetime | None, text: str)ο
Bases:
objectRepresents a message in a DM
- Parameters:
id β The id of the message
from_id β The id of the user that sent the message
to_id β The id of the user that received the message
time β The time the message was sent
hebrew_time β The hebrew time the message was sent
view_time β The time the message was viewed
text β The text of the message
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- from_id: intο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_id: intο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- view_time: datetime | Noneο
- class stips.models.MessagesListItem(id: int, is_me_last_message: bool, from_user: PartialUser, me_id: int, time: datetime, hebrew_time: str, view_time: datetime | None, new_messages_count: int, last_message: str, url: str | None = None)ο
Bases:
objectRepresents a DM
- Parameters:
id β The id last message
from_user β The user that sent the last message
time β The time the last message was sent
hebrew_time β The hebrew time the last message was sent
view_time β The time the last message was viewed
new_messages_count β The amount of new messages
last_message β The last message sent (its content)
url β The url to the DM
is_me_last_message β Whether the last message was sent by the client
me_id β The id of the client
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- from_user: PartialUserο
- hebrew_time: strο
- id: intο
- is_me_last_message: boolο
- last_message: strο
- me_id: intο
- new_messages_count: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: str = Noneο
- view_time: datetime | Noneο
- class stips.models.NotificationItem(id: int, type: NotificationType, viewed: bool, time: datetime, click_url: str | None, link_item_id: int, real_item_id: int, text: str, message: str, points: int)ο
Bases:
objectRepresents a notification item (ΧΧͺΧ¨ΧΧ)
- Parameters:
id β The id of the notification item
type β The type of the notification item
viewed β Whether the notification item was viewed
time β The time the notification item was sent
click_url β The url that the notification item will redirect to when clicked
link_item_id β The id of the item that the notification item links to
real_item_id β if link_item_id is an answer, then the real_item_id is the id of its question
text β The text of the notification item
message β The message of the notification item
points β The points that were taken from the user in the notification (ΧΧΧ©Χ ΧΧΧΧ§Χ)
- click_url: str | Noneο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: intο
- link_item_id: intο
- message: strο
- points: intο
- real_item_id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- type: NotificationTypeο
- viewed: boolο
- class stips.models.NotificationsCount(messages: int, notifications: int)ο
Bases:
objectRepresents the notifications in the bell and the chats icons
- Parameters:
messages β The amount of unread messages that the client has
notifications β The amount of unread notifications that the client has
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- messages: intο
- notifications: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.PartialQuestion(id: int, title: str)ο
Bases:
objectRepresents a partial question
- Parameters:
id β The id of the question
title β The title of the question
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- title: strο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.PartialUser(_state: StipsClient, anonymous: bool, id: Optional[int], name: Optional[str], online: Optional[bool], photo: Optional[str], is_question_owner: Optional[bool], gender: Optional[Gender], ratio: Optional[float] = None)ο
Bases:
UserIdMethodsRepresents a partial user
- Parameters:
_state β The state of the client to use for methods
anonymous β Whether the user is anonymous
id β The userβs id
name β The userβs name
online β Whether the user is online
photo β The userβs photo
is_question_owner β Whether the user is the owner of the question
gender β The userβs gender
- anonymous: boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: Optional[int]ο
- is_question_owner: Optional[bool]ο
- name: Optional[str]ο
- online: Optional[bool]ο
- photo: Optional[str]ο
- ratio: Optional[float] = Noneο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.PenfriendsItem(_state: StipsClient, id: int, time: datetime.datetime, hebrew_time: str, author: PartialUser, text: str)ο
Bases:
objectRepresents a penfriends item (ΧΧΧΧ¨ΧΧ ΧΧ’Χ)
- Parameters:
_state β The state of the client to use for methods
id β The id of the penfriends item
time β The time the penfriends item was sent
hebrew_time β The hebrew time the penfriends item was sent
author β The author of the penfriends item
text β The text of the penfriends item
- author: PartialUserο
- delete(title: str = '', points: int | None = None, message: str = '', ban: bool = False, fake_delete: bool = False, **kw) boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- time: datetime.datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.PenfriendsLimit(allowed: bool, minutes_left: int, allowed_every: int)ο
Bases:
objectRepresents the penfriends limit of the client
- Parameters:
allowed β Whether the client is allowed to post a penfriends item
minutes_left β The amount of minutes left until the client can post a penfriends item
allowed_every β The amount of minutes the client has to wait between posting penfriends items
- allowed: boolο
- allowed_every: intο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- minutes_left: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.Permissions(ban: bool, delete: bool, delete_without_notification: bool, edit: bool, owner: bool, report: bool, admin_messages: bool)ο
Bases:
objectRepresents the permissions of a user
- Parameters:
ban β Whether the user can ban the author
delete β Whether the user can delete the item
delete_without_notification β Whether the user can delete without notification
edit β Whether the user can edit the item
owner β Whether the user is the owner of the item
report β Whether the user can report the item
admin_messages β Whether the user can view admin messages (if there are)
- admin_messages: boolο
- ban: boolο
- delete: boolο
- delete_without_notification: boolο
- edit: boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- owner: boolο
- report: boolο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.Photo(type: PhotoType, url: str, url_small: str | None, creator_name: str | None, creator_username: str | None)ο
Bases:
objectRepresents a photo
- Parameters:
type β The type of the photo
url β The url of the photo
url_small β The url of the small photo (unsplash only)
creator_name β The name of the creator of the photo (unsplash credits)
creator_username β The username of the creator of the photo (unsplash credits)
- creator_name: str | Noneο
- creator_username: str | Noneο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- url_small: str | Noneο
- class stips.models.Profile(_state: StipsClient, id: Optional[int], url: str, age: int, birth_year: int, questions: int, answers: int, flowers: int, badges: List[Badge], created_at: datetime.datetime, status: Status, hide_age: Optional[bool] = None, hide_stats: Optional[bool] = None)ο
Bases:
UserIdMethodsRepresents a userβs profile
- Parameters:
_state β The state of the client to use for methods
id β The id of the user
url β The url to the userβs profile
age β The age of the user
birth_year β The birth year of the user
questions β The amount of questions the user asked
answers β The amount of answers the user answered
flowers β The amount of flowers the user has
badges β The badges the user has
created_at β The time the user created their account
status β The status of the user
- age: intο
- answers: intο
- birth_year: intο
- created_at: datetime.datetimeο
- flowers: intο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hide_age: Optional[bool] = Noneο
- hide_stats: Optional[bool] = Noneο
- id: Optional[int]ο
- questions: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- class stips.models.Question(_state: StipsClient, id: int, url: str, anonymous: bool, answer_count: int, pin_count: int, deleted: Union[bool, DeletedItem], title: str, link: Optional[Link], has_revisions: bool, safe_filter: bool, tags: List[str], content: str, time: datetime.datetime, hebrew_time: str, author: PartialUser, me_pinned: bool, photo: Photo, permissions: Permissions)ο
Bases:
objectRepresents a question
- Parameters:
_state β The state of the client to use for methods
id β The id of the question
url β The url of the question
anonymous β Whether the question is anonymous
answer_count β The amount of answers the question has
pin_count β The amount of pins the question has
deleted β Whether the question is deleted, and information in case it is
title β The title of the question
link β The link in the question (if there is)
has_revisions β Whether the question has revisions (was edited)
safe_filter β Whether the question triggers the safe filter
tags β The tags of the question
content β The content of the question
time β The time the question was posted
hebrew_time β The hebrew time the question was posted
author β The author of the question (partial)
me_pinned β Whether the client pinned the question
photo β The photo of the question
permissions β The permissions of the client on the question
- anonymous: boolο
- answer(text: str, name: str | None = None, link_url: str | None = None, link_name: str | None = None, anonymous: bool = False, **kw) intο
- answer_count: intο
- author: PartialUserο
- content: strο
- delete(title: str = '', points: int | None = None, message: str = '', ban: bool = False, **kw) boolο
- deleted: Union[bool, DeletedItem]ο
- disable_notifications(**kw) boolο
- edit(title: str | None = None, content: str | None = None, tags: list | None = None, photo: str | None = None, **kw) boolο
- enable_notifications(**kw) boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- has_notifications(**kw) boolο
- has_revisions: boolο
- hebrew_time: strο
- history(page: int = 1, **kw) List[RevisionQuestion]ο
- id: intο
- me_pinned: boolο
- permissions: Permissionsο
- pin(**kw) boolο
- pin_count: intο
- remove_from_channel(channel_id: int | None = None, channel_name: str | None = None, **kw) boolο
- report(reason: str, **kw) boolο
- safe_filter: boolο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- set_anonymous(**kw) boolο
- tags: List[str]ο
- time: datetime.datetimeο
- title: strο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- unpin(**kw) boolο
- url: strο
- warn(title: str = '', message: str = '', **kw) boolο
- class stips.models.QuestionsLimit(allowed: bool, current: int, max: int)ο
Bases:
objectRepresents the questions limit of the client
- Parameters:
allowed β Whether the client is allowed to ask any more questions
current β The amount of questions the client asked today
max β The max amount of questions the client can ask today (likely 10)
- allowed: boolο
- current: intο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- max: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.RemoteConfig(channels: List[ChannelConfig])ο
Bases:
objectRepresents the remote config (currently I know only about channels)
- Parameters:
channels β The channels (listed on the top right sidebar)
- channels: List[ChannelConfig]ο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.ReportItem(_state: StipsClient, id: int, type: ReportType, question: Optional[Question], answer: Optional[Answer], partial_question: Optional[PartialQuestion], reason: str, author: PartialUser, time: datetime.datetime, hebrew_time: str, permissions: Permissions, item: Union[Question, Answer] = None)ο
Bases:
objectRepresents a report item (question/answer)
- Parameters:
_state β The state of the client to use for methods
id β The id of the report item
type β The type of the report item
question β The question of the report item
answer β The answer of the report item
partial_question β The partial question of the report item
reason β The reason for the report
author β The author of the report
time β The time the report was sent
hebrew_time β The hebrew time the report was sent
permissions β The permissions that the client has on the report
item β The item that was reported
- author: PartialUserο
- decline(**kw) boolο
- delete(title: str = '', points: int | None = None, message: str = '', ban: bool = False, **kw) boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- partial_question: Optional[PartialQuestion]ο
- permissions: Permissionsο
- reason: strο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- time: datetime.datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- type: ReportTypeο
- class stips.models.RevisionAnswer(editor: ItemEditor, id: int, answer_id: int, text: str, link: Link | None, time: datetime, hebrew_time: str, author: PartialUser, permissions: Permissions)ο
Bases:
objectRepresents an answer revision (edit)
- Parameters:
editor β The editor of the answer (moderator or the author)
id β The id of the revision
answer_id β The id of the answer
text β The text of the answer
link β The link in the answer
time β The time the revisioned answer was made
hebrew_time β The hebrew time the revisioned answer was made
author β The author of the revisioned answer (partial)
permissions β The permissions that the client has on the revisioned answer
- answer_id: intο
- author: PartialUserο
- editor: ItemEditorο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- permissions: Permissionsο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- time: datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.RevisionQuestion(editor: ItemEditor, id: int, question_id: int, title: str, content: str, tags: List[str], photo: Photo, link: Link | None, channel_id: int, time: datetime, hebrew_time: str, author: PartialUser, permissions: Permissions)ο
Bases:
objectRepresents a question revision (edit)
- Parameters:
editor β The editor of the question (moderator or the author)
id β The id of the revision
question_id β The id of the question
title β The title of the question
content β The content of the question
tags β The tags of the question
photo β The photo of the question
link β The link in the question
channel_id β The id of the channel the question was in
time β The time the revisioned question was made
hebrew_time β The hebrew time the revisioned question was made
author β The author of the revisioned question (partial)
permissions β The permissions that the client has on the revisioned question
- author: PartialUserο
- channel_id: intο
- content: strο
- editor: ItemEditorο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- permissions: Permissionsο
- question_id: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- tags: List[str]ο
- time: datetimeο
- title: strο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.Status(name: str, text: str, last_modified: datetime | None, view: str | None = None)ο
Bases:
objectRepresents a wall status
- Parameters:
name β Who wrote the status (quote writer)
text β The text of the status
last_modified β The time the status was last modified
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- last_modified: datetime | Noneο
- name: strο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- view: str = Noneο
- class stips.models.Thank(_state: StipsClient, id: int, author: PartialUser, to_id: int, text: str, time: datetime.datetime, hebrew_time: str, permissions: Permissions)ο
Bases:
objectRepresents a thank (ΧΧ§ΧΧ¨ ΧΧͺΧΧΧΧͺ)
- Parameters:
_state β The state of the client to use for methods
id β The id of the thank
author β The author of the thank
to_id β The id of the user that the thank is for
text β The text of the thank
time β The time the thank was sent
hebrew_time β The hebrew time the thank was sent
permissions β The permissions that the client has on the thank
- author: PartialUserο
- delete(title: str = '', points: int | None = None, message: str = '', ban: bool = False, fake_delete: bool = False, **kw) boolο
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- hebrew_time: strο
- id: intο
- permissions: Permissionsο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- text: strο
- time: datetime.datetimeο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_id: intο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- class stips.models.User(_state: StipsClient, id: int, url: str, gender: Gender, photo: Optional[UserPhoto], photo_updated_stamp: Optional[datetime.datetime], points: int, online: bool, name: str, permissions: Permissions)ο
Bases:
UserIdMethodsRepresents a user
- Parameters:
_state β The state of the client to use for methods
id β The id of the user
url β The url to the userβs profile
photo β The photo of the user
photo_updated_stamp β The time that the userβs photo was updated
points β The points of the user
online β Whether the user is online
name β The name of the user
permissions β The permissions that the client has on the user
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- id: intο
- name: strο
- online: boolο
- permissions: Permissionsο
- photo_updated_stamp: Optional[datetime.datetime]ο
- points: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- class stips.models.UserIdMethodsο
Bases:
objectMethods that use self.id as the user id
- disable_safe_mode(*args, **kw)ο
- edit_wall(*args, **kw)ο
- enable_safe_mode(*args, **kw)ο
- get_activity(*args, **kw)ο
- get_flowers(*args, **kw)ο
- get_messages(*args, **kw)ο
- get_profile(*args, **kw)ο
- get_thanks(*args, **kw)ο
- get_user(*args, **kw)ο
- remove_profile_image(*args, **kw)ο
- resize_profile_image(*args, **kw)ο
- send_message(*args, **kw)ο
- send_thank(*args, **kw)ο
- update_details(*args, **kw)ο
- class stips.models.UserPhoto(user_id: int, photostamp: int, url: str)ο
Bases:
objectRepresents a user photo
- Parameters:
id β The user_id who the photo belongs to
photostamp β The upload photostamp of the photo
url β The url of the photo
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) Aο
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) Aο
- photostamp: intο
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]ο
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]ο
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) strο
- url: strο
- user_id: intο
- stips.models.check_user_id(func)ο
A decorator that forces the user in the model to not be anonymous, since you cannot run methods on anonymous users.
stips.pagetools moduleο
π οΈ 12/08/2023 Utility functions for HTTP methods that use a page parameter.
- stips.pagetools.iter_pages(func, one_at_a_time: bool = True, page_start: int = 1, yield_index: bool = False, **kw)ο
A function that returns an iterator for http methods that use a page paramater. The iterator will keep returning items until an empty list will be returned, or an error will be raised :param func: the http function to recieve data from :param one_at_a_time: if True, will return one item each time instead of the whole page :param page_start: page index to start at. defaults to 1 (first page) :param yield_index: whether to yield a tuple of (page_index, result) instead of just the result, if True along with RETURN_ITEMS, will yield (item_index, result) :param kw: arguments to pass to the http function, this simply uses functools.partial() so you can do that yourself if you wantβ¦
Example: ```py βββIterate over all thanks in a userβs profileβββ import stips from stips.pagetools import iter_pages
api = stips.StipsClient() user = api.get_user(244844)
- for thank in iter_pages(user.get_thanks):
print(thank.text) input(βPress enter to print the next thankβ¦β)
stips.utils moduleο
π οΈ 12/08/2023 Utility functions for the library.
- stips.utils.deleted(archived, meta)ο
Return whether an item is deleted, and incase it is, provide information.
- stips.utils.get_photo(user_id, photostamp)ο
Get a userβs photo by their id and the photoβs photostamp.
- stips.utils.hebrew_date(text) datetimeο
Translates an hebrew date representation to a date object.
- stips.utils.parse_cookies(cookies_string)ο
Parse a cookies string to a dictionary.
- stips.utils.to_time(time_str: str) datetimeο
Translates a time string to a datetime object.
- stips.utils.translate_badges(badges)ο
Translate a list of badges to a list of Badge enums.
- stips.utils.translate_ban(ban)ο
Translate a ban data to a clearer format
- stips.utils.translate_rank(rank)ο
Translate a rank to a Rank enum.
- stips.utils.translate_status(data)ο
Translate a raw userβs wall status to an object
- stips.utils.unsplash(photo: str | None = None) strο
Represent an Unsplash photo as a string.
- stips.utils.users_sort(keyword: str, results: Iterable[PartialUser], get_ratio: bool = False) List[PartialUser]ο
Sort a list of users by their similarity to a keyword.