🚀 pytmpl - Python项目模板生成器
📦 项目简介
pytmpl 是一个交互式的Python项目模板生成工具,支持多种应用场景,帮助你快速搭建标准化的Python项目结构。
🛠️ 安装方法
# 推荐使用poetry安装
poetry add pytmpl
# 或者通过pip
pip install pytmpl
✨ 使用示例
# 终端交互式创建项目
pytmpl
# 或使用简写
pt
⚙️ 支持的参数与功能
- 🏷️ 语言选择(中文/English,默认中文)
- 📁 项目名(必填)
- 📂 项目创建路径(默认当前目录)
- 🏗️ 场景选择(后端库、Web、命令行、数据分析、机器学习、爬虫、桌面应用、API SDK等)
- 🧩 丰富度选择(最小/标准/完整,默认标准)
- 📜 LICENSE类型(MIT、Apache2.0、GPLv3等,默认MIT)
- 🐍 Python版本(默认3.8)
- 🔧 是否自动安装依赖(默认否)
- 🪞 是否添加国内镜像源(默认是)
- 🌐 是否自动初始化git仓库(默认否)
📝 参数详细说明
| 参数 | 说明 | 是否必填 | 默认值 |
|---|---|---|---|
| 语言 | 交互界面语言 | 否 | 中文 |
| 项目名 | 新项目的名称 | 是 | - |
| 项目路径 | 新项目的创建路径 | 否 | 当前目录 |
| 场景 | 选择项目类型 | 否 | 后端库 |
| 丰富度 | 模板内容丰富程度 | 否 | 标准 |
| LICENSE | 许可证类型 | 否 | MIT |
| Python版本 | 生成项目的Python版本 | 否 | 3.8 |
| 安装依赖 | 是否自动安装依赖 | 否 | 否 |
| 添加镜像源 | 是否添加国内镜像源 | 否 | 是 |
| 初始化git | 是否自动初始化git仓库 | 否 | 否 |
| 远程仓库地址 | Git远程仓库地址 | 否 | - |
🪞 镜像源说明
默认会在 pyproject.toml 中添加清华PyPI镜像源,加速依赖安装。
📝 pyproject.toml 关键配置
packages = [{{ include = "项目名", from = "src" }}]保证源码目录规范- 镜像源配置如下:
[[tool.poetry.source]]
name = "tuna"
priority = "primary"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
[[tool.poetry.source]]
name = "pypi"
priority = "supplemental"
🪵 日志工具
项目内可直接使用如下日志工具:
from 项目名.utils.tools import get_logger
logger = get_logger()
logger.info("日志内容")
🧑💻 贡献指南
欢迎提交PR和建议!请先fork本仓库,提交前请确保通过所有测试。
📬 联系方式
📝 本项目由 pytmpl 自动生成,助你高效开启Python开发之旅!
Metadata
Release files for pytmpl 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytmpl-0.0.1.tar.gz | 8.5 kB | Without provenance | Details for pytmpl-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytmpl-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytmpl-0.0.1-py3-none-any.whl |
Total release size: 20.7 kB
Release files / pytmpl-0.0.1.tar.gz
| Download URL | pytmpl-0.0.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85eb4cbcffaa0d94c25e76154b3dbcd5397636e8170da4b6f2fb03302a13fbc6
|
|
BLAKE2b-256 checksum How to use checksums |
8296d451bde83609c114b7feabab8bd676dcdb3d38b35316d1ed71d4619a901b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Windows/11
|
Release files / pytmpl-0.0.1-py3-none-any.whl
| Download URL | pytmpl-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25a32d306d997aa8bb8c259ea0ba86c4bc684f8950e240cfc94fe40229a62792
|
|
BLAKE2b-256 checksum How to use checksums |
c0f06b5863eb4dd2213b6ebab0e5a862cccd45aa0d17b9b47e2a23a459818957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Windows/11
|
Security for pytmpl 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.