pyptmpl.creator_core package¶
Submodules¶
pyptmpl.creator_core.ci_ops module¶
Pre-commit and CI automation setup operations.
pyptmpl.creator_core.license_ops module¶
License matching, pyproject patching, and interactive license selection.
- match_pypi_classifier(spdx_key: str, classifiers: list[str]) str[source]¶
Return the best-matching PyPI License :: classifier for an SPDX key.
pyptmpl.creator_core.project_ops module¶
Project scaffolding operations grouped by concern.
- class GitAuthor(name: str, email: str)[source]¶
Bases:
NamedTupleGit author information.
- email: str¶
Alias for field number 1
- name: str¶
Alias for field number 0
- create_smoke_test(project_dir: Path, package_name: str, load_template: Callable[[str], str], render_template: Callable[[...], str]) None[source]¶
Create a minimal importable smoke test.
- create_venv(project_dir: Path, python_version: str, run_fn: Callable[[list[str], Path | None], None]) None[source]¶
Create a virtual environment inside the project directory.
- infer_package_name_from_pyproject(project_dir: Path, *, strict: bool = False) str | None[source]¶
Infer import package name from project.name in pyproject.toml.
- infer_project_name_from_pyproject(project_dir: Path, *, strict: bool = False) str | None[source]¶
Infer project.name from pyproject.toml.
- infer_python_version_from_pyproject(project_dir: Path, default: str, *, strict: bool = False) str[source]¶
Infer major.minor Python version from pyproject.toml.
- init_project(project_name: str, python_version: str, cwd: Path, run_fn: Callable[[list[str], Path | None], None]) Path[source]¶
Run uv init –lib and return the created project directory.
- run_cmd(cmd: list[str], cwd: Path | None = None) None[source]¶
Run a command, raising SystemExit on non-zero exit.
- setup_docs_build_assets(project_dir: Path, package_name: str, load_template: Callable[[str], str], render_template: Callable[[...], str]) None[source]¶
Create docs and build scaffolding files.
- setup_gitignore(project_dir: Path, load_template: Callable[[str], str]) None[source]¶
Create or augment .gitignore with Python-standard entries.
- setup_justfiles(project_dir: Path, load_template: Callable[[str], str]) None[source]¶
Create a single root justfile.
- setup_typos(project_dir: Path, load_template: Callable[[str], str]) None[source]¶
Create typos.toml if it does not exist.
- setup_vscode(project_dir: Path, load_template: Callable[[str], str]) None[source]¶
Write VS Code workspace settings.
- setup_yamllint(project_dir: Path, load_template: Callable[[str], str]) None[source]¶
Create .yamllint if it does not exist.
- sync_project(project_dir: Path, run_fn: Callable[[list[str], Path | None], None]) None[source]¶
Sync project dependencies and materialize uv.lock.
- write_pyproject(project_dir: Path, project_name: str, package_name: str, python_version: str, description: str, author: GitAuthor, default_license_id: str, load_template: Callable[[str], str], render_template: Callable[[...], str], get_license_classifier: Callable[[str], str]) None[source]¶
Overwrite pyproject.toml with the canonical template.
pyptmpl.creator_core.templates module¶
Template loading and rendering utilities.
Module contents¶
Internal creator components split by concern.