Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eamanu/notimportchecker
Python module used on editors to check if a imported module is installed.
https://github.com/eamanu/notimportchecker
Last synced: 3 days ago
JSON representation
Python module used on editors to check if a imported module is installed.
- Host: GitHub
- URL: https://github.com/eamanu/notimportchecker
- Owner: eamanu
- License: gpl-3.0
- Created: 2018-04-06T01:22:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-05T02:22:33.000Z (over 6 years ago)
- Last Synced: 2025-01-17T08:13:07.521Z (10 days ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE.txt
Awesome Lists containing this project
README
# NotImportChecker
Python module used on editors to check if a imported module is installed.# Examples
## Test file
### test1.py
```python
import osprint(os.listdir('.'))
```
### test2.py
```python
import os
import dontExistprint(os.listdir('.'))
```
Use
```python
>>> from notimportchecker import *
>>> c = Checker('test1.py')
>>> c>>> c.get_imports()
{'os': {'lineno': 1, 'mod_name': {'os': 'os'}}}
>>> l = c.get_not_imports_on_file(c.get_imports())
>>> c._import_error_list
{}
>>> print_report(l)
There are not not imports```
```python
>>> c = Checker('test2.py')
>>> c.get_imports()
{'os': {'lineno': 1, 'mod_name': {'os': 'os'}}, 'dontExist': {'lineno': 2, 'mod_name': {'dontExist': 'dontExist'}}}
>>> print(c.get_not_imports_on_file(c.get_imports()))
{'dontExist': {'lineno': 2, 'mod_name': 'dontExist'}}
>>> print_report(l)
dontExist module have 2 Not Imports
dontExist on line: 2```