From 05e511c743b911fc883447c0b790561c5a65dba3 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 3 Nov 2021 16:22:20 -0400 Subject: [PATCH] [+] Create user and tweet dataclasses --- collect/twitter.py | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/collect/twitter.py b/collect/twitter.py index 39f39a0..b400778 100644 --- a/collect/twitter.py +++ b/collect/twitter.py @@ -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