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.
 
 
 
 
 

502 B

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