Skip to main content

A Python project manager.

Project description

ppm Package

ppm is a Python Project Manager CLI tool that simplifies project setup, dependency management, environment configuration, and running project commands. This tool is ideal for developers looking for a structured and efficient way to manage project dependencies, execute scripts, and configure environment variables directly from the command line. This is all in one cli tools for long pip commands.

Overview

The ppm tool provides a convenient set of commands for Python project management, enabling you to:

  • Initialize Projects: Set up a new project structure with a default or custom configuration.
  • Install and Uninstall Packages: Add or remove Python packages as needed for your project.
  • Manage Environment Variables: Easily configure environment variables for your project.
  • Run Project Scripts: Execute project-specific scripts or commands from a customizable list.

The ppm CLI is designed to streamline project management, reducing setup time and effort so that you can focus on coding.

Installation

To install ppm:

pip install ppm3

Usage

Use the ppm command followed by any of the subcommands listed below to manage various aspects of your project.

ppm <command> [options]

Important Notes

  1. Using ppm as a Dependency Manager: If you choose to use ppm as your dependency manager, be sure to specify a run script (e.g., a Python filename or any other command you wish to execute) in the configuration file. Without this, the run command will throw an error as it will not have a script to execute.

  2. Using ppm on an Existing Project: If you’re applying ppm to an existing project, specify ppm as the dependency manager when running ppm init. This setup will integrate ppm as the dependency manager for your project.


Commands

1. init

Initializes a new project configuration with an optional default setting.

Usage:

ppm init

Options:

  • -d: Enable default configuration.

Example:

ppm init -d

This command initializes the project using default configuration settings.

On installation, you'll see the following prompts:

Asking about how will you use ppm.

[?] How do you want to use ppm?:
   as a project manager
 > as a dependency manager

If you have choosen ppm as a project manager and not given the flag -d then you have to answer:

project name (system)
version (1.0.0)
description ()
entry point (main.py)
author ()
license (ISC)

You can initiate git at the begining of the project. You will be asked

[?] Do you want to add github configuration:
 > Yes
   No

github repository name () https://github.com/rahulcodepython/New_Repo.git

You can specify required packages at the time of initialize the project.

Enter the name of the packages you want to install in the project like (<package_name>==<version>) or (<package_name>).
Packages (press Enter to end): <package1> <package2> ...

Example:

Enter the name of the packages you want to install in the project like (<package_name>==<version>) or (<package_name>).
Packages (press Enter to end): requests flask

This is for generating .env file.

[?] Are you sure you want to add .env file?:
   Yes
 > No

But if you have already .env file in your project, then you will encounter

[?] .env file already exists.:
   Overwrite
 > Keep as it is

.env file is untouched.

PPM will create a src folder in your root directory and inside it, it will generate a main.py file. If you have already this folder structure, you will be asked:

[?] Do you want to override main.py file?:
 > Yes
   No

2. install

Installs specified packages in the project.

Usage:

ppm install <package1> <package2> ...

Example:

ppm install requests flask

This command installs the requests and flask packages in your project.

3. uninstall

Uninstalls specified packages from the project, with an option to include dependencies.

Usage:

ppm uninstall <package1> <package2> ...

Options:

  • -d: Uninstall packages along with their dependencies.

Example:

ppm uninstall requests -d

This command uninstalls the requests package and any dependencies.

4. run

Runs the project’s default or specified command.

Usage:

ppm run [command_name]
  • If you specify a command name (e.g., ppm run hello), it will execute the corresponding command defined in the configuration file.
  • If no command name is provided (i.e., ppm run), the default command will run.

Examples:

  1. Setting Up Custom Commands:

    Suppose you define a command in your configuration file:

    hello = "python hello.py"
    

    You can run this command with:

    ppm run hello
    
  2. Running the Default Command:

    If you want to run the default command specified in your configuration file, simply use:

    ppm run
    

5. add_env

Adds key-value pairs to the project’s .env file.

Usage:

ppm add_env <KEY=VALUE> <KEY2=VALUE2> ...

Example:

ppm add_env DATABASE_URL=mysql://user:password@localhost/dbname SECRET_KEY=your_secret_key

This command adds the specified environment variables to the .env file.

6. list

List all packages in terminal.

Usage:

ppm list

7. freeze

Generate requirements.txt file for your project packages.

Usage:

ppm freeze

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppm3-0.0.9.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppm3-0.0.9-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file ppm3-0.0.9.tar.gz.

File metadata

  • Download URL: ppm3-0.0.9.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.1

File hashes

Hashes for ppm3-0.0.9.tar.gz
Algorithm Hash digest
SHA256 183d8f6004256be1c28f81507d304cc4fdd12fe1aaec82b444ebcfd6470262c3
MD5 ba7fb8eff6b167738586b450ed952918
BLAKE2b-256 4189a592c7623d2b50a0ed0eb04e833391e3fb8eaa11fbe3e144893e1aa26fe4

See more details on using hashes here.

File details

Details for the file ppm3-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: ppm3-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.1

File hashes

Hashes for ppm3-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 aa560f6fae89eccbedfe5dd809a691660f25832ef56439f05f7ebf89196047d1
MD5 52659b0e13a0d7e01376911318175063
BLAKE2b-256 6425b17d6249291be6c9fd85567b2470c24ee1ec976d7d63b93c53307d3a92a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page