Skip to main content

一个简单的 Python 包示例,用于演示如何发布到 PyPI

Project description

Example Package

一个简单的 Python 包示例,用于演示如何发布到 PyPI。

功能特性

  • 简单的字符串处理函数
  • 数值计算函数
  • 字典格式化和打印工具

安装

pip install yeannhua-example-package-demo

使用方法

基本函数

from example_package import hello, add

# 使用 hello 函数
print(hello("World"))
# 输出: Hello, World!

# 使用 add 函数
result = add(1, 2)
print(result)
# 输出: 3

字典打印工具

from example_package import print_dict

# 格式化打印字典
data = {
    "name": "John",
    "age": 30,
    "hobbies": ["reading", "coding"],
    "address": {
        "city": "Shanghai",
        "country": "China"
    }
}

print_dict(data)
# 输出格式化的 JSON 字符串

运行示例

python -m example_package.main

# 或运行完整的测试示例
python3 examples/test.py

开发

运行测试

pytest tests/

发布

# 发布到 TestPyPI(测试)
./scripts/publish_testpypi.sh

# 发布到正式 PyPI
./scripts/publish_pypi.sh

文档

版本历史

查看 CHANGELOG.md 了解详细的版本更新历史。

许可证

MIT License - 查看 LICENSE 文件

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

yeannhua_example_package_demo-0.2.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

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

yeannhua_example_package_demo-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file yeannhua_example_package_demo-0.2.0.tar.gz.

File metadata

File hashes

Hashes for yeannhua_example_package_demo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 57b85c70c0bc5b0efdee499b6e4cadd1746d8159bc1929b7eae2af681d466734
MD5 277b07d5fb7dab5867c0d7bb9ad95e41
BLAKE2b-256 5d87f0f30bb370a5056193756368dc09762c336572d617795ee91e08136b85dc

See more details on using hashes here.

File details

Details for the file yeannhua_example_package_demo-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yeannhua_example_package_demo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d3ed107fa7d992a28c12f3351665e1f9b0065145d3cb1fab347f882f534fa7
MD5 8bc26eccfbc8c5a771af9b843e2673cd
BLAKE2b-256 6d1c0b3551cd1ffc51a084a1f1617a4af91da8ec23c060cb4f5e35ae18492447

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