Skip to content
Py

Python Tooling

Environment setup, packaging, formatting, and runtime utilities.

12 commandspythonvenvpip

Command catalog

Environment setupPython Tooling

python -m venv

Create virtual environments for dependency isolation.

python -m venv .venv
Environment setupPython Tooling

source <env>/bin/activate

<env>\Scripts\activate

Activate venv environments on Unix-like systems and Windows.

source .venv/bin/activate
Environment setupPython Tooling

pip install

pip uninstall

Manage project dependencies inside the active environment.

pip install -r requirements.txt
Packaging and toolingPython Tooling

pip list

pip freeze

Review installed packages or capture dependency locks.

pip list --outdated
Packaging and toolingPython Tooling

python -m build

Create source and wheel distributions for packaging projects.

python -m build
Packaging and toolingPython Tooling

twine upload

Publish built packages to PyPI or private indices.

twine upload dist/*
Quality and formattingPython Tooling

ruff

flake8

Lint Python codebases for stylistic and logical issues.

ruff check .
Quality and formattingPython Tooling

black

isort

Format source files and sort imports consistently.

black .
Quality and formattingPython Tooling

pytest

Execute automated tests with fixtures and coverage.

pytest
Runtime utilitiesPython Tooling

python

Run scripts or launch interactive REPL sessions.

python <script>.py --flag value
Runtime utilitiesPython Tooling

python -m pdb

Start the built-in debugger for interactive tracing.

python -m pdb <script>.py
Runtime utilitiesPython Tooling

python -m cProfile

Profile Python applications to analyze performance bottlenecks.

python -m cProfile -o profile.out <script>.py