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.1.tar.gz (5.0 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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pripy_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 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.1.tar.gz
Algorithm Hash digest
SHA256 54be6158a2082dc376204379ab2c01dd814a8a3867635e99797cce3f3d20617b
MD5 50aa18152beb1cacfb9c6e5703b4021c
BLAKE2b-256 0867c603b3e871dad9e4f284feaa6b5a8a6efd5f2526a2009db81a70d374e46c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pripy_utils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7da54fafe6b44d0b4ac4cedb649880072b0b2fe5786f2418c843dab77b21f67c
MD5 792fda83fadac7da67c32fc5b1132536
BLAKE2b-256 5532621bb7fe8dd04b5e9b33faf936453c1fe9aa72e6f55557fd6f3f64e9bcdc

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