一个简单的 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yeannhua_example_package_demo-0.2.0.tar.gz.
File metadata
- Download URL: yeannhua_example_package_demo-0.2.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b85c70c0bc5b0efdee499b6e4cadd1746d8159bc1929b7eae2af681d466734
|
|
| MD5 |
277b07d5fb7dab5867c0d7bb9ad95e41
|
|
| BLAKE2b-256 |
5d87f0f30bb370a5056193756368dc09762c336572d617795ee91e08136b85dc
|
File details
Details for the file yeannhua_example_package_demo-0.2.0-py3-none-any.whl.
File metadata
- Download URL: yeannhua_example_package_demo-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6d3ed107fa7d992a28c12f3351665e1f9b0065145d3cb1fab347f882f534fa7
|
|
| MD5 |
8bc26eccfbc8c5a771af9b843e2673cd
|
|
| BLAKE2b-256 |
6d1c0b3551cd1ffc51a084a1f1617a4af91da8ec23c060cb4f5e35ae18492447
|