The universal package manager library
Project description
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']})
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
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pako-0.3.0.tar.gz
.
File metadata
- Download URL: pako-0.3.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eabd1c121d6701069d1a10132f197ee2b5f4e75a3d68a93b07f69214ab0ff9c7 |
|
MD5 | e9d7e1eb5c2063feba39a769a9800fdd |
|
BLAKE2b-256 | ad9c73f6281f5d12ed63e2ecca3931da4922b5f84a33721352e86e602bbd2e08 |
File details
Details for the file pako-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: pako-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6542d0f2e42958d38327af169648d0c48135fc972066683f3974fc1eee20fc1 |
|
MD5 | 65e3624253dfe46e2fb90c4fe73385a4 |
|
BLAKE2b-256 | 64b79a06c51798a29dd70808c51202bffd97d8b741d7061a499765020b0d7bd6 |