pyensure
An odd solution to auto-download missing imports.
This is more of a proof-of-concept than a good idea.
Installation
pip install pyensure
Usage
from pyensure import hook, ensure_package
pytest = ensure_package('pytest') # will install pytest via pip to a temp location of missing
# or if you want to do something a bit more scary
hook()
import requests # will install requests via pip to a temp location of missing
# Note that hook() will actually overwrite the base __import__() method to ensure the package exists
# or if you just want to run a .py script and not worry (as much) about depends
python -m pyensure <script> <args to script... >
License
MIT License - Charles Machalow
Metadata
Release files for pyensure 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyensure-0.0.3.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyensure-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / pyensure-0.0.3.tar.gz
| Download URL | pyensure-0.0.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c053ccb6c08a124ff39d10b09fa825b2efcca4ddd962d79b727204ed4973357
|
|
BLAKE2b-256 checksum How to use checksums |
fedc1981c4e485b947d525d0f89b0e3e229252560e8c0821cb1b4e5a528dff32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / pyensure-0.0.3-py3-none-any.whl
| Download URL | pyensure-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06242a81b3ac45245bff12e30bfee6765344b04bf83375d5ec52e74f6e1bef31
|
|
BLAKE2b-256 checksum How to use checksums |
26833f693a28403d68aacb0c04c849deb2feb0547a4ddfda9f2d06838402f6f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|