I'm using one package that with __init__.py
import only one variable from module, but whole module itself is not exposed. Is there a way to access that module?
Lets look in this case:
Whole package:
test_package/
├── __init__.py
└── test_me.py
Now contents:
__init__.py:
from .test_me import test_me
test_me.py:
STATIC = 'static'
class Test:
pass
test_me = Test()
Now if I import package test_package
. I can only access variable test_me
, which is an instance of Test
class. Though I can't access STATIC
variable, because module itself was not exposed.
Is there a way to access test_me
module in this case and not only one of its variables?
P.S. If I use sys
to append path directly to that package's module, it throws error that such module does not exist when I try to import it.