Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PyShrink: Python Projects, Minus the JunkNew to Visual Studio Code? Get it now.
PyShrink: Python Projects, Minus the Junk

PyShrink: Python Projects, Minus the Junk

Nitin Kumar 30

|
1 install
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PyShrink – Python Projects, Minus the Junk

🚀 PyShrink is a Visual Studio Code extension that helps you clean, shrink, and prepare Python projects for sharing directly from your workspace.

It runs a Python-based cleanup CLI to remove unnecessary files and folders from a cloned copy of your project—keeping the original code completely safe.
PyShrink is ideal for enterprise, internal, and restricted Git environments where teams frequently share code as ZIPs instead of repositories.


Working Demo

PyShrink VS Code extension


Why PyShrink?

  • Reduce project size before sharing
  • Avoid manual cleanup and repeated zipping
  • Keep original projects untouched
  • Works without Git or external services
  • Designed for corporate and internal workflows

Features

  • 🧹 Clean Python projects directly from VS Code
  • 🧪 Interactive cleanup mode
  • ⚙️ Run cleanup with custom CLI arguments
  • 📁 Automatically detects the active workspace folder
  • 🔒 Works on a cloned copy (original project is never modified)
  • 🖥️ Real-time output via VS Code notifications

Commands (Aligned with package.json)

The following commands are contributed by this extension:

PyShrink: Help

Command ID: pyshrink.help

Displays all the available commands under pyshrink with their usage & example

Executed as:

pyshrink --help

PyShrink: Run with Arguments

Command ID: pyshrink.withArgs

Prompts the user to enter CLI arguments and passes them directly to the PyShrink CLI.

Example input:

--path --req --readme

Executed as:

pyshrink --path PATHNAME --req --readme

PyShrink: Run with optional arguments

Command ID: pyshrink.interactive

Runs PyShrink in interactive mode using default behavior.

Example input:

--path PATHNAME

Executed as:

pyshrink --path PATHNAME

PyShrink: Run without any Arguments

Command ID: pyshrink.fullCleanup

No input, just creates all necessary files & cleans up directory

Example input:

pyshrink

Executed as:

pyshrink --path PATHNAME

Quick Setup (1 Minute)

  1. Install Python 3

    • Ensure Python 3.x is installed and accessible via python
  2. Open your project folder in VS Code

    • Use File → Open Folder
    • Do not open individual files
  3. Open Comamnd Pallete

    • Shortcut: Press CTRL+SHIFT+P
  4. Run PyShrink

    • Type PyShrink
    • Select the necessary command you need

Requirements

To use PyShrink, the following prerequisites must be met:

  • Python 3.x installed on the system

    python --version
    
  • python available in system PATH

    • The extension spawns Python using the python command
  • A workspace folder opened in VS Code

    • The extension does not work with single files

⚠️ The extension does not install Python dependencies automatically. You need to manually tell.


OS-Specific Notes

🪟 Windows

  • Install Python with “Add Python to PATH” enabled

  • Restart VS Code after installation

  • Verify:

    where python
    

🍎 macOS

  • Install Python via official installer or Homebrew

  • Ensure python points to Python 3:

    python --version
    

🐧 Linux

  • Install Python via package manager:

    sudo apt install python3
    
  • Ensure python resolves correctly


Expected Project Structure

your-project/
├── main.py
├── config.py
├── src/
├── tests/
├── requirements.txt
└── README.md

Extension Settings

This extension does not add VS Code settings via contributes.configuration.

All behavior is controlled through:

  • CLI arguments
  • config.py inside the project

Common Setup Mistakes

❌ No workspace folder found

  • Open the project folder, not a file

❌ Python not found

  • Python not in PATH
  • Restart VS Code after installing Python

❌ main.py missing

  • Ensure the file exists at the workspace root

❌ No visible output

  • Check Help → Toggle Developer Tools for logs

Known Issues

  • Assumes python command (not python3)
  • Long output may be truncated in notifications
  • No progress bar UI
  • CLI arguments are not validated

Release Notes

1.0.0

  • Initial release
  • Interactive cleanup command
  • Argument-based execution
  • Python subprocess integration
  • Workspace auto-detection

Keywords

python, cleanup, project-cleaner, shrink, zip, enterprise, internal-tools, automation, vscode-extension, python-tools


Enjoy using PyShrink 🚀

Author

Nitin Kumar

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft