Creating a New Project
Once you have a template downloaded, scaffold a new project with the new command:
Parameters:
<template-name>— Name of the downloaded template to use<project-name>— Name for the new project directory
Example:
This creates a my-awesome-app/ directory pre-populated with the structure defined in cli-template.
If you have multiple versions of the template installed, PyPortion will prompt you to choose which version to use.
Adding More Templates
A project can use more than one template. To attach an additional template to a project you've already created:
Example:
This registers the template in your project's .pyportion.yml, making its portions available for use. If multiple versions are installed, you will be prompted to select which version to attach.
Remove a Template
To detach a template from your project:
This removes the template reference from .pyportion.yml. It does not delete any previously generated files.
View Project Info
Display the current project configuration and its attached templates:
Building Portions
A portion is a named, reusable code-generation recipe defined inside a template. Once a template is attached to your project, run any of its portions to scaffold new code:
Example — scaffold a new command using the cli-template:
PyPortion prompts you for any required inputs, shows a summary of the changes it will make, and asks for confirmation before applying them.
Use the -y flag to skip the confirmation prompt:
Next Steps
- Existing Project — Add PyPortion to a project you've already started
- Cloning a PyPortion Project — Work with a PyPortion project after cloning it from GitHub
- Template Creation — Build and publish your own custom templates