3 Commits

Author SHA1 Message Date
3b8e28e077 config example was added 2025-10-30 07:59:35 +03:00
296b6404d2 Update pyproject.toml 2025-10-28 14:47:36 +03:00
38fdd347a5 Update pyproject.toml 2025-10-28 10:34:26 +03:00
4 changed files with 178 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
src/config_manager/__pycache__/basic_application.cpython-312.pyc
venv/
.vscode/

View File

@@ -1,3 +1,24 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "config_manager"
version = "1.0.2"
description = "Config manager for building applications"
authors = [
{ name = "Aleksei Zosimov", email = "lesha.spb@gmail.com" }
]
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"PyYAML>=6.0",
]
[project.urls]
Homepage = "https://git.lesha.spb.ru/alex/config_manager"
Documentation = "https://git.lesha.spb.ru/alex/config_manager"
Repository = "https://git.lesha.spb.ru/alex/config_manager"
[tool.setuptools.packages.find]
where = ["src"]

53
src/config.yaml Normal file
View File

@@ -0,0 +1,53 @@
# === Раздел с общими конфигурационными параметрами ===
runtime: 5
# === Логирование ===
log:
version: 1
disable_existing_loggers: False
formatters:
standard:
format: '%(asctime)s %(name)30s [%(levelname)8s]: %(message)s'
telegram:
format: '%(message)s'
handlers:
console:
level: DEBUG
formatter: standard
class: logging.StreamHandler
stream: ext://sys.stdout # Default is stderr
file:
level: DEBUG
formatter: standard
class: logging.handlers.RotatingFileHandler
filename: logs/log.log
mode: a
maxBytes: 500000
backupCount: 15
#telegram:
# level: CRITICAL
# formatter: telegram
# class: logging_telegram_handler.TelegramHandler
# chat_id: 211945135
# alias: "PDC"
# -- Логгеры --
loggers:
'':
handlers: [console, file]
level: ERROR
propagate: False
__main__:
handlers: [console, file]
level: WARNING
propagate: False
config_manager:
handlers: [console, file]
level: DEBUG

100
src/config_test.yaml Normal file
View File

@@ -0,0 +1,100 @@
# === Раздел с общими конфигурационными параметрами ===
runtime:
symbols: ["BTC_USDT", "ETH_USDT", "USDD_USDT", "TRX_USDT", "BTT_USDT", "NFT_USDT", "XRP_USDT",
"ETH_BTC", "XRP_BTC", "TRX_BTC", "LTC_BTC", "EOS_BTC", "XMR_BTC", "DOGE_BTC",
"NFT_TRX", "ETH_TRX", "JST_TRX", "XRP_TRX",
"ETHBULL_USDT", "BULL_USDT", "BEAR_USDT", "ADABULL_USDT"]
updateTimeout: 45
errorTimeout: 10
orderbook:
levels: [ 0.0, 0.2, 0.4, 0.6, 0.8,
1.0, 1.2, 1.4, 1.6, 1.8,
2.0, 2.2, 2.4, 2.6, 2.8,
3.0, 3.3, 3.6, 3.9,
4.2, 4.5, 4.8,
5.1, 5.4, 5.7, 100 ]
trades:
depth: 300
# === Database params ===
db:
#host: 185.117.118.107
host: 92.53.127.143
port: 59000
database: rt5_dev
# === Логирование ===
log:
version: 1
disable_existing_loggers: False
formatters:
standard:
format: '%(asctime)s %(name)30s [%(levelname)8s]: %(message)s'
telegram:
format: '%(message)s'
handlers:
console:
level: DEBUG
formatter: standard
class: logging.StreamHandler
stream: ext://sys.stdout # Default is stderr
file:
level: DEBUG
formatter: standard
class: logging.handlers.RotatingFileHandler
filename: logs/log.log
mode: a
maxBytes: 500000
backupCount: 15
telegram:
level: CRITICAL
formatter: telegram
class: logging_telegram_handler.TelegramHandler
chat_id: 211945135
alias: "PDC"
# -- Логгеры --
loggers:
'':
handlers: [console, file]
level: ERROR
propagate: False
__main__:
handlers: [console, file, telegram]
level: WARNING
propagate: False
basic_application:
handlers: [console, file, telegram]
level: INFO
config_manager:
level: INFO
log_manager:
level: INFO
poloniex.public:
level: ERROR
controllers.abstract:
level: ERROR
controllers.trades:
level: ERROR
controllers.orderbook:
level: ERROR
clickhouse_connector.clickhouse_connector:
level: ERROR