TJW 私人项目 - 提供身份证工具等实用功能的命令行工具和API服务
Project description
TJW
一个最简单的PYPI 发布包的样例,PIP安装后,即可使用,提供基础的命令行功能和数值操作。
功能特性
- 命令行工具:提供
helloworld和hello两个命令 - 数值操作:支持简单的数值加1操作
- 易于扩展:模块化设计,便于添加新功能
安装
使用 pip 安装:
pip install --upgrade tjw
查看安装信息:
pip show tjw
使用方法
终端PYTHON直接使用
python -c "from tjw import hello; print(hello(number=43))"
# 输出:43
作为库在项目中使用
from tjw.core import tjw_class, hello
# 使用 tjw_class
tjw = tjw_class()
print(tjw.helloworld(name="张三")) # 输出:helloworld,[张三]!
# 使用 hello 函数
result = hello(number=42)
print(f"结果: {result}") # 输出:结果: 43
命令行使用
查看帮助信息:
tjw --help
输出问候信息:
tjw helloworld --name 张三
# 输出:helloworld,[张三]!
执行数值加1操作:
tjw hello --number 42
# 输出:结果: 43
项目结构
tjwpip/
├── tjw/
│ ├── __init__.py
│ ├── cli.py # 命令行接口
│ └── core.py # 核心功能
├── setup.py # 包配置
├── publish.py # 发布脚本
├── README.md # 项目文档
└── requirements.txt # 依赖配置
发布指南
-
注册 PyPI 账号:
-
创建 API Token:
- 登录 PyPI 后,访问 https://pypi.org/manage/account/
- 点击 "Add API token" 创建新的 API token
- 复制生成的 token
-
配置环境变量:
- 在项目根目录创建
.env文件 - 添加以下内容:
PYPI_API_TOKEN=你的API token
- 在项目根目录创建
-
运行发布脚本:
python publish.py发布脚本会自动:
- 检查 PyPI 上的最新版本
- 自动版本号加1
- 打包项目
- 上传到 PyPI
- 清理临时文件
版本信息
- 当前版本:1.0.4
- 发布地址:https://pypi.org/project/tjw/
许可证
MIT 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
tjw-1.0.21.tar.gz
(69.9 kB
view details)
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
tjw-1.0.21-py3-none-any.whl
(70.8 kB
view details)
File details
Details for the file tjw-1.0.21.tar.gz.
File metadata
- Download URL: tjw-1.0.21.tar.gz
- Upload date:
- Size: 69.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ea2b81e2d0a9d814464a98bdf0331edcda95b239f25d979a9101a2af53a93e7
|
|
| MD5 |
05e407f6643017f9e64773a41331bc0f
|
|
| BLAKE2b-256 |
f1e2140a735c87131db2157d3a2ccc6d04de428ba8968d72a3b87592dfa748c2
|
File details
Details for the file tjw-1.0.21-py3-none-any.whl.
File metadata
- Download URL: tjw-1.0.21-py3-none-any.whl
- Upload date:
- Size: 70.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53594d2e29e39e62ce82b1fd175b239338dd41facf107017916994015a8428ed
|
|
| MD5 |
f66ca7947cebabd94fa694e6b3f276ac
|
|
| BLAKE2b-256 |
5b16a8f95222ac1b3edda07c0a94edeb36cdbdb9c905542642f383209252cb7b
|