TwDataTypes

This page contains all the Data Class

PROXY_TYPE_SOCKS4 = 1
PROXY_TYPE_SOCKS5 = 2
PROXY_TYPE_HTTP = 3

Proxy

class Proxy(host: str, port: int, proxy_type: int, username: str = None, password: str = None)
Arguments
host: str

Host of Proxy

port: int

Port of proxy

proxy_type: int

Type of Proxy

username(optional): str

Username required for authentication

password(optional): str

Password required for authentication

UserTweets

class UserTweets

Bases : BaseGeneratorClass

Reference:

tweety.types.usertweet.UserTweets

Attributes:
tweets: list[Tweet | SelfThread]

List of User Tweets

get_replies: bool

Either to get replies or Not

user_id: int

User ID of the user in question

Methods:
to_xlsx(filename=None)

Export the User Tweets to Excel

Arguments:
filename(optional): str = None

Filename of Excel Workbook

Return: None

UserCommunities

class UserCommunities

Bases : BaseGeneratorClass

Reference:

tweety.types.community.UserCommunities

Attributes:
communities: list[Community]

List of User Community

user_id: int

User ID of the user in question

UserHighlights

class UserHighlights

Bases : BaseGeneratorClass

Reference:

tweety.types.usertweet.UserHighlights

Attributes:
tweets: list[Tweet]

List of User Community

user_id: int

User ID of the user in question

UserMedia

class UserMedia

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.UserMedia

Attributes:
tweets: list[Tweet | SelfThread]

List of User Tweets

user_id: int

User ID of the user in question

SelfTimeline

class SelfTimeline

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.SelfTimeline

Attributes:
tweets: list[Tweet | SelfThread]

List of User Tweets

timeline_type: str

Type of Timeline

user_id: int

User ID of the user in question

TweetHistory

class TweetHistory

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.TweetHistory

Attributes:
tweets: list[Tweet | SelfThread]

List of User Tweets

latest: Tweet

Latest Tweet

ScheduledTweets

class ScheduledTweets

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.ScheduledTweets

Attributes:
tweets: list[ScheduledTweet]

List of Scheduled Tweets

TweetComments

class TweetComments

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.TweetComments

Attributes:
tweets: list[ConversationThread]

List of Tweet ConversationThreads

tweet_id: str

ID of Tweet

get_hidden: bool

Got hidden comments or not

TopicTweets

class TopicTweets

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.topic.TopicTweets

Attributes:
tweets: list[Tweet]

List of Tweets

TweetLikes

class TweetLikes

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.likes.TweetLikes

Attributes:
users: list[User]

List of Users

user_id: int

User ID of the user in question

TweetRetweets

class TweetRetweets

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.likes.TweetRetweets

Attributes:
users: list[User]

List of Users

user_id: int

User ID of the user in question

Mention

class Mention

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.mentions.Mention

Attributes:
tweets: list

List of User Tweets

user_id: int

User ID of the user in question

Bookmarks

class Bookmarks

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.bookmarks.Bookmarks

Attributes:
tweets: list

List of User Tweets

user_id: int

User ID of the user in question

CommunityTweets

class CommunityTweets

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.community.CommunityTweets

Attributes:
tweets: list[Tweet | SelfThread]

List of Tweets

filter: str | None

Any Filter which is begin applied

Methods:
to_xlsx(filename=None)

Export the User Tweets to Excel

Arguments:
filename(optional): str = None

Filename of Excel Workbook

Return: None

CommunityMembers

class CommunityMembers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.community.CommunityMembers

Attributes:
users: list[User]

List of User

filter: str | None

Any Filter which is begin applied

Lists

class Lists

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.lists.Lists

Attributes:
lists: list[TwList]

List of Twitter List

ListMembers

class ListMembers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.lists.ListMembers

Attributes:
users: list[User]

Users of Twitter List

ListTweets

class ListTweets

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.lists.ListTweets

Attributes:
tweets: list[Tweet | SelfThread]

Tweets of the List

UserFollowers

class UserFollowers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.follow.UserFollowers

Attributes:
users: list[User]

Users List

UserFollowings

class UserFollowings

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.follow.UserFollowings

Attributes:
users: list[User]

Users List

UserSubscribers

class UserSubscribers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.follow.UserSubscribers

Attributes:
users: list[User]

Users List

MutualFollowers

class MutualFollowers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.follow.MutualFollowers

Attributes:
users: list[User]

Users List

BlockedUsers

class BlockedUsers

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.follow.BlockedUsers

Attributes:
users: list[User]

Users List

TweetNotifications

class TweetNotifications

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.notification.TweetNotifications

Attributes:
tweets: list[Tweet]

List of tweets

Inbox

class Inbox

Bases : dict

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.inbox.Inbox

Attributes:
conversations: list[Conversation]

List of User Conversation

messages: list[Message]

List of User Message

cursor: str

Pagination cursor to get new message

Methods:
async get_conversation(conversation_id: int | str)

Get conversation of with specific User using its conversation id

Arguments:
conversation_id: str

Conversation id of the specific user

Return: Conversation | None
async get_next_page(page_type: str)

Get Next Page of inbox

Arguments:
page_type: str

Page Type to Get

Return: list[Conversation]
async get_page(page_type: str)

Get Specific Page of inbox

Arguments:
min_entry_id: str

Cursor of Inbox to get conversation from

page_type: str

Page Type to Get

Return: list[Conversation]

SelfThread

class SelfThread

Bases : dict

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.twDataTypes.SelfThread

Attributes:
tweets: list[Tweet]

List of Threaded Tweets

all_tweets_id: list[str]

List of all tweet ids in the thread

Methods:
async expand()

Try getting all the tweets of the thread (by default Twitter returns only 3 Tweets from Thread)

ConversationThread

class ConversationThread

Bases : dict

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.twDataTypes.ConversationThread

Attributes:
tweets: list[Tweet]

List of Threaded Tweets

parent: Tweet

Parent Tweet

Methods:
async expand()

Try getting all the tweets of the thread (by default Twitter returns only 2 Tweets from Thread)

Tweet

class Tweet

Bases : dict

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.twDataTypes.Tweet

Attributes:
id: int

ID of the Tweet

created_on: datetime.datetime

DateTime at which the Tweet was created

date: datetime.datetime

DateTime at which the Tweet was created

text: str

Text of the Tweet

rich_text: RichText

Text of the Tweet

author: User

Author of the Tweet

is_retweet: bool

Is this Tweet a retweet or not

retweeted_tweet: Tweet

Retweeted Tweet if is_retweet is True

is_quoted: bool

Is the Tweet quoted or not

quoted_tweet: Tweet

Quoted Tweet if is_quoted is True

is_reply: bool

Is this Tweet replied in response of any other Tweet

is_sensitive: bool

Does the Tweet contain sensitive content

reply_counts: int

Number of Times someone replied to this Tweet

quote_counts: int

Number of Times this Tweet was Quoted

replied_to: Tweet | str

Tweet this Tweet was sent in response to or USER ID

bookmark_count: int

Number of Times this Tweet was Bookmarked

views: int

Number of Times this Tweet was Viewed

likes: int

Number of Times this Tweet was Liked

language: str

Language of the Tweet (identified by Twitter)

place: Place

Any Place mentioned in the Tweet

retweet_counts: int

Number of Times this Tweet was Retweeted

source: str

Source of Tweet

has_moderated_replies: bool

Are replies on this Tweet moderated

is_liked: bool

is this tweet liked by authenticated user

is_retweeted: bool

is this tweet retweeted by authenticated user

can_reply: bool

can authenticated user reply to this Tweet

broadcast: Broadcast | None

Broadcast

edit_control: EditControl | None

Edit Control of the Tweet

has_newer_version: bool

Do this Tweet was edited and has newer version

audio_space_id: str

Id of the Audio Space in the Tweet

pool: Pool | None

Pool in the Tweet

community: Community | None

Community this tweet is part of

media: list[Media]

Media of the Tweet

user_mentions: list[ShortUser]

Users mentioned in the Tweet

urls: list[URL]

URLs mentioned in the Tweet

hashtags: list[Hashtag]

Hashtags mentioned in the Tweet

symbols: list[Symbol]

Symbols mentioned in the Tweet

community_note: str | None

Community Note posted in response to the Tweet

url: str

URL of the Tweet

grok_share: GrokShare

Grok Conversation Shared on Tweet

threads: list[Tweet]

List of Threaded Tweets

comments: list[ConversationThread]

List of Comments sent in response to this Tweet

Methods:
async get_comments(pages=1, wait_time=2, cursor=None)
async iter_comments(pages=1, wait_time=2, cursor=None)

Get the comments / replies posted in response to this tweet

Arguments:
pages(optional): int = 1

How many pages to get

wait_time(optional): int = 2

Number of seconds to wait between multiple requests

cursor(optional): str = None

Pagination cursor to get the comments from that cursor up-to

Return: list[Tweet]
async like()

Like the Tweet

Return: Bool
async unlike()

Un-Like the Tweet

Return: Bool
async translate()

Translate the Tweet

Return: TweetTranslate
async delete()

Delete the Tweet

Return: Bool
async download_all_media(progress_callback: Callable[[str, int, int], None] = None)

Download All Media from Tweet

progress_callback(optional): Callable[[str, int, int], None] = None

Callback function which will called while downloading to track the progress. [filename, total_size_in_bytes, downloaded_in_bytes]

async retweet()

Retweet the Tweet

Return: Bool
async get_reply_to()

Get the Tweet to which this Tweet was sent in reply

Return: Tweet

Media

class Media

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Media

Attributes:
id: str

Internal ID of the Media

display_url: str

Short Display URL of Media (This will open the Twitter website)

expanded_url: str

Full Display URL of Media (This will open the Twitter website)

media_url_https: str

Direct Link to the Media (thumbnail if media is Video)

type: str

Type of Media (video | photo)

url: str

Short URL of Tweet

streams: list[Stream]

List of streams available if the type is video

mediaStats: dict

Stats of the media , usually viewCount

source_user: User | None

Source from where the Media was posted

Methods:
async download(filename: str = None, progress_callback: Callable[[str, int, int], None] = None)

Download the Media

Arguments:
filename(optional): str = None

Filename of the Media

progress_callback(optional): Callable[[str, int, int], None] = None

Callback function which will called while downloading to track the progress. [filename, total_size_in_bytes, downloaded_in_bytes]

Return: filename | None
async best_stream()

Get Best available Media/Stream

Return: Media | Stream | None

Stream

class Stream

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Stream

Attributes:
bitrate: int

bitrate of stream audio

content_type: str

Mime-type of the Media

url: str

Direct URL to Stream

length: int

Length of stream in mini-seconds

aspect_ratio: list[int, int]

Aspect Ratio of the Stream

res: str

Resolution of the Stream

Methods:
async download(filename: str = None, progress_callback: Callable[[str, int, int], None] = None)

Download the Media

Arguments:
filename(optional): str = None

Filename of the Media

progress_callback(optional): Callable[[str, int, int], None] = None

Callback function which will called while downloading to track the progress. [filename, total_size_in_bytes, downloaded_in_bytes]

Return: filename | None

MediaSize

class ShortUser

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.MediaSize

Attributes:
name: str

Name of media size

width: str

Width of media

height: str

Height of the media

ShortUser

class ShortUser

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ShortUser

Attributes:
id: str

id of the User

name: str

Name of the User

screen_name: str

Username of the User

username: str

Username of the User

Card

class Card

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Card

Attributes:
rest_id: int

Id of the card

name: str

Name of the card

choices: list[Choice]

Number of Tweets this trend has till now

end_time: datetime.datetime

End Time of the Pool

last_updated_time: datetime.datetime

Last Updated Time of the Pool

duration: str

Duration of Pool in Minutes

user_ref: list[User]

Users Referred in the Pool

Choice

class Choice

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Choice

Attributes:
id: str

Id of the pool

name: str

Name of the choice

value: str

Value of the choice

key: str

Key of the choice

counts: str

Number of the votes this value has

Place

class Place

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Place

Attributes:
name: str

Name of the place

id: str

Id of the place

country: str

Country of the place

full_name: str

Full Name of the place

country_code: str

Country Code of the place

url: str

URL of the place

coordinates: list[Coordinates]

Coordinates of the place

Coordinates

class Coordinates

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Coordinates

Attributes:
latitude: float

Latitude Value of the place

longitude: float

Longitude Value of the place

User

class User

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.User

Attributes:
id: int

Id of the User

rest_id: int

Id of the User

created_at: datetime.datetime

DateTime at which the user was created

date: datetime.datetime

DateTime at which the Tweet was created

description: str

Bio / Description on User Profile

bio: str

Bio / Description on User Profile

is_automated: bool

This user is automated using API

birth_date: datetime.datetime

Birthday of User

can_dm: bool

Can the authenticated user send dm to this user

is_blocked: bool

Is the user blocked by authenticated user

entities: dict | None

Additional entities of user, usually links

fast_followers_count: int

Number of Fast Followers this user has

favourites_count: int

Number of Favourite this user has received

followers_count: int

Number of followers this user has

friends_count: int

Number of friends this user has

listed_count: int

Number of lists this user has

location: str | None

Location of the User

media_count: int

Number of Media this user has posted

name: str

Name of the User

normal_followers_count: int

Number of normal followers count this user has

profile_banner_url: str

Direct URL to the User banner image

profile_image_url_https: str

Direct URL to the User profile image

protected: bool

Is user private or not

screen_name: str

Username of the user

username: str

Username of the user

statuses_count: int

Number of status this user has posted

verified: bool

Is user verified or not.

possibly_sensitive: bool

Is the user known for posting sensitive content

pinned_tweets: list[str] | None

List of id of tweets pinned by the user

notifications_enabled: bool

Is new tweet notification enabled for this user

notifications: bool

Is new tweet notification enabled for this user

community_role: str | None

Role in Community (if applicable)

Methods:
async follow()

Follow the User

Return: User
async unfollow()

un-Follow the User

Return: User
async enable_notifications()

Enable new Tweet notification for this user

Return: bool
async disable_notifications()

Disable new Tweet notification for this user

Return: bool

Conversation

class Conversation

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.inbox.Conversation

Attributes:
id: int

Id of the conversation

name: str

Name of conversation

low_quality: bool

Is the conversation low quality

muted: bool

Is this conversation muted

notifications_disabled: bool

Is the notifications for this conversation disabled

nsfw: bool

Is this conversation not suitable for work

read_only: bool

Is this conversation read only

trusted: bool

Is this conversation trusted by the user

is_group: bool

Is this conversation a Group or Not

type: str

Type of conversation (GROUP_DM, ONE_TO_ONE)

participants: list[User]

Participants of the conversation

messages: list[Message]

Messages of the conversation

Methods:
async get_all_messages(wait_time: int = 2, cursor: int = 0, till_date: datetime.datetime = None, count: int = None)
async iter_all_messages(wait_time: int = 2, cursor: int = 0, till_date: datetime.datetime = None, count: int = None)

Force get all the messages of the conversation (iter for Generator)

Arguments:
wait_time: int | tuple[int, int]

Number of seconds to wait between multiple requests

cursor: str

Cursor of that specific Page

till_date: datetime.datetime

Get Messages till that date

count: int

Get this number of Messages

Return: list[Message]
async send_message(text)

Send Message in this conversation

Arguments:
text: str

Content of the message to send

file: str | PathLike

File to send with message

Return: Message
async get_page(cursor: str, till_date: datetime.datetime)

Get a specific page of messages in the conversation

Arguments:
cursor: str

Cursor of conversation from where to get the messages

till_date: datetime.datetime

Date till which to get messages

Return: list[Message | MessageParticipantUpdate | MessageNameUpdate | MessageConversationCreated | MessageConversationAvatarUpdate], str, str
async get_next_page(till_date: datetime.datetime)

Get a next page of messages in the conversation

Arguments:
till_date: datetime.datetime

Date till which to get messages

Return: list[Message | MessageParticipantUpdate | MessageNameUpdate | MessageConversationCreated | MessageConversationAvatarUpdate]

MessageParticipantUpdate

class MessageParticipantUpdate

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.inbox.MessageParticipantUpdate

Attributes:
id: int

Id of the message

time: datetime.datetime

Time at which the message was sent

type: str

Type of Update (JOIN, LEAVE)

sender_id: str

Sender ID of the User who have joined or left

sender: User

The User who have joined or left

MessageNameUpdate

class MessageNameUpdate

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.inbox.MessageNameUpdate

Attributes:
id: int

Id of the message

time: datetime.datetime

Time at which the message was sent

name: str

(New) Name of Conversation

by_user_id: str

User ID of the User who have changed the name

by_user: User

User who have changed the name

MessageConversationCreated

class MessageConversationCreated

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.inbox.MessageConversationCreated

Attributes:
id: int

Id of the message

time: datetime.datetime

Time at which the message was sent

MessageConversationAvatarUpdate

class MessageConversationAvatarUpdate

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.inbox.MessageConversationAvatarUpdate

Attributes:
id: int

Id of the message

time: datetime.datetime

Time at which the message was sent

conversation_id: str

Conversation Id of the message

avatar_url: str

Direct URL to Avatar Image

by_user_id: str

User ID of the User who have changed the avatar

Message

class Message

Bases : dict

Note

This Object is JSON Serializable

reference:

tweety.types.inbox.Message

Attributes:
id: int

Id of the message

conversation_id: str

Id of the conversation this message belongs to

epoch_time: int

Epoch Time at which the message was sent

time: datetime.datetime

Time at which the message was sent

request_id: str

Request ID of the message

text: str

Text of the message

receiver: User

The receiver of this message

sender: User

The sender of this message

media: Media | None

Media in the message

urls: list[URL]

URLs in the message

symbols: list[Symbol]

Symbols in the message

hashtags: list[Hashtag]

Hashtags in the message

user_mentions: list[ShortUser]

User Mentioned in the message

shared_tweet: Tweet

Tweet Quoted in the message

Methods:
async reply(text, file=None, audio_only=False, quote_tweet_id=None)

Reply to this message

Arguments:
text: str

Content of the message to send

file: str

Media to send

audio_only: bool

Send Media as Audio Only

quote_tweet_id: str | int | Tweet

Quote a Tweet in Message

Return: Message
async react(reaction_emoji: str)

React to this message

Arguments:
reaction_emoji: str

Emoji to react with

Return: bool

NewMessage

class NewMessage

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.events.newmessage.NewMessageUpdate.NewMessage

Attributes:
id: int

Id of the message

conversation_id: str

Id of the conversation this message belongs to

time: datetime.datetime

Time at which the message was sent

text: str

Text of the message

participants: list[User]

Participants of the conversation

receiver: User

The receiver of this message

sender: User

The sender of this message

media: Media | None

Media in the message

message: Message

Actual message object

conversation: Conversation

Conversation object

Methods:
async respond(text)

Send Message in this conversation

Arguments:
text: str

Content of the message to send

Return: Message

Community

class Community

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Community

Attributes:
id: int

Id of the Community

created_at: datetime.datetime

DateTime at which the Community was created

date: datetime.datetime

DateTime at which the Tweet was created

description: str

Bio / Description on Community

name: str

Name of the Community

role: str

Role of authenticated user in the community

member_count: int

Number of Members in the Community

moderator_count: int

Number of Moderator in the Community

admin: list[User]

List of Admins of the community

creator: list[User]

List of Creators of the community

rules: list[str]

List of rules of the Community

Symbol

class Symbol

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Symbol

Attributes:
indices: list[int, int]

The start index of this symbol in the text

text: str

Actual Symbol

Hashtag

class Hashtag

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Hashtag

Attributes:
indices: list[int, int]

The start index of this hashtag in the text

text: str

Actual hashtag

URL

class URL

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.URL

Attributes:
indices: list[int, int]

The start index of this url in the text

display_url: str

Twitter Short URL

expanded_url: str

Actual Url

RichText

class RichText

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.RichText

Attributes:
id: int

Id of the Tweet

text: str

Text of the tweet

hashtags: list[Hashtag]

List of hashtags in the Tweet

urls: list[URL]

List of URLs in the Tweet

symbols: list[Symbol]

List of Symbols in the Tweet

user_mentions: list[ShortUser]

List of Users mentioned in the Tweet

media: list[Media]

List of Media in the Tweet

tags: list[RichTag]

List of rich text tags in the text

Methods:
get_html()

Get HTML version of the text which includes all the tags and elements

Return: str

RichTag

class RichTag

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.RichTag

Attributes:
from_index: int

The start index of this specific tag in the text

to_index: int

The end index of this specific tag in the text

hashtags: list[str]

List of hashtags in the Tweet

types: list[str]

Type of tags included in the range

Pool

class Pool

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Pool

Attributes:
id: str

Id of the Pool

name: str

Name of the Pool

choices: list[Choice]

List of choices in teh Tweet

end_time: datetime.datetime

End Time of the Pool

last_updated_time: datetime.datetime

Last Updated Time of the Pool

duration: str

Duration of Pool in Minutes

user_ref: list[User]

Users Referred in the Pool

selected_choice: Choice | None

Choice already selected by the authenticated user

is_final: bool

Has pool ended or not

TwList

class TwList

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.TwList

Attributes:
id: str

Id of the List

name: str

Name of the List

created_at: datetime.datetime

Time at which list was created

description: str

Description of List

is_member: bool

is the authenticated member of this list

member_count: int

Number of member List has

subscriber_count: int

Number of subscriber List has

admin: User

Admin of the List

EditControl

class EditControl

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.EditControl

Attributes:
tweet_ids: list[str]

List of Tweet ids

edits_remaining: str

Number of Edits Remaining for this Tweet

is_latest: bool

is this the Latest version of Tweet

latest_tweet_id: str

ID of latest edited Tweet

Broadcast

class Broadcast

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Broadcast

Attributes:
id: int

ID of Broadcast

width: str

Width of Broadcast

title: str

Title of Broadcast

Topic

class Topic

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Topic

Attributes:
id: int

ID of Topic

description: str

description of topic

name: str

Title of Topic

is_following: bool

is authenticated user following the topic

TweetTranslate

class TweetTranslate

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.TweetTranslate

Attributes:
id: int

ID of Tweet

translation: str

translated tweet of Tweet

text: str

translated tweet of Tweet

source_language: str

Source Language of Tweet

destination_language: str

Tweet translated of this Language

TweetAnalytics

class TweetAnalytics

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.TweetAnalytics

Attributes:
expands: int

Number of Expands

engagements: int

Number of Engagements

follows: int

Number of Follows

impressions: int

Number of Impressions

Number of Clicks

profile_visits: int

Number of Profile Visits

cost_per_follower: int

Cost Incurred per Follower

Gif

class Gif

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Gif

Attributes:
provider: str

Provider of Gif

id: int

ID of Gif

alt_text: str

Alt Text of Gif

url: str

Direct Download URL of Gif

ScheduledTweet

class ScheduledTweet

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ScheduledTweet

Attributes:
id: str

ID of Tweet

execute_at: datetime.datetime

Time at which tweet is scheduled to be posted

text: str

Text of Tweet

reply_to_tweet_id: str

Replying to Tweet ID

media: list[ApiImage | ApiVideo | ApiGif]

ApiVideo

class ApiVideo

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ApiVideo

Attributes:
duration_ms: int

Duration of video in milliseconds

alt_text: str

Alt Text of Video

preview_image: ApiImage

Preview of Video

aspect_ratio: str

Aspect Ratio of Video

variants: list[ApiVideoVariant]

Available variants of Video

Methods:
async best_stream()

Get Best Stream available

Return: ApiVideoVariant

ApiGif

class ApiGif

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ApiGif

Attributes:
alt_text: str

Alt Text of GIf

preview_image: ApiImage

Preview of GIf

variants: list[ApiVideoVariant]

Available variants of Gif

Methods:
async best_stream()

Get Best Stream available

Return: ApiVideoVariant

ApiVideoVariant

class ApiVideoVariant

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ApiVideoVariant

Attributes:
content_type: str

Content Type of Video/Gif

alt_text: str

Alt Text of GIf

url: str

Direct Download URL

ApiImage

class ApiImage

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.ApiImage

Attributes:
alt_text: str

Alt Text of Image

width: str

Width of Image

height: str

Height of Image

url: str

Direct Download URL

Article

class Article

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Article

Attributes:
id: str

ID of Article

created_at: datetime.datetime

Time at which Article was created

edited_at: datetime.datetime

Time at which Article was edited

title: str

Title of Article

text: str

Text of Article

cover_media: ApiImage | ApiVideo | ApiGif

Header Cover Media of Article

media: list[ApiImage | ApiVideo | ApiGif]

Media of Article

GrokShare

class GrokShare

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.GrokShare

Attributes:
id: str

ID of GrokShare

messages: list[GrokShareMessage]

Message responses of share

GrokShareMessage

class GrokShareMessage

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.GrokShareMessage

Attributes:
message: str

Message text of response

media: list[str]

Direct URLs to Media

sender: str

Who is sender of this message (Agent=GROK)

GrokMessage

class GrokMessage

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.GrokMessage

Attributes:
message: str

Message text of response

created_at: datetime.datetime

Time at which this response was generated

attachments: list[GrokAttachment]

Media available as response

cited_webpages: list[GrokCitedWebPage]

Webpages cited in response

tweets: list[Tweet]

Tweets cited in response

tweets: list[str]

IDs of Tweets cited in response

GrokAttachment

class GrokAttachment

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.GrokAttachment

Attributes:
filename: str

Filename of attachment

id: str

ID of attachment

mime_type: str

Mime Type of attachment

url: str

Direct Download URL

GrokCitedWebPage

class GrokCitedWebPage

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.GrokCitedWebPage

Attributes:
favicon: str

favicon url of webpage

favicon64: str

base64 favicon of webpage

language: str

Language of Webpage

title: str

Title of Webpage

snippet: str

Preview of Webpage

url: str

URL of Webpage

GifSearch

class GifSearch

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.gifs.GifSearch

Attributes:
gifs: list[Gif]

List of Gif

GrokConversation

class GrokConversation

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.grok.GrokConversation

Attributes:
messages: list[GrokMessage]

List of Responses in the Conversation

Methods:
async get_new_response(prompt_text: str)

Generate new response from Grok against your prompt

Return: GrokMessage

Places

class Places

Bases : BaseGeneratorClass

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.places.Places

Attributes:
results: list[Place]

List of places

lat: str

Latitude of place

long: str

Longitude of place