PDM: A Modern Python Package Manager With PEP 621 Support and a pnpm-Inspired Cache
You've probably used Pipenv or Poetry for Python dependency management, and they work fine for most things. But if you've ever wished for a tool that handles large binary distributions faster, follows the latest PEP standards natively, or gives you a centralized installation cache like pnpm does for JavaScript, you might be looking for something else. PDM is a next-generation Python package and dependency manager that was originally built for personal use, and it brings a few genuinely useful ideas to the table.
What It Does
PDM is a Python package manager that handles dependencies, virtual environments, and project packaging. It supports PEP 517 (the build system standard) and PEP 621 (project metadata in pyproject.toml), meaning it plays nicely with modern Python packaging conventions. The tool includes its own build backend, so you can build wheels and source distributions without pulling in setuptools or flit.
Under the hood, PDM uses a simple and fast dependency resolver that's designed to handle large binary distributions efficiently. It also has a flexible plugin system, support for user-defined scripts, and can install Python runtimes using astral-sh's python-build-standalone project. One of its more distinctive features is an opt-in centralized installation cache modeled after pnpm's approach, which saves disk space and speeds up repeated installs by hard-linking packages from a single shared store.
Why It's Cool
PDM doesn't try to reinvent the wheel, but it makes some smart choices that set it apart from the existing tools.
-
PEP 621 support out of the box. Poetry uses its own format in pyproject.toml. PDM uses the standard PEP 621 metadata format directly, which means your project metadata is more portable and tool-agnostic. If you care about standards compliance, this is a nice win.
-
A pnpm-like cache. This is the feature that caught my attention. PDM can optionally store installed packages in a central cache and hard-link them into your project directories. If you work on multiple Python projects that share dependencies, this saves significant disk space and makes
pdm installnoticeably faster after the first run. It's a clever borrowing from the Node.js ecosystem. -
Simple and fast resolver. The README specifically calls out performance with large binary distributions. If you've ever waited for Poetry or Pipenv to resolve a dependency tree with numpy or pandas in it, you'll appreciate what PDM is aiming for here.
-
Python installation management. PDM can install Python interpreters via python-build-standalone, which is useful if you need to test against multiple Python versions without managing them manually through pyenv or asdf.
-
A proper plugin system. Unlike some tools that lock you into a specific workflow, PDM lets you extend its behavior with plugins. That's a good sign for long-term flexibility.
The comparison section in the README is worth reading. The author acknowledges that Pipenv and Poetry work fine for many people, and PDM isn't trying to replace them for everyone. It's refreshingly honest about its niche.
How to Try It
Installing PDM is straightforward. You can grab it from PyPI:
pip install pdm
Or if you prefer pipx (recommended for isolation):
pipx install pdm
Once installed, you can initialize a new project:
pdm init
This will walk you through setting up your pyproject.toml with PEP 621 metadata. Then you can add dependencies:
pdm add requests
To enable the centralized cache (the pnpm-like feature), you'll need to opt in by setting the PDM_USE_CENTRAL_CACHE environment variable or configuring it in your PDM settings.
For more detailed usage, check the official documentation at pdm-project.org or the repository itself at github.com/pdm-project/pdm.
Final Thoughts
PDM is a solid option if you're building Python libraries or applications and want a tool that respects PEP standards without forcing you into a proprietary metadata format. The pnpm-inspired cache is a genuine quality-of-life improvement for anyone maintaining multiple projects, and the plugin system gives you room to grow. It's not trying to be everything to everyone, but for developers who value standards compliance, fast resolution, and disk efficiency, PDM is worth a serious look. If you're happy with Poetry or Pipenv, stick with them. If you're missing something, PDM might have it.
Follow @githubprojects for more developer tools and open source projects.