TwDataTypes

This page contains all the Data Class returned by the different methods

UserTweets

class UserTweets

Bases : dict

Note

This Object is JSON Serializable and Iterable

Reference:

tweety.types.usertweet.UserTweets

Attributes:
tweets: list

List of User Tweets

get_replies: bool

Either to get replies or Not

cursor: str

Cursor for next page

is_next_page: bool

Is next page of tweets available

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
get_next_page()

Get next page of tweets if available

Return: list[Tweet]
__repr__()

Developer Representation of the Object

Return: str
Returns:

UserTweets(user={username}, count={number_of_results})

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

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

media: list[Media]

Media of the Tweet

user_mentions: list[ShortUser]

Users mentioned in the Tweet

urls: list[str]

URLs mentioned in the Tweet

hashtags: list[str]

Hashtags mentioned in the Tweet

symbols: list[str]

Symbols mentioned in the Tweet

threads: list[Tweet]

List of Threaded Tweets

comments: list[Tweet]

List of Comments sent in response to this Tweet

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

Tweet(id=id_of_tweet, author=author_of_tweet, created_on=tweet_creation_date, threads=number_of_threads)

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 | image)

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

Methods:
download(filename=None, show_progress=True)

Download the Media

Arguments:
filename(optional): str = None

Filename of the Media

show_progress(optional): bool = True

Either to show the download progress or not

Return: filename | None
__repr__()

Developer Representation of the Object

Return: str
Value:

Media(id=id_of_media, type=type_of_media)

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:
download(filename=None, show_progress=True)

Download the Media

Arguments:
filename(optional): str = None

Filename of the Media

show_progress(optional): bool = True

Either to show the download progress or not

Return: filename | None
__repr__()

Developer Representation of the Object

Return: str
Value:

Stream(content_type=content_type_of_stream, length=length_of_stream_in_millis, bitrate=bitrate_of_media_audio, res=resolution_of_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

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

ShortUser(id=id_of_the_user, name=name_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

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

Card(id=rest_id_of_card, choices=list_of_choices, end_time=end_time_of_card, duration=duration_of_card)

Choice

class Choice

Bases : dict

Note

This Object is JSON Serializable

Reference:

tweety.types.twDataTypes.Choice

Attributes:
name: str

Name of the choice

value: str

Value of the choice

type: str

Type of the choice value

counts: str

Number of the votes this value has

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

Choice(name=name_of_choice, value=value_of_choice, counts=number_of_votes_this_choice_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

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

Place(id=id_of_place, name=name_of_place, country=country_of_place, coordinates=coordinates_of_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

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

Coordinates(latitude=latitude, longitude=longitude)

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

entities: dict

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

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 | None

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]

List of id of tweets pinned by the user

Methods:
__repr__()

Developer Representation of the Object

Return: str
Value:

User(id=rest_id_of_user, name=name_of_the_user, username=username_of_the_user, followers=number_of_followers_of_user, verified=is_user_verified)