Python Package Template
📦 一个快速搭建 Python Package 的模版。
使用方法
-
点击本项目右上角的绿色按钮
Use this template(使用此模板),输入名称和说明,完成创建; -
将项目克隆到本地,这里以本项目为例,实际操作时这里需要替换你自己的项目;
git clone https://github.com/HaveTwoBrush/python-package-template.git --depth 1
-
修改配置,文件中有提示;
cd python-package-template # 1. 将下文中的 your_package_name 改成你的实际项目名称 mv package_name your_package_name # 2. 接下来修改 `setup.py /package_name/shell/usage.py`中的参数,里面有提示。 # 3. 最后 `README.md` 修改为你的项目介绍,也就是你当前在读的这个文本。
-
编写你的 Package 代码;
-
上传到 PyPi(需要注册),参考如何发布自己的包到 pypi ;
bash scripts/upload_pypi.sh -
更新到 Github。
git push
项目结构
.
├── package_name # 你需要手动修改为你的项目名称
│ ├── shell # 在命令行中执行的代码
│ │ ├── __init__.py
│ │ └── usage.py
│ ├── src # 静态资源
│ │ └── temp.txt
│ └── version.py # 版本号
├── setup.py # 安装配置
├── requirements.txt # 包依赖
├── requirements_dev.txt # 开发依赖
├── README.md # 项目文档
├── LICENSE # 这里面的内容为本项目的 License,你需要手动替换它。
├── .gitignore
└── upload_pypi.sh # 上传到 PyPi 的工具
许可
TODO
- 增加自动修改
package name的脚本。 - 增加 test 相关代码。
参考
Metadata
Release files for mtvs 0.0.1
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 |
|---|---|---|---|---|
| mtvs-0.0.1.tar.gz | 3.5 kB | Without provenance | Details for mtvs-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mtvs-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for mtvs-0.0.1-py3-none-any.whl |
Total release size: 7.2 kB
Release files / mtvs-0.0.1.tar.gz
| Download URL | mtvs-0.0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1b559e283fd1ec584860ea4150b14b74b08f8b06427057eb02d34da2798ba59
|
|
BLAKE2b-256 checksum How to use checksums |
caf558c6fee3e3922742fd67874dfa313606fe2d1ff1ac5f16bf7b86e8b84ba7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / mtvs-0.0.1-py3-none-any.whl
| Download URL | mtvs-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02c5fbd32aebf3b53018f75ab60c1ab470e37f9e6b8ea9b470c90ee2c4c2ac75
|
|
BLAKE2b-256 checksum How to use checksums |
c3df9cbc2d99ad4a0a679e80e9f770b8392d5106797d9fa939725e58a73f01db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for mtvs 0.0.1
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.