Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Automatic upgrade of PyPI packages

Project description

Quick Start

from autoupgrade import Package


from autoupgrade import Package

The above will upgrade the Python package pip only if there is a new version available on the PyPI. The upgrade will be unattended and the python script will be restarted.

Old methods are still supported; you can accomplish the same task calling:

from autoupgrade import AutoUpgrade


pip install autoupgrade-ng

All the modules will be installed under the autoupgrade package, so make sure you have already removed the old AutoUpgrade package ( before install this to avoid an installation conflict.



class Package(__builtin__.object)

Decription: Basic package class, holds one package.

class AutoUpgrade(__builtin__.object)

Decription: Legacy class refering to Package one.


__init__(self, pkg, index=None, verbose=False)

Decription: None.


  • pkg (str) name of package.

  • index (str) alternative index, if not given default from pip will be used.
    Include full index url _(e.g.
    Return: None.

Decription: Check if pkg has a later version.

Arguments: None.

Return: True if later version exists, else False.


Decription: Restart application with same args as it was started.

Arguments: None.

Return: None.

upgrade(self, dependencies=False, prerelease=False, force=False)

Decription: Upgrade the package unconditionaly.


  • dependencies update dependencies if True (see ``pip –no-deps``).

  • prerelease update to pre-release and development versions.

  • force reinstall all packages even if they are already up-to-date.

Return: None.

smartupgrade(self, restart=True, dependencies=False,

Decription: Upgrade the package if there is a later version available.


  • restart restart app if True.

  • dependencies update dependencies if True (see ``pip –no-deps``).

  • prerelease update to pre-release and development versions.

Return: None.

upgrade\_if\_needed(self, restart=True, dependencies=False,

Decription: Legacy method refering to smartupgrade one.

Arguments: Same as smartupgrade.

Return: Same as smartupgrade.

Release notes


  • Fork of autoupgrade (
  • Python 3 support.
  • Removed unnecessary dependencies.
  • Pre-release and force-reinstall support.
  • Massive code refactoring and cleaning.
  • Updated README and LICENSE.
  • New exception PIPError to handle pip errors.
  • Main class renamed to Package.
  • More verbose messages.
  • Small code optimizations and improvements.


  • Issue #2, Index did not work when specified.
  • Issue #3, Autoupgrade should not print to console (added verbose flag to keep backward compatibility.
  • Issue #4, Support for pip > v0.6 .


  • Issue #1, Extra index did not work for all servers.


  • Fixed bug when version contains characters.


  • Fixed vital fault in v0.1.2 .


  • Setup file fixes
  • Removed verbose output as default.
  • Return value fixed of method upgrade.


  • Dependencies updated.


  • Initial release.

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 autoupgrade-prima, version 0.6.3
Filename, size File type Python version Upload date Hashes
Filename, size autoupgrade_prima-0.6.3-py2.py3-none-any.whl (5.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size autoupgrade-prima-0.6.3.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page