Skip to main content

Update packages in a requirements.txt file to latest versions.

Project description

Tests Coverage Version Supported Python Versions


Update the packages in a requirements.txt file.

Purring Cat


pip install pur


Give pur your requirements.txt file and it updates all your packages to the latest versions.

For example, given a requirements.txt file:


Running pur on that file updates the packages to current latest versions:

$ pur -r requirements.txt
Updated flask: 0.9 -> 1.0.2
Updated sqlalchemy: 0.9.10 -> 1.2.8
Updated alembic: 0.8.4 -> 0.9.9
All requirements up-to-date.

Pur never modifies your environment or installed packages, it only modifies your requirements.txt file.

You can also use Pur directly from Python:

$ python
Python 3.6.1
>>> from pur import update_requirements
>>> print([x[0]['message'] for x in update_requirements(input_file='requirements.txt').values()])
['Updated flask: 0.9 -> 1.0.2', 'Updated sqlalchemy: 0.9.10 -> 1.2.8', 'Updated alembic: 0.8.4 -> 0.9.9']
>>> print(open('requirements.txt').read())


-r, --requirement PATH
 The requirements.txt file to update; Defaults to using requirements.txt from the current directory if it exist.
-o, --output PATH
 Output updated packages to this file; Defaults to overwriting the input requirements.txt file.
-i, --interactive
 Interactively prompts before updating each package.
-f, --force Force updating packages even when a package has no version specified in the input requirements.txt file.
-d, --dry-run Output changes to STDOUT instead of overwriting the requirements.txt file.
-n, --no-recursive
 Prevents updating nested requirements files.
-s, --skip TEXT
 Comma separated list of packages to skip updating.
--index-url TEXT
 Base URL of the Python Package Index. Can be provided multiple times for extra index urls.
--verify PATH Either a boolean true/false, in which case it controls whether we verify the server’s TLS certificate, or a string, in which case it must be a path to a CA certs bundle. Defaults to True.
--only TEXT Comma separated list of packages. Only these packages will be updated.
-m, --minor TEXT
 Comma separated list of packages to only update minor versions, never major. Use “*” to limit every package to minor version updates.
-p, --patch TEXT
 Comma separated list of packages to only update patch versions, never major or minor. Use “*” to limit every package to patch version updates.
--pre TEXT Comma separated list of packages to allow updating to pre-release versions. Use “*” to allow all packages to be updated to pre-release versions. By default packages are only updated to stable versions.
-z, --nonzero-exit-code
 Exit with status 10 when all packages up-to-date, 11 when some packages were updated. Defaults to exit status zero on success and non-zero on failure.
--version Show the version and exit.
--help Show this message and exit.


Before contributing a pull request, make sure tests pass:

virtualenv venv
. venv/bin/activate
pip install tox

Many thanks to all contributors!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pur, version 5.4.2
Filename, size File type Python version Upload date Hashes
Filename, size pur-5.4.2-py3-none-any.whl (1.8 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pur-5.4.2.tar.gz (1.0 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page