sense core
Project description
sense-core
sense-core目前包含的功能主要有:
1)配置解析和管理
2)日志打印和收集
3)mysql、es、redis、rabbit基类
4)唯一主键生成
5)实用函数
安装方式
pip install sense-core
使用指南
使用
import sense_core as sd
导入模块
配置解析和管理
约定:项目根目录放置配置文件settings.ini,按模块label分块配置各服务模块,格式类似:
[rabbit]
host = 52.82.48.248
port = 5672
user = admin
password = sense_mq@2018
通用配置(如log_path)放到[settings]下,[settings]建议放到配置文件最后。
程序内通过sd.config('label','item')调用。
日志打印和收集
日志调用的方法有:
log_init_config(module='unknown', root_path='.', monit_queue='')
log_info(msg)
log_warn(msg)
log_error(msg, need_monit=True, module='')
sqlalchemy
es
redis
rabbit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sense-core-0.1.0.tar.gz
(13.9 kB
view hashes)
Built Distribution
sense_core-0.1.0-py3-none-any.whl
(16.3 kB
view hashes)
Close
Hashes for sense_core-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc9de470f2e71fc65e22e5553ced3d8f8318a1bb76875cf68a5f7ce59856edf |
|
MD5 | 4bac20fafa60546099b8a37e417fa69f |
|
BLAKE2b-256 | 4c02f85dcf93158f3704d3dcf9a7c1885be8885bb84335f5e6f8f9f77e97760b |