Files
Excel-project2/schema/pydantic.py
2026-02-23 13:22:55 +03:00

35 lines
795 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pydantic import BaseModel
from pydantic_settings import BaseSettings, SettingsConfigDict
import json
class Settings(BaseSettings):
INPUTDIR:str
OUTPUTDIR:str
PATTERN:str
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8"
)
class JsonRead():
def __init__(self):
with open("columns.json", "r", encoding="utf-8") as f:
self.data = json.load(f)
def merchant(self, key):
return self.data.get(key)
class Translit():
TRANSLIT = {
'А': 'A',
'В': 'B',
'Е': 'E',
'К': 'K',
'М': 'M',
'Н': 'H',
'О': 'O',
'Р': 'P',
'С': 'C',
'Т': 'T',
'Х': 'X',
}
settings = Settings()
jsonread = JsonRead()