convert-poetry2uv
The convert_poetry2uv.py script is meant to easily convert the pyproject.toml to be consumed by uv instead of poetry.
Poetry v2 came out after this tool. The tool has been modified to work with poetry v2 format as well. Please create an issue/PR if you find any issues.
It has a dry-run flag, to have a temporary file to validate the output. When not running the dry-run the original file is saved with a .org extension.
uv run convert_poetry2uv.py <path to file> [-n]
You may need to make some manual changes. The layout might not be exactly to your liking. I would recommend using Even better toml in VSCode. Just open the newly generated toml file and save. It will format the file according to the toml specification.
Caveats
- If you were using the poetry build-system, it is removed in the generated pyproject.toml.
- if you had optional dev groups, the dev group libraries will be used, the optional flag is removed
Using as a tool
The script can be run as a tool using uvx
uvx convert-poetry2uv --help
uv instructions
Once the pyproject.toml is converted, you can use uv to manage your project. To start fresh, the .venv directory is removed followed by the creation and sync of the .venv directory.
rm -rf .venv
uv venv # or 'uv venv -p 3.12' to specify a python version
uv sync
With this you are good to go and are able to validate the migration was a success.
Pypi
The script is also available on pypi as convert-poetry2uv
pip install convert-poetry2uv
Contribute
Though I've tried to make it as complete as possible, it is not guaranteed to work for all cases. Feel free to contribute to the code or create an issue with the toml file that is not converted correctly.
Versions/Releases
The version is automatically updated with python-semantic-release. Take note of the pyproject.toml to see which keywords can be added to the commit message to ensure the correct version is released. The release is created when merged to main.
Trusted Publisher
Note to self: When a new github workflow is required, don't forget to add the new workflow to the trusted publisher list.
Links
Metadata
Release files for convert-poetry2uv 0.3.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| convert_poetry2uv-0.3.14.tar.gz | 10.0 kB | With provenance | Details for convert_poetry2uv-0.3.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| convert_poetry2uv-0.3.14-py3-none-any.whl | Python 3 | none | any | Details for convert_poetry2uv-0.3.14-py3-none-any.whl |
Total release size: 16.6 kB
Release files / convert_poetry2uv-0.3.14.tar.gz
| Download URL | convert_poetry2uv-0.3.14.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efc2a8d2e74b20c76350f5653fbdcb937ce0a0d3dfea0cfdd2448b1342df4f28
|
|
BLAKE2b-256 checksum How to use checksums |
e4d6e2c6f039232276747aef5ddc71ea3ebdfafbeadb4a00d697827db99c893f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 16, 2026.
Transparency logRelease files / convert_poetry2uv-0.3.14-py3-none-any.whl
| Download URL | convert_poetry2uv-0.3.14-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20e0960a5f3104d9f455185d543082c944211f0b532e5a1ea848cb8a68bac254
|
|
BLAKE2b-256 checksum How to use checksums |
7a32240615689ea14a7ecfadcc2fbd25bc3dfee8b906f67d872be581191ec6f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 16, 2026.
Transparency logSecurity for convert-poetry2uv 0.3.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for convert_poetry2uv-0.3.14.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.