{"categories":[{"label":"Build Tools","url":"https://skillfed.io/packages/category/software-development-build-tools/5"}],"enrichment":{"capability":"Automatically rebuilds Rust components in maturin projects during Python imports, eliminating the need to manually recompile when Rust code changes.","skillfed_tags":["rust-python-interop","development-workflow","import-hook"],"use_cases":["Developing a Python package with Rust extensions where you want Rust changes to take effect immediately on re-import without manual rebuilds.","Writing standalone .rs files as importable modules in a Python project to test or prototype Rust code without a full package structure.","Iterating on performance-critical Python functions by rewriting them in Rust and testing them in the same development loop.","Managing a monorepo with multiple editable-installed maturin packages that need to rebuild on demand during active development."],"what_it_does":"Maturin Import Hook is a Python import hook that intercepts imports of Rust projects built with maturin and automatically recompiles them if their source has changed. It bridges the development experience gap between Python and Rust by making Rust changes take effect on import, just like Python code does. The hook works in two modes: it can rebuild editable-installed maturin packages on import, or compile standalone .rs files into temporary projects in a build cache. This reduces friction when working on mixed Python/Rust codebases by eliminating manual rebuild steps.\n\nThe package integrates into Python's import system and can be activated either globally or per-script by calling maturin_import_hook.install(). It requires maturin to be installed separately and depends on filelock and tomli for its own operation. The hook also supports importlib.reload() for recompiling projects during development and includes a CLI for managing the build cache and installation state.","worth_installing":"Yes, if you are actively developing mixed Python/Rust code with maturin. The low install friction, permissive licensing, active maintenance, and zero known vulnerabilities make it a safe choice. The import hook genuinely reduces development friction by automating rebuilds. Not necessary if you are only consuming pre-built Rust extensions or not using maturin."},"id":"maturin-import-hook","links":{"html":"https://skillfed.io/packages/maturin-import-hook","md":"https://skillfed.io/packages/maturin-import-hook.md","pypi":"https://pypi.org/project/maturin-import-hook/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-06-08","license_spdx":null,"license_treatment":"permissive","name":"maturin-import-hook","python_support":"supports_current","summary":"Import hook to load rust projects built with maturin"},"popularity":{"monthly_downloads":99072,"position":13040,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.0"}
