ppmx Documentation

Welcome to the ppmx documentation, your efficient tool for managing Python virtual environments and packages.

Project Overview

ppmx is a command-line interface tool designed to simplify the management of Python projects. It enables easy creation of virtual environments, package installation, and environment maintenance.

API Reference

init module

Initialize the virtual environment and create project files.

init.init()

Initialize the virtual environment. Create the necessary project files including README.md, pyproject.toml, and src/main.py. Optionally initialize a Git repository. This function prompts the user for various project details such as project name, author, description, and license type. It also creates a virtual environment in the specified path and sets up a basic project structure.

run module

Run a task from the pyproject.toml file

run.run(command: str)

Run the task defined in the pyproject.toml file. :param command: The name of the command to run, as defined in the tasks section of pyproject.toml. :type command: str

Raises:
  • ValueError – If the command is not found in the tasks section of pyproject.toml.

  • subprocess.CalledProcessError – If the command fails to execute.

package module

Install packages in a virtual environment and update the lock file and pyproject.toml.

package.add(names: list[str], venv_path: str)

Install packages in the virtual environment and update the lock file and pyproject.toml. :param names: List of package names to install. :type names: list[str] :param venv_path: Path to the virtual environment. :type venv_path: str

Raises:
  • FileNotFoundError – If pip is not found in the virtual environment.

  • RuntimeError – If the pip install command fails.

  • Exception – For any other unexpected errors.

package.remove(names: list[str], venv_path: str)

Remove packages from the virtual environment and update the lock file and pyproject.toml.

package.install(venv_path: str)

Install all dependencies from the ppmx.lock file.

package.update(names: list[str], venv_path: str, all: bool = False)

Update packages in the virtual environment and update the lock file and pyproject.toml. :param names: List of package names to update. :type names: list[str] :param venv_path: Path to the virtual environment. :type venv_path: str

Raises:
  • FileNotFoundError – If pip is not found in the virtual environment.

  • RuntimeError – If the pip install command fails.

  • Exception – For any other unexpected errors.

main module

A command-line interface for managing a Python project with a virtual environment.