Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hartwork/import-watch
Trace module imports and detect/deny cyclic imports at runtime
https://github.com/hartwork/import-watch
development library python
Last synced: 26 days ago
JSON representation
Trace module imports and detect/deny cyclic imports at runtime
- Host: GitHub
- URL: https://github.com/hartwork/import-watch
- Owner: hartwork
- Created: 2019-04-20T22:22:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-09T17:51:10.000Z (almost 3 years ago)
- Last Synced: 2024-12-29T22:36:48.132Z (about 1 month ago)
- Topics: development, library, python
- Language: Python
- Homepage: https://pypi.org/project/import-watch/
- Size: 10.7 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome!
**import-watch** allows to
trace module imports
and
detect/deny cyclic imports
*at runtime*
with Python 2 and 3.
It is licensed under the MIT license.Enjoy!
# Installation
```console
# pip install import-watch
```# Usage
## Trace imports
```python
import import_watch
import_watch.trace_imports(depth=2) # default depth is unlimited
```## Detect and warn about cyclic imports (at runtime)
```python
import import_watch
import_watch.warn_about_cyclic_imports()
```## Deny cyclic imports (at runtime)
```python
import import_watch
import_watch.deny_cyclic_imports()
```## Start fresh
```python
import import_watch
[..]
import_watch.reset()
```