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
- No packages need to be upgraded.
- Upgrade some expired packages.
- Update the pkg synchronously
- Update the pkg asynchronously
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. 🥳
- Support for selectable update packages
- List all availbable packages
- Select ths part of package to be updated
- 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.
- !!!New - Support to uninstall package with its dependencies together.
Metadata
Release files for pkgu 0.0.28
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pkgu-0.0.28-py3-none-any.whl | Python 3 | none | any | Details for pkgu-0.0.28-py3-none-any.whl |
Release files / pkgu-0.0.28-py3-none-any.whl
| Download URL | pkgu-0.0.28-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34655d80c59c12dcf738ceaed494c98d30c578dd09d73388f0901a17a755faa2
|
|
BLAKE2b-256 checksum How to use checksums |
49689b615c48da32bcd58112ee8abc15f931e20ff3fb22582c386661f2ee82ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for pkgu 0.0.28
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.