Python package for executing functions when packages are imported
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Brett Langdon 84ea22b7a9
initial prototype
7 years ago
docs initial prototype 7 years ago
importhook initial prototype 7 years ago
.gitignore initial prototype 7 years ago
CHANGELOG initial prototype 7 years ago
LICENSE initial prototype 7 years ago
MANIFEST.in initial prototype 7 years ago
Makefile initial prototype 7 years ago
README.rst initial prototype 7 years ago
setup.py initial prototype 7 years ago

README.rst

Importhook
=========

.. image:: https://badge.fury.io/py/importhook.svg
:target: https://badge.fury.io/py/importhook


Installation
~~~~~~~~~~~~

.. code:: bash

pip install importhook


Usage
~~~~~

.. code:: python

import importhook

# Setup hook to be called any time the `socket` module is imported and loaded into module cache
@importhook.on_import('socket')
def on_socket_import(socket):
print('"socket" module has been imported')

# Import module
import socket