Skip to main content

Python Package Template

📦 一个快速搭建 Python Package 的模版。

使用方法

  1. 点击本项目右上角的绿色按钮 Use this template(使用此模板),输入名称和说明,完成创建;

  2. 将项目克隆到本地,这里以本项目为例,实际操作时这里需要替换你自己的项目;

    git clone https://github.com/HaveTwoBrush/python-package-template.git --depth 1
    
  3. 修改配置,文件中有提示;

    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` 修改为你的项目介绍,也就是你当前在读的这个文本。
    
  4. 编写你的 Package 代码;

  5. 上传到 PyPi(需要注册),参考如何发布自己的包到 pypi

    bash scripts/upload_pypi.sh
    
  6. 更新到 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 相关代码。

参考

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtvs-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mtvs-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file mtvs-0.0.1.tar.gz.

File metadata

  • Download URL: mtvs-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for mtvs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b1b559e283fd1ec584860ea4150b14b74b08f8b06427057eb02d34da2798ba59
MD5 d7af75fe19b4e3fde858e32f5f7077cc
BLAKE2b-256 caf558c6fee3e3922742fd67874dfa313606fe2d1ff1ac5f16bf7b86e8b84ba7

See more details on using hashes here.

File details

Details for the file mtvs-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: mtvs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for mtvs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02c5fbd32aebf3b53018f75ab60c1ab470e37f9e6b8ea9b470c90ee2c4c2ac75
MD5 ef4b0f42b0479785014a1ed5916d66e1
BLAKE2b-256 c3df9cbc2d99ad4a0a679e80e9f770b8392d5106797d9fa939725e58a73f01db

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page