# python

These scripts are all for working with Python.

## The individual scripts

<!-- [[[cog

# This adds the root of the repo to the PATH, which has cog_helpers.py
from os.path import abspath, dirname
import sys

sys.path.append(abspath(dirname(dirname("."))))

import cog_helpers

folder_name = "python"

scripts = [
    {
        "usage": "depanalysis",
        "description": """
        get a summary of every Python version installed in every Python virtualenv on my computer.
        """,
    },
    {
        "usage": "deploy_to_pypi",
        "description": """
        deploy a new version of a Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
        """,
    },
    {
        "usage": "get_all_venv_deps",
        "description": """
        print all the dependencies installed in every virtualenv on my computer. See https://alexwlchan.net/2026/python-package-audit/
        """,
    },
    {
        "name": "pyfmt [...PATH]",
        "description": "Format Python files with ruff.",
    },
    {
        "name": "pip_compile (--upgrade) (--no-cache)",
        "description": "Compile any `requirements.in` files into a list of exact versions in `requirements.txt`.",
    },
    {
        "name": "run_pip_sync (--no-cache)",
        "description": "A wrapper around `uv pip sync`. You don't need to call this directly.",
    },
]

cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)

]]]-->
<dl>
  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/depanalysis">
      <code>depanalysis</code>
    </a>
  </dt>
  <dd>
    get a summary of every Python version installed in every Python virtualenv on my computer.
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/deploy_to_pypi">
      <code>deploy_to_pypi</code>
    </a>
  </dt>
  <dd>
    deploy a new version of a Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/get_all_venv_deps">
      <code>get_all_venv_deps</code>
    </a>
  </dt>
  <dd>
    print all the dependencies installed in every virtualenv on my computer. See https://alexwlchan.net/2026/python-package-audit/
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/pyfmt">
      <code>pyfmt [...PATH]</code>
    </a>
  </dt>
  <dd>
    Format Python files with ruff.
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/pip_compile">
      <code>pip_compile (--upgrade) (--no-cache)</code>
    </a>
  </dt>
  <dd>
    Compile any `requirements.in` files into a list of exact versions in `requirements.txt`.
  </dd>

  <dt>
    <a href="https://github.com/alexwlchan/scripts/blob/main/python/run_pip_sync">
      <code>run_pip_sync (--no-cache)</code>
    </a>
  </dt>
  <dd>
    A wrapper around `uv pip sync`. You don't need to call this directly.
  </dd>
</dl>
<!-- [[[end]]] (sum: WIjqpb60M8) -->
