Skip to main content

A module to know if there are some modules imported that does not exist

Project description

NotImportChecker

Python module used on editors to check if a imported module is installed.

Examples

Test file

test1.py

import os

print(os.listdir('.'))

test2.py

import os
import dontExist

print(os.listdir('.'))

Use

>>> from notimportchecker import *
>>> c = Checker('test1.py')
>>> c
<notimportchecker.Checker object at 0x7f172352bdd0>
>>> 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
>>> 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NotImportChecker-0.0.1b1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distributions

NotImportChecker-0.0.1b1-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2 Python 3

NotImportChecker-0.0.1b1-py2.7.egg (5.2 kB view details)

Uploaded Source

File details

Details for the file NotImportChecker-0.0.1b1.tar.gz.

File metadata

File hashes

Hashes for NotImportChecker-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 99a86bdd711e99d274e9d9fcc62561dac5f9654bdff39036b4784e0ff69da24b
MD5 c9a2d50fcd3126090d9b6163ddbbc10e
BLAKE2b-256 b4f2b52aad7508f76b1c7ca9b812de1ced59806caec52d43c0debab634d32bac

See more details on using hashes here.

File details

Details for the file NotImportChecker-0.0.1b1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for NotImportChecker-0.0.1b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a31a417c7dd569322fc5a7d96d6e940a9d960728fcb46f0803ea2743aec0bd5c
MD5 aab61d58b5efe8e5921bdb26c42f3267
BLAKE2b-256 c28941b3946756b5aa8b26faefa689764a7f04712a3cda97df64961fe525b9d5

See more details on using hashes here.

File details

Details for the file NotImportChecker-0.0.1b1-py2.7.egg.

File metadata

File hashes

Hashes for NotImportChecker-0.0.1b1-py2.7.egg
Algorithm Hash digest
SHA256 3de3085f516896c252beddc83965a4524b441e60f167865590e438d38933b3ec
MD5 73b8613ae3523f276b294ba92fcf4668
BLAKE2b-256 1d44c3b6dfadb496fafa84d78991da682152cc4dc9b23eb8088b4861ae03ec40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page