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
venvand upgradespipfor you. - Smart Dependency Management:
installanduninstallcommands automatically update both a high-levelproject.jsonand a completerequirements.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.jsonwithpinit run <script-name>. - Activated Shell: Jump into an activated virtual environment shell with the
pinit shellcommand.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinit_cli-0.1.3.tar.gz.
File metadata
- Download URL: pinit_cli-0.1.3.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb0ee68a569a2c18115b19c67f695b4746b6146d9e3cebf0bb1672af935fbab8
|
|
| MD5 |
5396840f37edeab26e0c3f5061babb70
|
|
| BLAKE2b-256 |
7aa6888dd58c47c079f1457f2a79131114f6a0cec90d0651fa08577229567dd2
|
File details
Details for the file pinit_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pinit_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bb3f0d116a01411317a23a3a96448f6e31fc2021758ff7f4ad3bfd0e41627cf
|
|
| MD5 |
258b786de2630350c6e5931d00e5d2b2
|
|
| BLAKE2b-256 |
8a7fc40dd87cbad9aadd2c447136fe1858c727a2134fc9a72430d076cead8709
|