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: object

A 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(id: int, **kw) Answer

Get an answer

Parameters:

id – The ID of the Answer

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_app_user(**kw) AppUser

Get Private Details of a User

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_home_questions(**kw) List[Question]

Get home page questions

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 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_thank(id: int, **kw) Thank

Get a wall thank message

Parameters:

id – The ID of the thank

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: ExtendedEnum

Get the user’s activity based on their answers / questions / flowers

answers = 'ans'
flowers = 'flowers'
questions = 'ask'
class stips.enums.Badge(value)

Bases: ExtendedEnum

The 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: ExtendedEnum

The type of the channel

internet = 'ΧΧ™Χ Χ˜Χ¨Χ Χ˜ Χ•Χ˜Χ›Χ Χ•ΧœΧ•Χ’Χ™Χ”'
music = 'ΧžΧ•Χ‘Χ™Χ§Χ”'
pets = 'Χ‘Χ’ΧœΧ™ חיים'
philosophy = 'Χ€Χ™ΧœΧ•Χ‘Χ•Χ€Χ™Χ”'
studies = 'ΧœΧ™ΧžΧ•Χ“Χ™Χ'
tv = 'Χ‘Χ“Χ¨Χ•Χͺ Χ•Χ‘Χ¨Χ˜Χ™Χ'
class stips.enums.ExtendedEnum(value)

Bases: Enum

An enumeration.

class stips.enums.Gender(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)

Bases: MultiValueEnum

The gender of the user

female = 2
male = 0
class stips.enums.ItemEditor(value)

Bases: ExtendedEnum

Notes who edited an item, a moderator or the owner of the item

moderator = 2
owner = 1
class stips.enums.MyQuestionType(value)

Bases: ExtendedEnum

Fetch questions that you asked / answered / pinned

ansed = 'ansed'
answered = 'ansed'
asked = 'asked'
pinned = 'pinned'
class stips.enums.NotificationType(value)

Bases: ExtendedEnum

The 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: ExtendedEnum

The 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: ExtendedEnum

The rank of the user (if any)

admin = 3
moderator = 1
senior_moderator = 2
class stips.enums.ReportType(value)

Bases: ExtendedEnum

The type of the report

answer = 2
question = 1
class stips.enums.Role(value)

Bases: ExtendedEnum

Notes who deleted an item, a moderator or the system

moderators = 1
system = 2
class stips.enums.TimeType(value)

Bases: ExtendedEnum

Fetch 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: StipsException

PartialUser is anonymous so no user id

exception stips.errors.HttpUnknown

Bases: StipsException

Stips fucks up

exception stips.errors.InvalidCredentials

Bases: StipsException

Invalid email / password

exception stips.errors.InvalidImage

Bases: StipsException

Invalid image provided

exception stips.errors.MissingCredentials

Bases: StipsException

Neither email & password or cookies were provided

exception stips.errors.NoAccount

Bases: StipsException

Cookies not provided

exception stips.errors.NotAModerator

Bases: StipsException

β€œNot a moderator

exception stips.errors.StipsException

Bases: Exception

Base 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: object

Represents 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: object

Represents 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

ban: bool | Ban
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
gender: Gender
id: int
permissions: dict
phone_validated: bool
points: int
rank: Rank | None
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: object

Represents 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: object

Represents 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: object

Represents 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: User

Represents 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: object

Represents 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: object

Represents 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

Bases: object

Represents 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: object

Represents 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: object

Represents 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: object

Represents 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
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: object

Represents 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: object

Represents 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: UserIdMethods

Represents 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
gender: Optional[Gender]
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: object

Represents 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: object

Represents 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: object

Represents 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: object

Represents 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
type: PhotoType
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: UserIdMethods

Represents 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
badges: List[Badge]
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]
status: Status
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: object

Represents 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
answers(page: int = 1, **kw) List[Answer]
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
photo: Photo
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: object

Represents 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: object

Represents 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: object

Represents 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

answer: Optional[Answer]
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
item: Union[Question, Answer] = None
partial_question: Optional[PartialQuestion]
permissions: Permissions
question: Optional[Question]
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: object

Represents 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: object

Represents 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
photo: Photo
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: object

Represents 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: object

Represents 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: UserIdMethods

Represents 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
gender: Gender
id: int
name: str
online: bool
permissions: Permissions
photo: Optional[UserPhoto]
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: object

Methods 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: object

Represents 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.

Module contents