nb_libs
Project description
各种日常工具
安装
pip install nb_libs
1. restart_program每隔多久重启代码自身。
import time
import datetime
from nb_libs.restart_programe_by_interval import restart_program
def _run():
print(datetime.datetime.now(), '开始运行程序')
for i in range(1000):
time.sleep(0.5)
print(datetime.datetime.now(), i)
if __name__ == '__main__':
restart_program(10) # 每隔10秒重启。
_run()
2. nb_time.DatetimeConverter
好用的时间转换,类型兼容强,入参可以是时间戳 字符串 datatime类型 DatetimeConverter 类型.
3 auto_git.GitBranchMerge
git 自动化 分支合并.
多人合作项目git开发流程一般是:
自己分支写代码 -> 自己分支commit -> 自己分支push到远程 -> 切换到开发develop分支 -> 在develop分支 git pull -> 把自己分merge到develop分支 -> develop分支 push到远程
开发环境代码拉取develop代码重启部署,测试出现问题后,需要反复执行git繁琐的流程,整个过程如果手动人工操作git太折磨人了, auto_git.GitBranchMerge 一键执行以上操作,如果有某一步git命令出现错误或冲突,是会中断操作的,不用担心.
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
nb_libs-0.4.tar.gz
(2.4 kB
view details)
Built Distribution
nb_libs-0.4-py3-none-any.whl
(2.0 kB
view details)
File details
Details for the file nb_libs-0.4.tar.gz
.
File metadata
- Download URL: nb_libs-0.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbd7e12bd6d2e51b8dacc182d12043e5ac3a4948f39614720dcd0702550c362e |
|
MD5 | b6ccc73c556152cd37688057fc794da3 |
|
BLAKE2b-256 | 2e2873aad3539a89a14cee5198fc18f41bcec595992d6966a68afd0511b9cad2 |
File details
Details for the file nb_libs-0.4-py3-none-any.whl
.
File metadata
- Download URL: nb_libs-0.4-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b97ebaf34c023cee9008ec88f0b8eabcb4f7c13736b6e5aeb55ce173caa4782b |
|
MD5 | 764dfed66937165bf0d5f1c3e576db78 |
|
BLAKE2b-256 | eaf2c75ecc66063cd8bbf00961a9a438b06ded79ab394f1c8ef440ad9317dc31 |