mirror of
https://github.com/QianFuv/create-paper-py.git
synced 2026-04-13 12:11:08 +00:00
Scaffold a UV-powered Python research paper project in seconds
- TypeScript 88.5%
- Python 10.7%
- JavaScript 0.8%
| src | ||
| template | ||
| .gitignore | ||
| .prettierrc | ||
| eslint.config.mjs | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
create-paper-py
Scaffold a UV-powered Python research paper project in seconds — a create-vite-style CLI for academic/research work.
Prerequisites
- uv (the generated project is managed by
uv) - git (optional, used only when you enable
git init) - NVIDIA GPU + driver (optional, auto-detected for PyTorch CUDA configuration)
The CLI probes for these tools at startup and prints install hints if anything is missing.
Usage
npm create paper-py@latest my-paper
# or
npx create-paper-py my-paper
# or
pnpm create paper-py my-paper
What it generates
<project>/
├── scripts/
│ ├── __init__.py
│ └── s0_utilities/
│ └── dataset_loader.py # config-driven data loading
├── tests/
├── datas/
│ ├── assets/ # static assets (fonts, images)
│ │ └── TimesSun.ttf
│ ├── raw_data/ # original data + datasets.json config
│ │ └── datasets.json
│ ├── data/ # processed data
│ └── output/ # models, metrics, artifacts
├── docs/
├── backup/
├── .gitignore
├── CLAUDE.md
├── AGENTS.md
├── pyproject.toml # [project] + [tool.ruff] + [tool.mypy]
└── README.md
Interactive flow
- Project name (validated, normalized to PEP-503)
- Short description
- Python version (auto-detected from
uv python list) - Runtime packages (space-separated, optional)
- Dev tools (
ruff+mypy) - Extra dev packages (optional)
- PyTorch — auto-detects CUDA via
nvidia-smi; shows CUDA version selector when GPU is found, CPU-only otherwise uv sync— create.venvand install nowgit init
Non-interactive mode: create-paper-py my-paper --yes
Version detection
All version defaults are fetched at runtime:
| Item | Source |
|---|---|
| Python | uv python list --only-installed |
| PyTorch | PyPI JSON API |
| CUDA options | PyTorch wheel index + nvidia-smi |
Fallback values are used when network or tools are unavailable.
Local Development
npm install
npm run build # produces dist/index.js
npm run smoke # end-to-end smoke test
# Code quality
npm run lint # eslint
npm run format # prettier
npm run typecheck # tsc --noEmit
Run the CLI directly:
node dist/index.js my-test-project
Project layout (this repo)
create-paper-py/
├── src/
│ ├── index.tsx # CLI entry, orchestration
│ ├── prompts.tsx # interactive flow
│ ├── env-check.tsx # uv/git/CUDA detection + version fetching
│ ├── scaffold.tsx # template copy + placeholder substitution
│ ├── runners.tsx # uv / git subprocess wrappers
│ ├── render.tsx # gradient banner + spinner
│ ├── utils.tsx # shared helpers
│ ├── types.tsx # type definitions
│ └── smoke.tsx # end-to-end smoke test
├── template/ # project template (copied as-is, placeholders applied)
├── eslint.config.mjs
├── .prettierrc
├── tsconfig.json
├── tsup.config.ts
└── package.json