Import hooks in Python This repository contains an implementation of a custom importer (finder and loader) that imports code directly from an in-memory SQLite database. How to use python -i import_hook.py # Opens up an interactive shell with the code in import_hook executed References "Hooking into the import system" - Fred Phillips at PyCon US 2022 The import system - Python Language Reference