pybee
pybee 提供一些辅助函数,方便使用 Python 来写系统维护/部署脚本, 使用 Bash 写维护/部署脚本实在不爽;例如提供 sed、awk 工具对应的功能函数,但 pybee 目标不是编写一个 python 版的 sed/awk 工具
编译
安装依赖工具
- python 3.4+
- poetry
执行下面命令安装依赖包
poetry install
编译
poetry build
pybee 模块
pybee 模块封装了或者增加常见系统维护需要的函数
- pybee.path 增强 os.path 模块的一些函数
- pybee.compress 封装 zip/tar.gz 压缩函数
- pybee.sed 提供 sed 工具类似功能的函数
- pybee.ask 封装在 termia 常见交互操作的函数
- pybee.importutil 提供把一个 py 文件当作模块 import 的函数
还有其他模块,这里就不一一列出
pybee.action 模块
在 pybee 模块的基础上把常见的操作封装成 action,下面就是一个列子
import pybee
ac = pybee.action.ActionContext([
('SCRIPT_DIR', pybee.path.get_script_path(__file__)),
('DIST_DIR', '$CURRENT_DIR/dist'),
('OUT_PUT_DIR', '$DIST_DIR/test-demo-portable'),
])
ac.prepare_dir(
[
'$DIST_DIR', '$OUT_PUT_DIR',
'$OUT_PUT_DIR/portable',
]
)
ac.check_bin([
('gradle','please install gradle', 'GRADLE_BIN'),
])
ac.exec_cmd(
[
'$GRADLE_BIN', 'packDist', '-x', 'test'
]
)
ac.unzip(
'$DIST_DIR/test-demo/test-demo.jar',
'$OUT_PUT_DIR'
)
def ignore_config_files(src, names):
return ['project.groovy', ]
ac.copy(
[
('$CURRENT_DIR/config', '$OUT_PUT_DIR', {
'ignore': ignore_config_files
}),
('$CURRENT_DIR/public', '$OUT_PUT_DIR'),
]
)
ac.copy(
[
('run.ps1', '$OUT_PUT_DIR'),
('run.sh', '$OUT_PUT_DIR'),
('portable.groovy', '$OUT_PUT_DIR/config'),
],
work_dir='$SCRIPT_DIR/portable'
)
ac.zip(
'$OUT_PUT_DIR',
'$DIST_DIR/test-demo-portable-{datetime}.zip',
env_name='DIST_FILE'
)
def print_success(context):
print('')
zip_file = context.get_env('DIST_FILE')
print('pack successfully, dist file is %s' % zip_file)
ac.execute(succ_func=print_success)
Metadata
Release files for pybee 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybee-0.3.2.tar.gz | 19.2 kB | Without provenance | Details for pybee-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybee-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for pybee-0.3.2-py3-none-any.whl |
Total release size: 42.9 kB
Release files / pybee-0.3.2.tar.gz
| Download URL | pybee-0.3.2.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6858783e709266dca9cf0071b14a480e662ec8fda11e3b68d5fb4cf176067669
|
|
BLAKE2b-256 checksum How to use checksums |
157c540c186dda457e5fa6e89185774f4884817629efd832aea7d2101bbf0f04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.7.3 Linux/4.4.0-17763-Microsoft
|
Release files / pybee-0.3.2-py3-none-any.whl
| Download URL | pybee-0.3.2-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9385e3c131952ab6b925ad434ae26cefa1aeee230d7e980d116f1ce96ddf0cc
|
|
BLAKE2b-256 checksum How to use checksums |
bc6504a1e5efc75a94cc102d28ef07887915c79a281baa64b73ad6e812beda2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.7.3 Linux/4.4.0-17763-Microsoft
|
Security for pybee 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.