Skip to main content

pkgu

Find the out-dated packages installed by the Pip tool and update them. Inspired by 👉depu(Go). However, pkgu supports full and partial updates, which is more convenient and flexible. It also supports cross-platform(Windows, linux, macos). 🤓 To retrieve the data more fast after the first-time(Or don't have to execute command again), I use sqlite as cache db to store the data and can quickly read it from db and present it to the console💻.

👉 However, only python3.10 and above are available now.

Usage

  • Run code from source code

First, you need to install dependencies.

if you don't have poetry tool, please install it first. 🔗: poetry installation, otherwise, install packages directly.

poetry install

and then, run pkgu.py script.

python3 pkgu.py
  • Use it through pip - Highly Recommended
pip3 install pkgu

after the installation is complete, pkgu executable file will be written to the python bin directory and you can enter pkgu -h command on your terminal to learn how to use it.

# Usage
usage: pkgu [-h] [-v] {update,remove} ...

Upgrade and uninstall python package.

options:
  -h, --help       show this help message and exit
  -v, --version    Display pkgu version and information

Available commands:
  {update,remove}  Available commands
    update         Update python package.
    remove         remove python package with its dependencies.

# ------ update ------
options:
  -h, --help            show this help message and exit
  -a, --async_upgrade   Update the library asynchronously. Default: False
  -d CACHE_FOLDER, --cache_folder CACHE_FOLDER
                        The cache.db file. Default: ~/.cache/cache.db
  -e EXPIRE_TIME, --expire_time EXPIRE_TIME
                        The expiration time. Default: 43200
  --no-cache            Whether to use db cache. Default: False

# ------ remove ------
options:
  -h, --help    show this help message and exit
  -l, --list    list unused dependencies, but don't uninstall them.
  -L, --leaves  list leaves (packages which are not used by any others).
  -y, --yes     don't ask for confirmation of uninstall deletions.
  -f, --freeze  list leaves (packages which are not used by any others) in requirements.txt format

ScreenShoot

  1. No packages need to be upgraded.

img.png

  1. Upgrade some expired packages.

img_4.png img_2.png img_3.png

  1. Update the pkg synchronously

img_1.png

  1. Update the pkg asynchronously

img_5.png

We can see that the async method is faster than sync method about 9 seconds(Only in this test situation). So now it can support to update the python libraries asynchronously. 🥳

  1. Support for selectable update packages
  • List all availbable packages

img_6.png

  • Select ths part of package to be updated

img_7.png

  1. Support to use cache result from sqlite db file.

This improve the expirence that how we list the out-dated packages when they are huge to collect, and then there also is a cli flag --no-cache to control whether should to use cache.

  1. !!!New - Support to uninstall package with its dependencies together.

img_8.png

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pkgu-0.0.27-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file pkgu-0.0.27-py3-none-any.whl.

File metadata

  • Download URL: pkgu-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for pkgu-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 6122098a2e3a934ab1f3971d63c738eb3965d1a1771b447658517efb1eb1e1e4
MD5 48f84b9ddd4e14466f13fddcc16630a0
BLAKE2b-256 17b53e5554f3355e3e0fa8c26a645a701438b9e6e8b306625a05f5bab6e04f72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page