Poetry - Python dependency management and packaging made easy

Installation

curl -sSL <https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py> | python -

Commands

# Create a new project.
poetry new <path>

# Switch between environments.
poetry env use <python>

# Delete the environments.
poetry env remove <python>

# List the environments associated with the project.
poetry env list

# Add required packages to your pyproject.toml and installs them.
poetry add PACKAGE

# Add development packages to your pyproject.toml and installs them.
poetry add -D PACKAGE

# Remove a required package from the current list of installed packages.
poetry remove PACKAGE

# Remove a development package from the current list of installed packages.
poetry remove -D PACKAGE

# Get the latest versions of the dependencies and to update the poetry.lock file.
poetry update PACKAGE

# List all of the available packages.
poetry show --tree

# Read the pyproject.toml, resolves the dependencies, and installs them.
poetry install

# Activate the virtual environment.
poetry shell

# Run a command in the appropriate environment.
poetry run COMMAND

# Build the source and wheels archives.
poetry build

# Publish the package to the remote repository.
poetry publish

Examples

# DEV
poetry add -D black isort mypy pylint pytest

# Data Analysis
poetry add tompy

# DB
poetry add aiomysql databases

# WEB Server
poetry add fastapi uvicorn

# WEB Client
poetry add httpx

# LOG
poetry add loguru

# CLI
poetry add pydantic typer