Skip to content

i96751414/import-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

import-module
import-module

Golang style imports in python

Codacy Badge Build Status License

import-module is a python package which allows to import packages as in golang. Currently it supports modules from github.com, bitbucket.org, git.launchpad.net, and pypi.python.org.

Usage

Importing a module (with statement must be used):

from import_module import ImportModule

with ImportModule("github.com/i96751414/py-dummy"):
    import dummy

print("The output of dummy.call is '{}'".format(dummy.call()))

Output:

The output of dummy.call is 'call'

API

  • ImportModule(module, path=None, reload_module=False, use_pip=False)

    Import the specified module. If the module already exists and reload_module is True, then re-import the module. If path is given, the module will be imported to the given path. If use_pip is True, the module will be imported with pip, even if it is a git repository.

Releases

No releases published

Packages

No packages published

Languages