I am a python module-making novice. Following the spirit of this question, I installed Rx to validate some data from YAML files. Wanting to keep the whole party together, I simply put the whole git tree under site-packages. This provided me a (very simplified) tree to the python implementation of site-packages/Rx/python/Rx.py.
Since this cannot be directly imported, I added __init__.py to site-packages/Rx, with a single line:
from Rx.python.Rx import *
Since it still cannot be directly imported, I added __init__.py to site-packages/Rx/python, with a single line:
from Rx import *
Now, I can successfully import. This is great, but I don't care for the following
>>> import Rx
>>> a = Rx.Factory()
>>> a
<Rx.python.Rx.Factory object at 0x00C0CCF0>
I would just like the objects to be referenced by the package name Rx, e.g., <Rx.Factory object at 0x00C0CCF0>.
How is this correctly done? Thanks!
EDIT, for anyone who might come across the same problem:
I emptied out site-packages/Rx/python/__init__.py, and changed site-packages/Rx/__init__.py, as follows:
import os
__path__.append( os.path.join(__path__[0], 'python') )
from Rx import *
This isn't exactly what I wanted, but at least now the objects are Rx.Rx.Factory, etc.