home blog portfolio Ian Fisher

Poetry cheatsheet

# create project in new directory
$ poetry new my-project-name

# initialize existing directory
$ poetry init

# add a package to your project
$ poetry add PKG

# add a package to your project for development
$ poetry add --dev PKG

# install a local editable version of your package
$ poetry install

# run a script
$ poetry run SCRIPT

# build the project
$ poetry build

# publish the project to PyPI
$ poetry publish

See also