个人常用功能封装
Project description
common tool library for silvaq
silvaq-pylib
我自己常用的功能封装起来,方便自己日常使用
- version 0.1.5 :
- 新增了日期常规方法
工具库
- file 文件相关
- dir 目录相关
- time 日期、时间相关
- mail 发送邮件相关
- logger 日志相关
安装
pip3 install silvaq-pylib
更新
pip3 install --upgrade silvaq-pylib
使用
from silvaq_libs import file as silva_file
from silvaq_libs import dir as silva_dir
from silvaq_libs.mail import Server as SilvaMailServer
from silvaq_libs.logger import Logger as SilvaLogger
if __name__ == '__main__':
# for files
silva_file.exist("/tmp/test.txt")
#for dir
silva_dir.maketree("a/b/c/d")
# for mail
params_dict = {
'host': "server_host",
'sender': "sender",
'password': "password",
'username': 'username',
'port': 25,
}
to="somebody"
sub="somesub"
con="somecon"
SilvaMailServer(**params_dict).send_mail(to,sub,con)
#for logger
logger = SilvaLogger("log_path","log_file_prefix","log_file_suffix","halder_container_cap")
logger.log("some con")
logger.log("some con again")
# ... more log here
# notice 目前所有配置都是默认项,所以日志是实时写入的,如果有需求想用缓冲请自行查阅并修改创建hander时open 的buffer
# todo 这一项将提供可选方法
logger.commit()
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
silvaq-lib-0.1.5.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for silvaq_lib-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dee627161385304f31124a82173ca44f744b1bd2a0bdc146b833d2b6ff4eed9 |
|
MD5 | ae9e0dc0f8c731e04a25984f21061fab |
|
BLAKE2b-256 | 1a23965726bbb7f129405ba1ea96c3f8f6c5fe577168f0c15859d66bbb22b436 |