explaingit

python-poetry/poetry

📈 Trending34,274PythonAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

Poetry consolidates Python dependency management and packaging into a single pyproject.toml file and lock file, replacing fragmented tools like setup.py and requirements.txt.

Mindmap

mindmap
  root((Poetry))
    What it does
      Manages dependencies
      Builds packages
      Publishes to PyPI
      Locks versions
    Key files
      pyproject.toml
      poetry.lock
    Features
      Virtual environments
      Dependency groups
      Git repositories
    Use cases
      Open source libraries
      Production apps
      Team projects
    Problem solved
      Replaces setup.py
      Replaces requirements.txt
      Unified interface

Things people build with this

USE CASE 1

Set up a Python project with consistent dependencies across your team and production environments using a single lock file.

USE CASE 2

Build and publish a Python library to PyPI without learning separate packaging tools.

USE CASE 3

Organize development, testing, and documentation dependencies into separate groups within one configuration file.

USE CASE 4

Isolate project dependencies in virtual environments so different projects don't conflict with each other.

Tech stack

Pythonpyproject.tomlPyPI

Getting it running

Difficulty · easy Time to first run · 5min
Poetry is distributed under the MIT License, allowing free use for any purpose including commercial applications, provided the copyright notice is retained.

In plain English

Poetry is a tool for managing Python project dependencies and packaging. The problem it solves is that Python's historical tooling for these tasks, spread across setup.py, requirements.txt, setup.cfg, MANIFEST.in, and Pipfile, is fragmented, inconsistent, and difficult to work with reliably. Poetry consolidates all of that into a single pyproject.toml file (a standardized project configuration format) and a unified command-line interface. With Poetry you declare what your project needs in pyproject.toml: which Python version it requires, which libraries it depends on, and optional groups of dependencies used only for development, documentation, or testing. Poetry then resolves all of those dependencies, including their transitive dependencies (what your dependencies depend on), to a consistent set of versions that work together, and records the exact resolved versions in a lock file called poetry.lock. This lock file ensures that every developer on a team and every deployment environment installs exactly the same versions, eliminating the common problem where code works on one machine but not another due to version differences. Poetry also handles building and publishing Python packages to PyPI (the Python Package Index), the central repository where Python libraries are distributed. Commands like poetry build and poetry publish handle the packaging and upload steps that previously required separate tools. Additional useful features include virtual environment management (Poetry automatically creates isolated environments per project so dependencies don't conflict between projects), dependency groups for organizing dev and optional extras, and support for installing packages directly from Git repositories. You would use Poetry on any Python project where you want clean, reproducible dependency management and packaging. It is itself a Python tool, installable via a standalone installer script, and is widely used in both open-source libraries and production applications.

Copy-paste prompts

Prompt 1
How do I use Poetry to set up a new Python project and add dependencies?
Prompt 2
Show me how to create a poetry.lock file and ensure my team installs the exact same package versions.
Prompt 3
How do I build and publish a Python package to PyPI using Poetry?
Prompt 4
What's the difference between Poetry and pip/requirements.txt, and when should I use Poetry?
Prompt 5
How do I manage separate dependency groups for development, testing, and production in Poetry?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.