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.Notification objects of the latest Weverse notifications.

Return type

list[notification.Notification]

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.Notification object of the requested Weverse Notification.

Return type

notification.Notification

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.Notification objects and a list of new comment.Comment objects.

Return type

tuple[list[notification.Notification], list[comment.Comment]]

Notes

The reason why comment.Comment objects are returned for comment-related notifications and not notification.Notification objects 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 actual comment.Comment objects 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.PartialCommunity objects of the joined Weverse communities.

Return type

list[community.PartialCommunity]

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.Community object of the requested Weverse Community.

Return type

community.Community

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community.

  • NotFound – If the requested Weverse Community does not exist.

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.Artist objects of the specified Weverse community.

Return type

list[member.Artist]

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community.

  • NotFound – If the requested Weverse Community does not exist.

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.Post object of the requested Weverse Post.

Return type

post.Post

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the post belongs to.

  • NotFound – If the requested Weverse Post does not exist.

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.WeverseMedia or media.YoutubeMedia object of the requested Weverse Media depending on the type of media it is.

Return type

media.ImageMedia | media.WeverseMedia | media.YoutubeMedia

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the media belongs to.

  • NotFound – If the requested Weverse Media does not exist.

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.Live object of the requested Weverse Live Broadcast

Return type

live.Live

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the live broadcast belongs to.

  • NotFound – If the requested Weverse Live Broadcast does not exist.

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.Moment or moment.OldMoment object of the requested Weverse moment depending on the type of moment it is.

Return type

moment.Moment | moment.OldMoment

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the moment belongs to.

  • NotFound – If the requested Weverse Moment does not exist.

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.Notice object of the requested Weverse Notice.

Return type

notice.Notice

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the notice belongs to.

  • NotFound – If the requested Weverse Notice does not exist.

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.Member object of the requested Weverse Member.

Return type

member.Member

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.Comment object of the requested Weverse Comment.

Return type

comment.Comment

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the comment belongs to.

  • NotFound – If the requested Weverse Comment does not exist.

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.Comment objects of the Weverse Artist Comment that belong to the specified post.

Return type

list[comment.Comment]

Raises
  • Forbidden – If the signed in account has not joined the requested Weverse Community the post belongs to.

  • NotFound – If the requested Weverse Post does not exist.

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.PartialMember object of the author who wrote the base parent object.

Type

member.PartialMember

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 actual Comment object.

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 actual post.Post object.

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 BaseParent and ParentPost.

Shares the same attributes with BaseParent and ParentPost.

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 BaseParent and ParentPost.

Shares the same attributes with BaseParent and ParentPost.

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.PostAuthor object of the author who wrote the root post.

Type

member.PostAuthor

class weverse.objects.comment.RootMediaPost(data: dict)

Represents a Weverse Root Media Post. Inherits from BaseParent, ParentPost and ParentMediaPost.

Shares the same attributes with BaseParent, ParentPost and ParentMediaPost.

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.PostAuthor object of the author who wrote the root media post.

Type

member.PostAuthor

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.PostAuthor object of the author who wrote the comment.

Type

member.PostAuthor

property parent: weverse.objects.comment.ParentComment | weverse.objects.comment.ParentMediaPost | weverse.objects.comment.ParentPost

ParentComment | ParentPost | ParentMediaPost:

property root: weverse.objects.comment.RootMediaPost | weverse.objects.comment.RootPost

RootMediaPost | RootPost:

  • Returns the RootMediaPost object if the root post is a media post.

  • Returns the RootPost object 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.MediaLike and media.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.PostLike and MediaLike.

property photos: list[weverse.objects.attachment.Photo]

A list of attachment.Photo objects 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.PostLike and MediaLike.

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.PostLike and MediaLike.

Inherited by:

video_id

The ID of the Weverse video.

Type

int

internal_video_id

The internal ID of the Weverse video. Returns None in 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 None in 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 from PartialMember.

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 ArtistProfile object of the artist.

Type

ArtistProfile

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.Post which is fetched from the weverse.WeverseClient.fetch_post() method. Inherits from PartialMember.

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 ArtistProfile object 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 from PartialMember.

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 None if it is the Member object of the group.

Type

bool | None

is_official

Whether the member is an official Weverse account.

Type

bool

is_hidden

Whether the member is hidden. Will return None if it is the Member object of the group.

Type

bool | None

is_blinded

Whether the member is blinded. Will return None if it is the Member object 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 None if it is the Member object of the group.

Type

int | None

follow_count

The number of followers the member has, if available.

Type

int | None

artist_profile

The ArtistProfile object 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.PostLike and MomentLike.

video

The attachment.Video object of the video in the moment.

Type

attachment.Video

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.PostLike and MomentLike.

photo

The attachment.Photo object 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_body if 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

is_hidden_from_artist

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.Photo objects 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.PartialCommunity object of the community of the notification.

Type

community.PartialCommunity

author

The member.PartialMember object of the artist who created the post the notification leads to.

Will always return None for 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_body if 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

is_hidden_from_artist

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.PostAuthor object of the author who wrote the post-like object.

Type

member.PostAuthor

community

The community.PartialCommunity object of the community the post-like object belongs to.

Type

community.PartialCommunity

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.Photo objects 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.Video objects 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.Snippet objects 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.