upreq-logo(1)

Why? Because…

len(pip freeze > requirements.txt) > len(upreq)

GitHub file size in bytes DigitalOcean Referral Badge

Upreq

Upreq is a simple CLI tool that provides shortcuts and feedback for updating your Python project’s requirements.txt file. It’s written in Go and uses Cobra as the CLI framework. It started as a bash script, after I found myself typing pip freeze > etc one too many times and well, here we are.

Features

  • Comparing your requirements.txt file to your current environment
  • Reduces carpel tunnel by turning pip freeze > requirements.txt into upreq
  • Provides feedback on what packages were added/removed
  • Flag for automatically adding new requirements to git

Installation

Since Upreq is a binary executable, you can download the latest release from the releases page and copy it to your PATH. Below is an example of how to do this on linux.

Linux

curl -s https://api.github.com/repos/robswc/upreq/releases/latest | grep "browser_download_url.*upreq-linux" | cut -d : -f 2,3 | tr -d \" | wget -qi -
chmod +x upreq-linux
sudo mv upreq-linux /usr/local/bin/upreq

Usage

Usage is pretty simple. Just run upreq in your project’s root directory.

Note: Be sure to activate your virtual environment before running.

Running just upreq will run pip freeze and compare it to your current requirements.txt file. If there are any differences, it will print them out with a + or - to indicate if it was added or removed. Finally, it will write any new requirements to your requirements.txt file.

Basic Usage

upreq

Advanced Usage

upreq --git  # Automatically add new requirements to git

Help

upreq --help

GitHub

View Github