[+] Create user and tweet dataclasses

This commit is contained in:
Hykilpikonna
2021-11-03 16:22:20 -04:00
parent af203e4c2f
commit 05e511c743
+49
View File
@@ -5,6 +5,55 @@ from typing import Union
import tweepy
from collect.utils import Config
@dataclass
class User:
id: int
id_str: str
name: str
screen_name: str
location: str
description: str
url: str
entities: dict
protected: bool
followers_count: int
friends_count: int
listed_count: int
created_at: datetime
favourites_count: int
verified: bool
statuses_count: int
@dataclass
class Tweet:
created_at: datetime
id: int
id_str: str
full_text: str
truncated: bool
display_text_range: list[int]
entities: dict[str: list]
source: str
in_reply_to_status_id: int
in_reply_to_status_id_str: str
in_reply_to_user_id: int
in_reply_to_user_id_str: str
in_reply_to_screen_name: str
geo: str
coordinates: str
is_quote_status: bool
retweet_status: Union[dict, None]
retweet_count: int
favorite_count: int
def tweepy_login(conf: Config) -> tweepy.API:
"""
Login to tweepy