[M] Move data classes from utils to twitter_process

This commit is contained in:
Hykilpikonna
2021-11-22 10:09:03 -05:00
parent 991fef7e13
commit 77e0176dbc
2 changed files with 31 additions and 26 deletions
+31
View File
@@ -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
-26
View File
@@ -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.