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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pyensure-0.0.3.tar.gz.

File metadata

  • Download URL: pyensure-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyensure-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4c053ccb6c08a124ff39d10b09fa825b2efcca4ddd962d79b727204ed4973357
MD5 8c3f678632ef1fe224e75538c77d507e
BLAKE2b-256 fedc1981c4e485b947d525d0f89b0e3e229252560e8c0821cb1b4e5a528dff32

See more details on using hashes here.

File details

Details for the file pyensure-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyensure-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyensure-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06242a81b3ac45245bff12e30bfee6765344b04bf83375d5ec52e74f6e1bef31
MD5 77dc04868c703a033de373fd6ed826cd
BLAKE2b-256 26833f693a28403d68aacb0c04c849deb2feb0547a4ddfda9f2d06838402f6f1

See more details on using hashes here.

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