-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
26 lines (21 loc) · 799 Bytes
/
Copy pathconfig.py
File metadata and controls
26 lines (21 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from dataclasses import dataclass
from datetime import date
from pathlib import Path
@dataclass(frozen=False)
class Config:
data_path: Path = Path("data")
target_date: date = date.today()
parallel: int = 20
batch_size: int = 500
amount_threshold = 10000000
inited_db: bool = False
is_trading_day: bool = True
def __post_init__(self):
self.db_path: Path = self.data_path / "myak.db"
self.fs_path = self.data_path / "fs" / self.target_date.strftime("%Y-%m-%d")
self.tc_path = self.data_path / "tc.json"
def update_paths(self):
self.db_path: Path = self.data_path / "myak.db"
self.fs_path = self.data_path / "fs" / self.target_date.strftime("%Y-%m-%d")
self.tc_path = self.data_path / "tc.json"
config = Config()