Skip to main content

No project description provided

Project description

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

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

pyensure-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

pyensure-0.0.3-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

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