[M] Move data classes from utils to twitter_process
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|
||||||
@@ -31,32 +31,6 @@ class Config:
|
|||||||
telegram_userid: int
|
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:
|
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.
|
Load config using JSON5, from either the local file ~/config.json5 or from the environment variable named config.
|
||||||
|
|||||||
Reference in New Issue
Block a user