Files
redmine_tracker/config.py
2025-05-15 13:44:09 +03:00

55 lines
1.0 KiB
Python

from pydantic_settings import BaseSettings
class Config(BaseSettings):
CLOCKIFY_TOKEN: str
REDMINE_TOKEN: str
CLOCKIFY_USER_ID: str
CLOCKIFY_WORKSPACE_ID: str
DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%SZ"
class RedmineConfig:
@property
def base_url(self):
return "https://redmine.sbps.ru"
@property
def time_entries_url(self):
return "/time_entries.json"
@property
def my_account_url(self):
return "/my/account.json"
@property
def datetime_format(self):
return "%Y-%m-%d"
class ClockifyConfig:
@property
def base_url(self):
return "https://api.clockify.me/api/v1"
@property
def tags_url(self):
return "/workspaces/{workspace_id}/tags"
@property
def time_entries_url(self):
return "/workspaces/{workspace_id}/user/{user_id}/time-entries"
@property
def user_url(self):
return "/user"
@property
def datetime_format(self):
return "%Y-%m-%dT%H:%M:%SZ"
config = Config()