Skip to main content

A smart Python project initializer and dependency manager.

Project description

pinit: The Smart Python Project Initializer

pinit is a command-line tool that streamlines the process of starting and managing Python projects. It handles everything from creating a clean project structure and virtual environment to intelligently managing dependencies and running scripts.

It's designed to be a simple, all-in-one replacement for manually running venv, pip install, pip freeze, and managing requirements.txt.

Features

  • Interactive Setup: A wizard guides you through creating a new project.
  • Automatic Venv: Creates a venv and upgrades pip for you.
  • Smart Dependency Management: install and uninstall commands automatically update both a high-level project.json and a complete requirements.txt.
  • Intelligent Uninstall: Removing a package also removes its dependencies, unless they are required by another package in your project.
  • Script Runner: Run custom commands defined in your project.json with pinit run <script-name>.
  • Activated Shell: Jump into an activated virtual environment shell with the pinit shell command.

Installation

You can install pinit directly from PyPI:

pip install pinit-cli

Usage

1. Initialize a New Project

To start a new project, simply run pinit in the directory where you want to create it. The interactive wizard will handle the rest.

pinit

2. Manage Packages

pinit automatically detects and uses the local venv for all package operations.

# Add one or more new packages to the project
pinit install requests flask

# Uninstall a package and its orphaned dependencies
pinit uninstall flask

# Re-install all dependencies from project files
pinit install

3. Run Scripts

You can define custom script shortcuts in the scripts section of your project.json file.

// project.json
{
  ...
  "scripts": {
    "start": "python main.py",
    "test": "pytest"
  },
  ...
}

Run them from your terminal:

# Runs "python main.py" using the venv's interpreter
pinit run start

# Runs "pytest"
pinit run test

4. Use an Activated Shell

For interactive work or debugging, you can launch a new shell session with the virtual environment already activated.

pinit shell

Your terminal prompt will change, indicating you are inside the venv. Type exit to return to your normal shell.

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

pinit_cli-0.1.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

pinit_cli-0.1.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file pinit_cli-0.1.2.tar.gz.

File metadata

  • Download URL: pinit_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pinit_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c84f5093fb3d7d941effd793f10ba54f61cdc6ba44467ffc83bd66c425507d0
MD5 eee42abf066de71034cee687111af6b5
BLAKE2b-256 bd08848d46536e17ce18698104ef1c5e66c7ededb36303751366ae9bde26b840

See more details on using hashes here.

File details

Details for the file pinit_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pinit_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pinit_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f1b97b889facb741c007d119a7404da4de875d92801c08ab1c9ce01359e8845
MD5 05e385ed8cda9ed38b64125c50e2f510
BLAKE2b-256 3ba08fee14172faf3a8f4c25f3af89e11dd65b83a78f1e7380022f3fda8718ad

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