Pako
The universal package manager library
Often, scripts need to install system dependencies using the native package manager of the user's
OS. Typically, this is solved by having some bash script that runs apt-get, assuming the user
is on Ubuntu. Smarter scripts use hand crafted code to detect the user's platform and aggregate
a set of dependencies on a few of the more popular platforms. Our approach is different:
pako install libgdbm-devel sdl2-dev
On Ubuntu, this command will run:
sudo apt-get install -y libgdbm-dev libsdl2-dev
However, on Solus, this will run:
sudo eopkg install -y gdbm-devel sdl2-devel
It works as follows:
- Parse package format (devel/debug/normal library or executable)
- Look up package managers that exist in PATH
- Format parsed package with common package convention of package manager
Installation
pip3 install pako
Usage
Command line:
pako (install|update) [package] [-t, --type format]
Python bindings:
from pako import PakoManager, PackageFormat
manager = PakoManager()
manager.update()
manager.install(['gdbm-dev', 'sdl2-dev'])
manager.install(['ssl-dev'], overrides={'eopkg': ['openssl-devel']})
Non-interactive mode
A no-confirm flag can be added to calls. This will be translated to the equivalent command line flag such as apt install -y.
from pako import PakoManager, PackageFormat
manager = PakoManager()
manager.install(['example-package'], flags=['no-confirm'])
Help Wanted
This tool can improve to fit a lot of use cases. Feel free to create an issue or pull request for new features and improvements. For instance, we need to figure out the best way to handle cases where a simple package format won't find the appropriate package.
Add Your Package Manager
Add your package manager by adding another data block to the dict object in
pako/package_manager_data.py.
Metadata
Release files for pako 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pako-0.3.1.tar.gz | 10.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pako-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.9 kB
Release files / pako-0.3.1.tar.gz
| Download URL | pako-0.3.1.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c033a073bb818ca336ae1fccba2655bd60dfe77744f85d4517abd3160d72231f
|
|
BLAKE2b-256 checksum How to use checksums |
0d270c491946572618f32c174101facca4dfb7034317e045c1e3950ed4fee689
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.3
|
Release files / pako-0.3.1-py3-none-any.whl
| Download URL | pako-0.3.1-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90aa6f4e697d12b904de6fbb11576465fb3d0d06936a0353673c633197d7349e
|
|
BLAKE2b-256 checksum How to use checksums |
b0f727f2f671e2ac66871776d12b7f79083e3206aee7341b0bcda12458287bcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.3
|
Security for pako 0.3.1
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.