From 77e0176dbc441d6b8c9f4d85b311a2442357c8b8 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 22 Nov 2021 10:09:03 -0500 Subject: [PATCH] [M] Move data classes from utils to twitter_process --- src/process/twitter_process.py | 31 +++++++++++++++++++++++++++++++ src/raw_collect/utils.py | 26 -------------------------- 2 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 src/process/twitter_process.py diff --git a/src/process/twitter_process.py b/src/process/twitter_process.py new file mode 100644 index 0000000..93c6371 --- /dev/null +++ b/src/process/twitter_process.py @@ -0,0 +1,31 @@ +import os +from dataclasses import dataclass +from datetime import datetime + + +@dataclass +class GeneralUser: + # Username + username: str + # A measurement of a user's popularity, such as followers count + popularity: int + # Which platform is this user from + platform: str + + +@dataclass +class Posting: + # Which platform did the user post on + platform: str + # Username on that platform + username: str + # Full text of the post's content + text: str + # Popularity of the post + popularity: int + # Is it a repost + repost: bool + # Date + date: datetime + + diff --git a/src/raw_collect/utils.py b/src/raw_collect/utils.py index 2579f63..9b2b7c3 100644 --- a/src/raw_collect/utils.py +++ b/src/raw_collect/utils.py @@ -31,32 +31,6 @@ class Config: telegram_userid: int -@dataclass -class GeneralUser: - # Username - username: str - # A measurement of a user's popularity, such as followers count - popularity: int - # Which platform is this user from - platform: str - - -@dataclass -class Posting: - # Which platform did the user post on - platform: str - # Username on that platform - username: str - # Full text of the post's content - text: str - # Popularity of the post - popularity: int - # Is it a repost - repost: bool - # Date - date: datetime - - def load_config(path: str = 'config.json5') -> Config: """ Load config using JSON5, from either the local file ~/config.json5 or from the environment variable named config.