Skip to main content

个人python工具集

Project description

My python util collections

我的个人python工具集,模块构建流程:

项目结构

├── README.md
├── pyproject.toml
├── src
│   └── pyutils
│       ├── __init__.py
│       ├── base_sqlite_db.py
│       ├── my_log.py
│       ├── utils.py
│       └── zip.py
└── tests
    └── test.py

Module模块构建

  • 1、示例(使用 setuptools):

    #在pyproject.toml文件
    
    [build-system]
    requires = ["setuptools>=61.0"]
    build-backend = "setuptools.build_meta"
    
    [project]
    name = "your-package-name"
    version = "0.1.0"
    description = "简短描述"
    readme = "README.md"
    requires-python = ">=3.7"
    license = {text = "MIT"}
    authors = [
    {name = "你的名字", email = "你@邮箱.com"}
    ]
    dependencies = [
    "requests>=2.0",  # 依赖示例
    ]
    
    [project.urls]
    Homepage = "https://github.com/yourname/yourproject"
    
  • 2、构建包

    • 先安装打包工具(一次性操作):
    pip install build
    
    • 然后在项目根目录运行:
    python -m build
    
    • 会生成:
    dist/
    ├── your_package_name-0.1.0.tar.gz
    └── your_package_name-0.1.0-py3-none-any.whl
    

上传到 PyPI

安装上传工具:

pip install twine

注册并获取 PyPI 账号

上传:

twine upload dist/*

输入你的 PyPI 用户名和密码即可。

💡 建议先上传到测试环境 Test PyPI:

💡 Because TestPyPI has a separate database from the live PyPI, you’ll need a separate user account specifically for TestPyPI. Go to https://test.pypi.org/account/register/ to register your account.

twine upload --repository testpypi dist/*

在其他项目中安装

pip install your-package-name

或者从 Test PyPI:

pip install --index-url https://test.pypi.org/simple/ your-package-name

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

pripy_utils-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

pripy_utils-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pripy_utils-0.1.0.tar.gz.

File metadata

  • Download URL: pripy_utils-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pripy_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4b6f1890fe01faae956451ddb9cc0e5177dcc29f9788b04ba269f1fafa3c5b8
MD5 b989f0ed4592c4a05850ce9379186358
BLAKE2b-256 ff4b727edbe5006f6ac432d9cd51918b8d4edeffe7151241b1633d7bbe4c7537

See more details on using hashes here.

File details

Details for the file pripy_utils-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pripy_utils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pripy_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33cfe7c86c90b5038d87ee7ae2be5517bbd87442090493d5cbd89fe4dbd6af8b
MD5 965e1e68a4b2d336c31fc5b094f26597
BLAKE2b-256 2680a0a6de31b3d757e1de8a8e44a950026c7b60b736dc3ea67e1348b71795c7

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