Skip to main content

your project description

Project description

Python Package Template

📦 一个快速上传到 PyPIPython Package 模版。

上传到 PyPI 后可以使用 pip install 安装。

1 使用方法

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

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

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

    cd your_package_name
    
    # 1. 替换默认项目名称 package_name 为你的项目名称
    # Usage: bash scripts/set_package_name.sh os_name old_name new_name
    # os_name 支持的有 `mac` 和 `linux`
    # old_name 是 package_name
    # new_name 是你的项目名称
    bash scripts/set_package_name.sh mac package_name your_package_name
    
    # 2. 将 `README.md` 修改为你的项目介绍,也就是你当前在读的这个文本。
    
  4. 编写你的 Package 代码,并进行测试。

    # 在本地进行充分测试
    bash scripts/local_test.sh
    
  5. 上传到 PyPi(需要注册),参考如何发布自己的包到 pypi

    bash scripts/upload_pypi.sh
    
  6. 更新到 Github(非必须)。

    git push
    

2 项目结构

.
├── README.md # 项目文档
├── package_name # 项目名称
│    ├── shell # 在命令行中执行的代码
│    │    ├── __init__.py
│    │    └── usage.py
├── scripts # 一些常用脚本
│    ├── set_package_name.sh # 批量替换默认的项目名称
│    ├── local_install.sh # 本地安装
│    ├── local_test.sh # 本地测试
│    └── upload_pypi.sh # 上传到 pypi
├── requirements.txt # 项目依赖
├── .gitignore # 忽略文件
├── MANIFEST.in # 要包含在 sdist 命令构建的分发中的文件列表。
├── LICENSE # 这里面的内容为本项目的 License,你需要手动替换它。
└── setup.py # 安装配置

3 参考

Project details


Download files

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

Source Distribution

testpg-0.0.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

testpg-0.0.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file testpg-0.0.2.tar.gz.

File metadata

  • Download URL: testpg-0.0.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.8

File hashes

Hashes for testpg-0.0.2.tar.gz
Algorithm Hash digest
SHA256 53a195e32fc4c9826382582b6d5a924351c735ba220b80a68bdb129de34c4781
MD5 fc07765d2303b64e7d81ae46a0bbb27c
BLAKE2b-256 6f479fee5a48d8b7962d56594d3b3704a3d39036af0a13e4e3599871c3ef72bf

See more details on using hashes here.

File details

Details for the file testpg-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: testpg-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.8

File hashes

Hashes for testpg-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e39c4fe1fccd602a74813659015691bb0ff2b3c51d867f5dc642a80cc5137f9e
MD5 4a7548640537ce667a870850ea69fc6a
BLAKE2b-256 9d6789462c6ad4749e570debb7c1e11ecebe57498ada5da67787deac2af6e596

See more details on using hashes here.

Supported by

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