个人常用功能封装
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file silvaq-lib-0.1.5.tar.gz.
File metadata
- Download URL: silvaq-lib-0.1.5.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.11.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a475241b56d78df0e477cfb9779b4f0773b8c875f22cc28e7cf0019410ecd719
|
|
| MD5 |
2395c731e82cfc58dca94aa48746abf1
|
|
| BLAKE2b-256 |
963f612f9d193a8012faef0a2287f6769883f72b403a2c77c8fa75c17698a918
|
File details
Details for the file silvaq_lib-0.1.5-py3-none-any.whl.
File metadata
- Download URL: silvaq_lib-0.1.5-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.11.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dee627161385304f31124a82173ca44f744b1bd2a0bdc146b833d2b6ff4eed9
|
|
| MD5 |
ae9e0dc0f8c731e04a25984f21061fab
|
|
| BLAKE2b-256 |
1a23965726bbb7f129405ba1ea96c3f8f6c5fe577168f0c15859d66bbb22b436
|