Skip to content

πŸ’» Poetryize: A Typer-based CLI tool that converts requirements.txt to pyproject.toml, streamlining Python dependency management with Poetry. Enhances project maintainability through modern tooling integration.

License

Notifications You must be signed in to change notification settings

thoth2357/Poetryize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tests Coverage Status pre-commit Checked with mypy PyPI - Python Version

Poetryize

Poetryize is a command-line tool built with Typer that facilitates the conversion of requirements.txt files into pyproject.toml files. This allows seamless integration with Poetry, a dependency manager for Python projects. If you've ever found yourself wanting to use Poetry for dependency management but stuck with a project that uses requirements.txt, Poetryize is here to help.

Features

  • Seamless Conversion: Poetryize effortlessly transforms requirements.txt files into pyproject.toml files compatible with Poetry.
  • Dependency Initialization: Poetryize automatically initializes Poetry if a pyproject.toml file is not found in the project, streamlining the conversion process.
  • Error Handling: Poetryize includes error-handling mechanisms to address issues with the specified requirements file, providing informative messages to guide users.
  • Versatile Support: Poetryize supports a range of requirements.txt formats, including:
    • package==version
    • package>=version
    • package<=version
    • package~=version
    • package

Installation

  pip install poetryize

Example/Usage

1. Using Poetryize on project folder with requirements.txt file

β”œβ”€β”€ create_db.py
β”œβ”€β”€ database.py
β”œβ”€β”€ main.py
β”œβ”€β”€ models.py
β”œβ”€β”€ __pycache__
β”‚Β Β  β”œβ”€β”€ database.cpython-310.pyc
β”‚Β Β  β”œβ”€β”€ main.cpython-310.pyc
β”‚Β Β  └── models.cpython-310.pyc
β”œβ”€β”€ requirements.txt
└── test_main.http
  • Run poetryize on the project folder, while in the same directory as the requirements.txt file
  poetryize

Note: Using Poetryize without any requirement.txt path argument would automatically use the requirements.txt file in the project folder.

2. Using Poetryize on a project with a requirements.txt file in a different folder

  poetryize /path/to/requirements.txt

Demo

poetryize-demo.mp4

License

This project is licensed under the MIT License.

About

πŸ’» Poetryize: A Typer-based CLI tool that converts requirements.txt to pyproject.toml, streamlining Python dependency management with Poetry. Enhances project maintainability through modern tooling integration.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages