Skip to content

Adding PyPortion to an Existing Project

If you have an existing Python project you want to manage with PyPortion, you don't need to start from scratch. The init command adds PyPortion to any existing project directory.

Initialize the Project

Navigate into your project directory and run:

portion init <project-name>

Example:

portion init my-existing-app

This creates a .pyportion.yml configuration file in the current directory. No existing files are modified.

Attach a Template

Once the project is initialized, attach one or more templates to it:

portion add <template-name>

Example:

portion add cli-template

The template is registered in .pyportion.yml. Its portions are now available to use in the project.

Build Portions

With a template attached, scaffold new code using its portions:

portion build <portion-name>

Example:

portion build command

Next Steps