semvec/pypi-packages huggingface dataset:
dingtalk-log-handler 0.0.7
log handler for send message to dingtalk
Requires Python: >=3.5

# 钉钉群告警Handler

通过钉钉群机器人, 发送Python日志到钉钉群

参考钉钉群机器人接口 https://open.dingtalk.com/document/robots/custom-robot-access

## 安装
pip install dingtalk-log-handler

## 打包
python setup.py sdist

## 参数
- webhook: webhook url for dingtalk open api
- keyword: allowed message keyword, default 'alarm'
- secret: secret for dingtalk open api
- hostname: hostname for identify machine, default local ip address
- timeout: http request timeout, default 1 second
- cert_verify: verify SSL certificates or not, default True

## 使用示例
```python
import logging
import logging.config

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '[%(levelname)s %(asctime)s %(name)s %(funcName)s %(lineno)d %(process)d]\t%(message)s'
        },
    },
    'handlers': {
        'dingtalk':{
            'class': 'dingtalk_log_handler.DingTalkHandler',
            'webhook': 'https://oapi.dingtalk.com/robot/send?access_token=XXXXX',
            # 'secret': '',
            # 'keyword': '',
            'formatter':'verbose',
            'level': 'ERROR',
        },
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        '': {
            'handlers': ['dingtalk', 'console'],
            'level': 'INFO',
            'propagate': False,
        },
    }
}

logging.config.dictConfig(LOGGING)
logging.error('testing')
```
argnbox 0.0.1
A Python package for synthetic data augmentation
Requires Python: >=3.7

1. Use!
2. import pandas as pd
3. import argnbox
4. from argnbox import Syndbox
5. df=pd.read_excel('/content/filename.xlsx')
6. df1=Syndbox.TESI(df, Equation='Euc_p1', start=0.01, augmentation_factor=10)
7.                             
8. df1.pd_frame(save=True)
9. df1.arr()
10. 
11. 
12. Parameters 
13. start: (float), default=0.01, The starting value of the angle sequence.
14. stop: (int), default=1, The end value of the angle's sines vector. Should be always 1 because the angle's max sine is 1. 
15. augmentation_factor: (int), default (0.01), the number of times the data is augmented. should be from 0 to infinity.
16. Equation: default='Euc_p1', Either the Euclidian or the following transformed Euclidian formulas. 

17. 'Euc_p1': The linear polynomial.
18. 'Euc_p2': The quadratic polynomial.
19. 'Euc_p3': The cubic polynomial.
20. 'Euc_Log': The log-transformed euclidian formula.
21. 
22. Documentation
23. The TESI was developed in a study context, the study paper was published in Elsivier. 
24. A detailed description behind the logical of the TESI can be found in the paper.
25. NOTE: PLEASE CITE THE PAPER. 
26. 
27. Publisher name: Elsevier
28. Journal: Computers and Electronics in Agriculture
29. Volume: 206
30. Issue: March 2023
31. Pages: 107646
32. DOI: https://doi.org/10.1016/j.compag.2023.107646
mptrfhandler 0.0.8
支持按时间滚动的Python多进程日志Handler

# MultProcTimedRotatingFileHandler
支持按时间滚动的Python多进程日志Handler, 支支持macOS/Linux, 自用未充分测试

参考了 https://github.com/yorks/mpfhandler, 有如下优化
- 添加了intervel支持
- 支持备份自动清理
- 使用MMAP优化了性能

# 性能基准
8核CPU, 8进程, 100000条长度47字符日志测试, 相比TimedRotatingFileHandler大约有25%-30%性能损耗

随着进程数增大, 锁竞争也变激烈了, 性能损耗也会进一步增大, 100进程下会有50%-60%性能损耗

8进程, QPS情况
- MultProcTimedRotatingFileHandler: 23482
- TimedRotatingFileHandler: 30349


# 配置示例
```
import logging.config

LOGGING_CONFIG = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '[%(levelname)s %(asctime)s %(name)s %(lineno)d %(process)d %(thread)d] %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
        'backend_file':{
            'class': 'mptrfhandler.MultProcTimedRotatingFileHandler',
            'filename': 'main.log',
            'when': 'H',  # 按小时滚动
            'backupCount': 10,                                   #备份份数
            'formatter':'verbose',                              #使用哪种formatters日志格式
            'level': 'DEBUG',
            'delay': True,
        },
    },
    'loggers': {
        '': {
            'handlers': ['backend_file'],
            'level': "INFO",
            'propagate': False,
        },
    },
}

logging.config.dictConfig(LOGGING_CONFIG)
```