Skip to main content

Projects Tools - 项目创建工具

一个用于快速创建Python前后端项目的命令行工具,支持创建Python后端项目和Vue/React前端项目。

安装

pip install projects-tools

使用

创建新项目

projects-tools create <project_name> [options]

选项

  • --backend: 创建Python后端项目
  • --frontend: 创建前端项目
  • --frontend_type: 前端类型,可选 vue 或 reactjs(默认:reactjs)
  • --enable_proxy: 启用前端代理服务器

示例

  1. 创建包含Python后端和React前端的项目:
projects-tools create my-project --backend --frontend
  1. 创建仅包含Vue前端的项目:
projects-tools create vue-project --frontend --frontend_type=vue
  1. 创建包含Python后端、Vue前端并启用代理的项目:
projects-tools create full-project --backend --frontend --frontend_type=vue --enable_proxy

项目结构

创建的项目将包含以下文件和目录:

project_name/
├── src/
│   └── project_name/  # Python包
│       ├── __init__.py
│       ├── version.py
│       └── proxy.py   # 如果启用了代理
├── frontend/          # 前端项目(如果创建了前端)
├── setup.py           # Python项目配置
├── Makefile           # 构建脚本
├── deploy.sh          # 部署脚本
├── README.md          # 项目说明
└── .gitignore         # Git忽略文件

启动前端项目

cd frontend
npm run dev

启动后端项目

make build_static
pip install -e .
<project_name>.serve

功能特性

  • 自动创建Python项目结构
  • 支持Vue和React前端项目创建
  • 自动生成setup.py配置文件
  • 自动生成Makefile用于构建
  • 自动生成部署脚本
  • 可选的前端代理服务器支持
  • 丰富的命令行提示和进度显示

依赖管理

  • Python后端项目使用setuptools进行依赖管理
  • 前端项目使用npm/yarn进行依赖管理

构建与发布

项目创建后,可以使用以下命令进行构建和发布:

  1. 发布项目:
make release

注意事项

  • 确保系统中已安装Node.js和npm/yarn
  • 创建前端项目时可能需要较长时间
  • 使用代理功能时,请确保端口未被占用

开发

要贡献或修改本项目,请克隆仓库并安装开发依赖:

git clone https://github.com/yourusername/projects-tools.git
cd projects-tools
pip install -e .

许可证

MIT License

Metadata

Release files for projects-tools 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for projects-tools 0.0.4
File Size Uploaded Provenance Actions
projects_tools-0.0.4.tar.gz 13.0 kB Without provenance Details for projects_tools-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for projects-tools 0.0.4
File Interpreter ABI Platform Actions
projects_tools-0.0.4-py3-none-any.whl Python 3 none any Details for projects_tools-0.0.4-py3-none-any.whl

Total release size: 28.8 kB

Release files / projects_tools-0.0.4.tar.gz

Download URL projects_tools-0.0.4.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c77f6644f1c32a41d6eca6a6297ecc15f521833004514d05b14139ae0f06db74
BLAKE2b-256 checksum
How to use checksums
953c951fdd2783b75b8f639e9b06adc2138345ccb6b38f2ea6f9c33f7ae11b6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Release files / projects_tools-0.0.4-py3-none-any.whl

Download URL projects_tools-0.0.4-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2594b761112b22dac546b3b8cd79a3cdca62dd444693acc3819c62c6c7459a42
BLAKE2b-256 checksum
How to use checksums
ded404a7035c3779f01a1bc90a2efe65f1f4380f66cf1315690314deef7059b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Security for projects-tools 0.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page