lazyimport lets you import python modules lazily.
Project description
lazyimport
##########
|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|
``lazyimport`` lets you import python modules lazily.
.. code-block:: python
from lazyimport import lazyimport
lazyimport(globals(), """
from mypackage import submodule
import another_package
"""
)
.. contents::
.. section-numbering::
Installation
============
.. ``lazyimport`` is tested on Python 2.7, 3.4, 3.5 and 3.6.
Install ``lazyimport`` with:
.. code-block:: bash
pip install lazyimport
Use
===
The ``lazyimport`` function taks two parameters:
- ``scope`` - The scope into which the given imports are imported. A common use case is to provide this parameter with the global scope by assigning ``scope=globals()``.
- ``text`` - The string giving the import code to perform lazily. For example, ``"from pandas import DataFrame"``.
Example use:
.. code-block:: python
from lazyimport import lazyimport
lazyimport(globals(), """
from mypackage import submodule
import another_package
"""
)
Credits
=======
.. .. Written by Paul Ivanov - https://github.com/ivanov - for the nitime library - https://github.com/nipy/nitime.
Written by John Arbash Meinel, Martin von Gagern, Martin Packman and others
as part of the the GNU Bazaar revision control system.
As such, lazyimport is distributed under the GNU General Public License v3,
like GNU Bazzar itself.
Slightly adapted to package form by `Shay Palachy <http://www.shaypalachy.com>`_.
.. alternative:
.. https://badge.fury.io/py/yellowbrick.svg
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/lazyimport.svg
:target: https://pypi.org/project/lazyimport
.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/lazyimport.svg
:target: https://pypi.org/project/lazyimport
.. |Build-Status| image:: https://travis-ci.org/shaypal5/lazyimport.svg?branch=master
:target: https://travis-ci.org/shaypal5/lazyimport
.. |LICENCE| image:: https://img.shields.io/badge/License-GNU3-yellow.svg
:target: https://github.com/shaypal5/lazyimport/blob/master/LICENSE
.. .. |LICENCE| image:: https://github.com/shaypal5/lazyimport/blob/master/mit_license_badge.svg
:target: https://pypi.python.org/pypi/lazyimport
.. https://img.shields.io/pypi/l/lazyimport.svg
.. |Codecov| image:: https://codecov.io/github/shaypal5/lazyimport/coverage.svg?branch=master
:target: https://codecov.io/github/shaypal5/lazyimport?branch=master
##########
|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|
``lazyimport`` lets you import python modules lazily.
.. code-block:: python
from lazyimport import lazyimport
lazyimport(globals(), """
from mypackage import submodule
import another_package
"""
)
.. contents::
.. section-numbering::
Installation
============
.. ``lazyimport`` is tested on Python 2.7, 3.4, 3.5 and 3.6.
Install ``lazyimport`` with:
.. code-block:: bash
pip install lazyimport
Use
===
The ``lazyimport`` function taks two parameters:
- ``scope`` - The scope into which the given imports are imported. A common use case is to provide this parameter with the global scope by assigning ``scope=globals()``.
- ``text`` - The string giving the import code to perform lazily. For example, ``"from pandas import DataFrame"``.
Example use:
.. code-block:: python
from lazyimport import lazyimport
lazyimport(globals(), """
from mypackage import submodule
import another_package
"""
)
Credits
=======
.. .. Written by Paul Ivanov - https://github.com/ivanov - for the nitime library - https://github.com/nipy/nitime.
Written by John Arbash Meinel, Martin von Gagern, Martin Packman and others
as part of the the GNU Bazaar revision control system.
As such, lazyimport is distributed under the GNU General Public License v3,
like GNU Bazzar itself.
Slightly adapted to package form by `Shay Palachy <http://www.shaypalachy.com>`_.
.. alternative:
.. https://badge.fury.io/py/yellowbrick.svg
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/lazyimport.svg
:target: https://pypi.org/project/lazyimport
.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/lazyimport.svg
:target: https://pypi.org/project/lazyimport
.. |Build-Status| image:: https://travis-ci.org/shaypal5/lazyimport.svg?branch=master
:target: https://travis-ci.org/shaypal5/lazyimport
.. |LICENCE| image:: https://img.shields.io/badge/License-GNU3-yellow.svg
:target: https://github.com/shaypal5/lazyimport/blob/master/LICENSE
.. .. |LICENCE| image:: https://github.com/shaypal5/lazyimport/blob/master/mit_license_badge.svg
:target: https://pypi.python.org/pypi/lazyimport
.. https://img.shields.io/pypi/l/lazyimport.svg
.. |Codecov| image:: https://codecov.io/github/shaypal5/lazyimport/coverage.svg?branch=master
:target: https://codecov.io/github/shaypal5/lazyimport?branch=master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for lazyimport-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75bfbb939998a3e189c67a19255d9907858c4db4b60a539e96a680cca52fb303 |
|
MD5 | 72f2bdd40b396c7e277aac6c124f4bff |
|
BLAKE2b-256 | 426e37d12066172ceb827d27b5e29d31c56ff3005ba63cf005ab9765eedfcffd |