WeverseClient
- class weverse.WeverseClient(email: str, password: str, stream_interval: float = 20)
The Weverse Client that interacts with the official Weverse API.
- email
The email of the Weverse account to login with.
- Type
str
- password
The password of the Weverse account to login with.
- Type
str
- stream_interval
The interval in querying the Weverse API for new notifications, in seconds.
- Type
float
- property login_payload: dict
Returns the login payload used to login to Weverse.
- Type
dict
- async fetch_latest_notifications() list[weverse.objects.notification.Notification]
Fetches the latest notifications from Weverse’s API.
- Returns
A list that contains the
notification.Notificationobjects of the latest Weverse notifications.- Return type
- async fetch_notification(notification_id: int) Notification
Fetches a Weverse Notification from Weverse’s API using its ID.
- Parameters
notification_id (
int) – The notification ID of the notification to fetch.- Returns
The
notification.Notificationobject of the requested Weverse Notification.- Return type
- Raises
NotFound – If the requested Weverse Notification does not exist.
- async fetch_new_notifications() tuple[list[weverse.objects.notification.Notification], list[weverse.objects.comment.Comment]]
Fetches the list of new Weverse Notifications from all communities that the signed-in account has access to.
- Returns
A tuple that contains a list of new
notification.Notificationobjects and a list of newcomment.Commentobjects.- Return type
tuple[list[
notification.Notification], list[comment.Comment]]
Notes
The reason why
comment.Commentobjects are returned for comment-related notifications and notnotification.Notificationobjects is because Weverse does not provide an easy way to determine which comment-related notifications are new. As such, in the post-processing of comment-related notifications, the actualcomment.Commentobjects have to be fetched so that we know which comments are new.
- async fetch_joined_communities() list[weverse.objects.community.PartialCommunity]
Fetches the joined communities from Weverse’s API.
- Returns
A list that contains the
community.PartialCommunityobjects of the joined Weverse communities.- Return type
Notes
If more information is required about the communities, you can make use of the
fetch_community()method.
- async fetch_community(community_id: int) Community
Fetches a Weverse Community from Weverse’s API using its ID.
- Parameters
community_id (
int) – The community ID of the community to fetch.- Returns
The
community.Communityobject of the requested Weverse Community.- Return type
- Raises
- async fetch_artists(community_id: int) list[weverse.objects.member.Artist]
Fetches a list of artists that belong to a Weverse Community from Weverse’s API using the community ID.
- Parameters
community_id (
int) – The community ID of the community to fetch the artists from.- Returns
A list that contains the
member.Artistobjects of the specified Weverse community.- Return type
list[
member.Artist]- Raises
- async fetch_post(post_id: str) Post
Fetches a Weverse Post from Weverse’s API using its ID.
- Parameters
post_id (
str) – The post ID of the post to fetch.- Returns
The
post.Postobject of the requested Weverse Post.- Return type
- Raises
- async fetch_media(media_id: str) weverse.objects.media.ImageMedia | weverse.objects.media.WeverseMedia | weverse.objects.media.YoutubeMedia
Fetches a Weverse Media from Weverse’s API using its ID.
- Parameters
media_id (
str) – The media ID of the media to fetch.- Returns
Can be either a
media.ImageMedia,media.WeverseMediaormedia.YoutubeMediaobject of the requested Weverse Media depending on the type of media it is.- Return type
- Raises
- async fetch_live(live_id: str) Live
Fetches a Weverse Live Broadcast from Weverse’s API using its ID.
- Parameters
live_id (
str) – The live ID of the live broadcast to fetch.- Returns
The
live.Liveobject of the requested Weverse Live Broadcast- Return type
- Raises
- async fetch_moment(moment_id: str) weverse.objects.moment.Moment | weverse.objects.moment.OldMoment
Fetches a Weverse Moment from Weverse’s API using its ID.
- Parameters
moment_id (
str) – The moment ID of the moment to fetch.- Returns
The
moment.Momentormoment.OldMomentobject of the requested Weverse moment depending on the type of moment it is.- Return type
- Raises
- async fetch_video_url(video_id: str) str
Fetches a Weverse Post Video URL by its ID.
- Parameters
video_id (
str) – The ID of the video to fetch.- Returns
The URL of the video.
- Return type
str
Notes
An additional API call has to be made because unlike images, Weverse does include the URL to videos in the response for posts.
- async fetch_notice(notice_id: int) Notice
Fetches a Weverse Notice from Weverse’s API using its ID.
- Parameters
notice_id (
int) – The notice ID of the notice to fetch.- Returns
The
notice.Noticeobject of the requested Weverse Notice.- Return type
- Raises
- async fetch_member(member_id: str) Member
Fetches a Weverse Member from Weverse’s API using its ID.
- Parameters
member_id (
str) – The member ID of the member to fetch.- Returns
The
member.Memberobject of the requested Weverse Member.- Return type
- Raises
NotFound – If the requested Weverse Member does not exist.
- async fetch_comment(comment_id: str) Comment
Fetches a Weverse Comment from Weverse’s API using its ID.
- Parameters
comment_id (
str) – The comment ID of the comment to fetch.- Returns
The
comment.Commentobject of the requested Weverse Comment.- Return type
- Raises
- async fetch_artist_comments(post_id: str) list[weverse.objects.comment.Comment]
Fetches a list of Weverse Artist Comments from a specific post from Weverse’s API using the post ID.
- Parameters
post_id (
str) – The post ID of the post to fetch the artist comments from.- Returns
The list that contains the
comment.Commentobjects of the Weverse Artist Comment that belong to the specified post.- Return type
list[
comment.Comment]- Raises
- async start() Task
Starts the Weverse Client.
- stop() None
Disconnects the Weverse Client.
- async on_new_notification(notification: Notification) None
This method is called when a new notification is detected. You can overwrite this method to do what you want with the new notification.
- async on_new_post(post: Post) None
This method is called when a new post is detected. You can overwrite this method to do what you want with the new post.
- async on_new_moment(moment: weverse.objects.moment.Moment | weverse.objects.moment.OldMoment) None
This method is called when a new moment is detected. You can overwrite this method to do what you want with the new moment.
- async on_new_media(media: weverse.objects.media.ImageMedia | weverse.objects.media.WeverseMedia | weverse.objects.media.YoutubeMedia) None
This method is called when a new media is detected. You can overwrite this method to do what you want with the new media.
- async on_new_live(live: Live) None
This method is called when a new live is detected. You can overwrite this method to do what you want with the new live.
- async on_new_notice(notice: Notice) None
This method is called when a new notice is detected. You can overwrite this method to do what you want with the new notice.
- async on_new_comment(comment: Comment) None
This method is called when a new comment is detected. You can overwrite this method to do what you want with the new comment.
- async on_exception(exception: Exception) None
This method is called when an unhandled exception occurs. You can overwrite this method to do what you want with the exception. By default, an exception message is logged.
Objects
Attachment
- class weverse.objects.attachment.Photo(data: dict)
Represents a Weverse Photo.
- x == y
Checks if two photos are equal.
- x != y
Checks if two photos are not equal.
- hash(x)
Returns the photo’s hash.
- str(x)
Returns the photo’s URL.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the photo.
- Type
int
- url
The URL of the photo.
- Type
str
- height
The height of the photo.
- Type
int
- width
The width of the photo.
- Type
int
- class weverse.objects.attachment.Video(data: dict)
Represents a Weverse Video.
- x == y
Checks if two videos are equal.
- x != y
Checks if two videos are not equal.
- hash(x)
Returns the video’s hash.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the video.
- Type
int
- duration
The duration of the video, in seconds.
- Type
int
- height
The height of the video.
- Type
int
- width
The width of the video.
- Type
int
- thumbnail_url
The URL of the thumbnail of the video.
- Type
str
Notes
Due to Weverse’s implementations, the URL of the video itself is not accessible from this object. As a workaround, please make use of the
WeverseClient.fetch_video_url()method to make an additional API call to fetch the video URL.
- class weverse.objects.attachment.Snippet(data: dict)
Represents a Weverse Snippet. A Snippet can be perceived as an embed.
- x == y
Checks if two snippets are equal.
- x != y
Checks if two snippets are not equal.
- hash(x)
Returns the snippet’s hash.
- str(x)
Returns the snippet’s title.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the snippet.
- Type
int
- url
The URL of the website the snippet brings to.
- Type
str
- title
The title of the snippet.
- Type
str
- description
The description of the snippet.
- Type
str
- type
The type of snippet it is, if any.
- Type
str|None
- site
The website of the snippet, if any.
- Type
str|None
- domain
The domain name of the snippet.
- Type
str
- thumbnail_url
The URL of the thumbnail of the snippet, if any.
- Type
str|None
Comment
- class weverse.objects.comment.BaseParent(data: dict)
Represents a Weverse Base Parent class.
Inherited by:
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
str
- body
The body of the base parent object.
- Type
str
- author
The
member.PartialMemberobject of the author who wrote the base parent object.- Type
- class weverse.objects.comment.ParentComment(data: dict)
Represents a Weverse Parent Comment. Inherits from
BaseParent.Shares the same attributes with
BaseParent.- x == y
Checks if two parent comments are equal.
- x != y
Checks if two parent comments are not equal.
- hash(x)
Returns the parent comment’s hash.
- str(x)
Returns the parent comment’s body.
- id
The ID of the parent comment. If more information about the parent comment is required by the user, the
WeverseClient.fetch_comment()method can be used to fetch the actualCommentobject.- Type
str
- created_at
The time the parent comment got created at, in epoch.
- Type
int
- class weverse.objects.comment.ParentPost(data: dict)
Represents a Weverse Parent Post. Inherits from
BaseParent.Shares the same attributes with
BaseParent.Inherited by:
- x == y
Checks if two parent posts are equal.
- x != y
Checks if two parent posts are not equal.
- hash(x)
Returns the parent post’s hash.
- str(x)
Returns the parent post’s plain body.
- id
The ID of the parent post. If more information about the parent post is required by the user, the
WeverseClient.fetch_post()method can be used to fetch the actualpost.Postobject.- Type
str
- plain_body
The plain body of the parent post that does not have markdowns and unnecessary information.
- Type
str
- post_type
The post type of the parent post.
- Type
str
- class weverse.objects.comment.ParentMediaPost(data: dict)
Represents a Weverse Parent Media Post. Inherits from
BaseParentandParentPost.Shares the same attributes with
BaseParentandParentPost.- str(x)
Returns the parent media post’s title.
- title
The title of the parent media post.
- Type
str
- class weverse.objects.comment.RootPost(data: dict)
Represents a Weverse Root Post. Inherits from
BaseParentandParentPost.Shares the same attributes with
BaseParentandParentPost.- url
The URL that leads to the root post.
- Type
str
- section_type
The section the root post falls under.
- Type
str
- author
The
member.PostAuthorobject of the author who wrote the root post.- Type
- class weverse.objects.comment.RootMediaPost(data: dict)
Represents a Weverse Root Media Post. Inherits from
BaseParent,ParentPostandParentMediaPost.Shares the same attributes with
BaseParent,ParentPostandParentMediaPost.- url
The URL that leads to the root media post.
- Type
str
- section_type
The section the root media post falls under.
- Type
str
- author
The
member.PostAuthorobject of the author who wrote the root media post.- Type
- class weverse.objects.comment.Comment(data: dict)
Represents a Weverse Comment.
- x == y
Checks if two comments are equal.
- x != y
Checks if two comments are not equal.
- hash(x)
Returns the comment’s hash.
- str(x)
Returns the comment’s body.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
str
- id
The ID of the comment.
- Type
str
- body
The body of the comment.
- Type
str
- comment_count
The number of comments for the comment.
- Type
int
- like_count
The number of likes for the comment.
- Type
int
- created_at
The time the comment got created at, in epoch.
- Type
int
- author
The
member.PostAuthorobject of the author who wrote the comment.- Type
- property parent: weverse.objects.comment.ParentComment | weverse.objects.comment.ParentMediaPost | weverse.objects.comment.ParentPost
ParentComment|ParentPost|ParentMediaPost:Returns the
ParentCommentobject if the parent is a comment.Returns the
ParentMediaPostobject if the parent is a media.Returns the
ParentPostobject if the parent is a post.
- property root: weverse.objects.comment.RootMediaPost | weverse.objects.comment.RootPost
-
Returns the
RootMediaPostobject if the root post is a media post.Returns the
RootPostobject if the root post is a normal post.
- property url: str
Returns the URL to the comment.
- Type
str
Community
- class weverse.objects.community.PartialCommunity(data: dict)
Represents a Weverse Community with partial information available.
Inherited by:
- x == y
Checks if two communities are equal.
- x != y
Checks if two communities are not equal.
- hash(x)
Returns the community’s hash.
- str(x)
Returns the community’s name.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the community.
- Type
int
- name
The official name of the community.
- Type
str
- logo_image_url
The URL to the logo image of the community.
- Type
str
- property url: str
Returns the URL of the Weverse Community’s Artist tab.
- Type
str
- class weverse.objects.community.Community(data: dict)
Represents a Weverse Community. Inherits from
PartialCommunity.Shares the same attributes and operations with
PartialCommunity.- alias
The alias of the community.
- Type
str
- agency_profile_name
The profile name of the community’s agency profile.
- Type
str
- agency_image_url
The URL of the profile image of the community’s agency profile.
- Type
str
- agency_cover_image_url
The URL of the cover image of the community’s agency profile.
- Type
str
- home_header_image_url
The URL of the home header of the community.
- Type
str
- home_gradation_colour
The dictionary that contains the colour combinations displayed on the community’s home page.
- Type
dict
- has_membership
Whether the community has paid membership benefits.
- Type
bool
- member_count
The number of members who joined the community.
- Type
int
- fandom_name
The fandom name of the community, if any.
- Type
str|None
- fan_event_url
The URL used to participate in the fan events of the community, if any.
- Type
str|None
- artist_code
The artist code of the community, if any.
- Type
str|None
- open_date
The date the community got created on Weverse, if any.
- Type
str|None
Live
- class weverse.objects.live.Live(data: dict)
Represents a Weverse Live Broadcast.
Inherits from
media.WeverseMedia.Shares the same attributes with
post.PostLike,media.MediaLikeandmedia.WeverseMedia.- message_count
The number of messages in the live broadcast, if any.
- Type
int|None
Media
- class weverse.objects.media.MediaLike(data: dict)
Represents a Weverse Media.
Inherits from
post.PostLike.Shares the same attributes with
post.PostLike.Inherited by:
- str(x)
Returns the media’s title.
- title
The title of the media.
- Type
str
- thumbnail_url
The URL of the thumbnail of the media.
- Type
str
- class weverse.objects.media.ImageMedia(data: dict)
Represents a Weverse Media that contains images.
Inherits from
MediaLike.Shares the same attributes with
post.PostLikeandMediaLike.- property photos: list[weverse.objects.attachment.Photo]
A list of
attachment.Photoobjects in the media.- Type
list[
attachment.Photo]
- class weverse.objects.media.YoutubeMedia(data: dict)
Represents a Weverse Media that contains a YouTube video.
Inherits from
MediaLike.Shares the same attributes with
post.PostLikeandMediaLike.- video_duration
The duration of the YouTube video, in seconds.
- Type
int
- youtube_url
The URL to the YouTube video.
- Type
str
- video_screen_orientation
The screen orientation of the video.
- Type
str
- class weverse.objects.media.WeverseMedia(data: dict)
Represents a Weverse Media that contains a Weverse video.
Inherits from
MediaLike.Shares the same attributes with
post.PostLikeandMediaLike.Inherited by:
- video_id
The ID of the Weverse video.
- Type
int
- internal_video_id
The internal ID of the Weverse video. Returns
Nonein the case of a live broadcast that is still broadcasting and not converted into a VOD yet.- Type
str|None
- video_type
The type of Weverse video.
- Type
str
- aired_at
The time the Weverse video got aired at, in epoch time.
- Type
int
- is_paid_video
Whether the Weverse video is a paid video.
- Type
bool
- is_membership_only_video
Whether the Weverse video is only accessible by users with a paid membership to the community the video belongs to.
- Type
bool
- video_screen_orientation
The screen orientation of the video.
- Type
str
- video_play_count
The number of views on the Weverse video.
- Type
int
- video_like_count
The number of likes on the Weverse video.
- Type
int
- video_duration
The duration of the Weverse video, in seconds. Returns
Nonein the case of a live broadcast that is still broadcasting and not converted into a VOD yet.- Type
int|None
Member
- class weverse.objects.member.PartialMember(data: dict)
Represents a Weverse Member with partial information available.
Inherited by:
- x == y
Checks if two members are equal.
- x != y
Checks if two members are not equal.
- hash(x)
Returns the member’s hash.
- str(x)
Returns the member’s name.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
str
- id
The ID of the member.
- Type
str
- name
The name of the member.
- Type
str
- image_url
The URL of the profile image of the member, if any.
- Type
str|None
- profile_type
The profile type of the member.
- Type
str
- class weverse.objects.member.Artist(data: dict)
Represents a Weverse Artist that is fetched from the
weverse.WeverseClient.fetch_artists()method. Inherits fromPartialMember.Shares the same attributes and operations with
PartialMember.- community_id
The community ID of the community the artist belongs to.
- Type
int
- artist_profile
The
ArtistProfileobject of the artist.- Type
- join_date
The epoch time when the artist joined the community.
- Type
int
- class weverse.objects.member.ArtistProfile(data: dict)
Represents an Official Weverse Artist Profile.
- str(x)
Returns the official name of the artist.
- official_name
The official name of the artist.
- Type
str
- official_image_url
The URL of the official image of the artist.
- Type
str
- birthday
The epoch time of the artist’s birthday.
- Type
int
- class weverse.objects.member.PostAuthor(data: dict)
Represents a Weverse Post Author that is an attribute belonging to
post.Postwhich is fetched from theweverse.WeverseClient.fetch_post()method. Inherits fromPartialMember.Shares the same attributes and operations with
PartialMember.- community_id
The community ID of the community the post author belongs to.
- Type
int
- has_joined
Whether the post author has joined the community.
- Type
bool
- is_official
Whether the post author is an official Weverse account.
- Type
bool
- profile_is_accessible
Whether the profile of the post author is accessible.
- Type
bool
- is_my_profile
Whether the post author is yourself.
- Type
bool
- artist_profile
The
ArtistProfileobject of the Post Author if it’s an Artist.- Type
ArtistProfile|None
- class weverse.objects.member.Member(data: dict)
Represents a Weverse Member that is fetched from the
weverse.WeverseClient.fetch_member()method. Inherits fromPartialMember.Shares the same attributes and operations with
PartialMember.- community_id
The community ID of the community the member belongs to.
- Type
int
- profile_cover_image_url
The URL of the profile cover image of the member, if any.
- Type
str|None
- profile_comment
The profile comment of the member, if any.
- Type
str|None
- has_joined
Whether the member has joined the community.
- Type
bool
- has_membership
Whether the member has a paid membership to the community. Will return
Noneif it is theMemberobject of the group.- Type
bool|None
- is_official
Whether the member is an official Weverse account.
- Type
bool
Whether the member is hidden. Will return
Noneif it is theMemberobject of the group.- Type
bool|None
- is_blinded
Whether the member is blinded. Will return
Noneif it is theMemberobject of the group.- Type
bool|None
- is_followed
Whether the signed-in account is following the member.
- Type
bool
- is_my_profile
Whether the member is yourself.
- Type
bool
- first_joined_at
The time the member first joined the community at, in epoch. Will return
Noneif it is theMemberobject of the group.- Type
int|None
- follow_count
The number of followers the member has, if available.
- Type
int|None
- artist_profile
The
ArtistProfileobject of the member if it’s an Artist.- Type
ArtistProfile|None
Moment
- class weverse.objects.moment.MomentLike(data: dict)
Represents a Weverse Moment-Like Object.
Inherits from
post.PostLike.Shares the same attributes with
post.PostLike.Inherited by:
- str(x)
Returns the moment’s plain body.
- expire_at
The time the moment expires at, in epoch.
- Type
int
- class weverse.objects.moment.Moment(data: dict)
Represents a Weverse Moment that has been created after their rework.
Inherits from
MomentLike.Shares the same attributes with
post.PostLikeandMomentLike.- video
The
attachment.Videoobject of the video in the moment.- Type
- class weverse.objects.moment.OldMoment(data: dict)
Represents a Weverse Moment that has been created before their rework.
Inherits from
MomentLike.Shares the same attributes with
post.PostLikeandMomentLike.- photo
The
attachment.Photoobject of the photo in the moment, if the image used in the moment is not a default Weverse background image.- Type
attachment.Photo|None
- background_image_url
The URL of the default Weverse background image if it is used.
- Type
str|None
Notice
- class weverse.objects.notice.Notice(data: dict)
Represents a Weverse Notice.
- x == y
Checks if two notice objects are equal.
- x != y
Checks if two notice objects are not equal.
- hash(x)
Returns the notice’s hash.
- str(x)
Returns the notice’s plain body.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the notice.
- Type
int
- title
The title of the notice.
- Type
str
- body
The body that is displayed on the https://weverse.io website. Consider using
plain_bodyif you do not want markdowns and unnecessary information.- Type
str
- plain_body
The plain body of the notice that does not have markdowns and unnecessary information.
- Type
str
- url
The URL that leads to the notice.
- Type
str
- is_exposed
Whether the notice is exposed.
- Type
bool
- is_published
Whether the notice is published.
- Type
bool
Whether the notice is hidden from artists.
- Type
bool
- is_membership_only
Whether the notice can only be seen by users who have a paid membership in the community the notice belongs to.
- Type
bool
- is_pinned
Whether the notice is pinned.
- Type
bool
- published_at
The time the notice got created at, in epoch.
- Type
int
- notice_type
The type of notice it is.
- Type
str
- exposed_status
The exposed status of the notice.
- Type
str
- property photos: list[weverse.objects.attachment.Photo]
A list of
attachment.Photoobjects in the notice. Returns an empty list if there are no photos.- Type
list[
attachment.Photo]
- property community_id: int
The community ID of the community the notice belongs to.
- Type
int
Notification
- class weverse.objects.notification.Notification(data: dict)
Represents a Weverse Notification.
- x == y
Checks if two notifications are equal.
- x != y
Checks if two notifications are not equal.
- hash(x)
Returns the notification’s hash.
- str(x)
Returns the notification’s message.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the notification.
- Type
int
- title
Usually the name of the group the notification belongs to. However, if it’s an admin notification, it would be a proper title.
- Type
str
- message_ko
The message of the notification in Korean.
- Type
str
- message_ja
The message of the notification in Japanese.
- Type
str
- message_en
The message of the notification in English.
- Type
str
- image_url
The URL to the image of the notification, if any.
- Type
str|None
- logo_image_url
The URL to the logo image of the notification.
- Type
str
- time_created
The time the notification got created at, in epoch.
- Type
int
- count
The number of artist comments on the post the notification leads to.
- Type
int
- is_read
Whether the user has read the notification.
- Type
bool
- community
The
community.PartialCommunityobject of the community of the notification.
- author
The
member.PartialMemberobject of the artist who created the post the notification leads to.Will always return
Nonefor posts that are not comment-related.- Type
member.PartialMember|None
- property url: str
Returns the URL of the Weverse Post the Weverse Notification leads to.
- Type
str
- property post_id: str
Returns the post ID of the post the notification leads to.
- Type
str
- property post_type: str
Returns the post type of the post the notification leads to.
- Type
str
Post
- class weverse.objects.post.PostLike(data: dict)
Represents a Weverse Post-Like Object. Post-Like Objects refer to the different types of Weverse contents that share a similar data structure with each other. Examples of which are posts that fall under the categories of Post, Moment, Media and Live.
Inherited by:
- x == y
Checks if two post-like objects are equal.
- x != y
Checks if two post-like objects are not equal.
- hash(x)
Returns the post-like object’s hash.
- data
The raw data directly taken from the response generated by Weverse’s API.
- Type
dict
- id
The ID of the post-like object.
- Type
int
- body
The body that is displayed on the https://weverse.io website. Consider using
plain_bodyif you do not want markdowns and unnecessary information.- Type
str
- plain_body
The plain body of the post-like object that does not have markdowns and unnecessary information.
- Type
str
- url
The URL that leads to the post-like object.
- Type
str
- like_count
The number of likes for the post-like object.
- Type
int
- comment_count
The number of comments for the post-like object.
- Type
int
- published_at
The time the post-like object got created at, in epoch.
- Type
int
- is_bookmarked
Whether the user has bookmarked the post-like object.
- Type
bool
- is_locked
UNDETERMINED FUNCTIONALITY: (Has always returned False.)
- Type
bool
Whether the post-like object is hidden from artists. Will most likely ever return True in posts posted by non-artists.
- Type
bool
- is_membership_only
Whether the post-like object can only be seen by users who have a paid membership in the community the post belongs to.
- Type
bool
- has_product
UNDETERMINED FUNCTIONALITY: (Has always returned False.)
- Type
bool
- hashtags
The list of hashtags used in the post-like object.
- Type
list[
str]
- post_type
The post type of the post-like object.
- Type
str
- section_type
The section the post-like object falls under.
- Type
str
- author
The
member.PostAuthorobject of the author who wrote the post-like object.- Type
- community
The
community.PartialCommunityobject of the community the post-like object belongs to.
- like_id
The ID of the like on the post-like object, if the user has liked the post.
- Type
str|None
- class weverse.objects.post.Post(data: dict)
Represents a Weverse Post. Inherits from
PostLike.Shares the same attributes with
PostLike.- str(x)
Returns the post’s plain body.
- property photos: list[weverse.objects.attachment.Photo]
A list of
attachment.Photoobjects in the post. Returns an empty list if there are no photos.- Type
list[
attachment.Photo]
- property videos: list[weverse.objects.attachment.Video]
A list of
attachment.Videoobjects in the post. Returns an empty list if there are no videos.- Type
list[
attachment.Video]
- property snippets: list[weverse.objects.attachment.Snippet]
A list of
attachment.Snippetobjects in the post. Returns an empty list if there are no snippets.- Type
list[
attachment.Snippet]
Exceptions
- exception weverse.WeverseException
Base exception class that other Weverse exceptions inherit from.
- exception weverse.LoginError(code: int, reason: str)
An Exception raised when the login to Weverse fails.
- exception weverse.RequestFailed(url: str, code: int, reason: str)
An Exception raised when the status code of the response returned by the API is not 200, 401, 403, 404 or 500. (Note: This is because 401, 403, 404 and 500 has their own specific exceptions.)
- exception weverse.TokenExpired(url: str)
An Exception raised when the status code of the response returned by the API is 401.
- exception weverse.Forbidden(url: str, reason: str)
An Exception raised when the status code of the response returned by the API is 403.
- exception weverse.NotFound(url: str)
An Exception raised when the status code of the response returned by the API is 404.
- exception weverse.InternalServerError(url: str)
An Exception raised when the status code of the response returned by the API is 500.