A package is a directory with __init__.py in it. The difference from the catalog is that you can import it.
There is no "Python path" as such, but you will find that it is recommended that you place all your modules in one package with the name associated with the project.
In addition, to follow the Python style guide, PEP8, package and module names must be lowercase. So, if we assume that the project is called "Bot Statistics", your structure will be something like this:
botondstats/ indicators/ moving_averages.py stochastics.py strategies/ moving_averages_cross.py example.py
Then you will find the Stochastic class by doing
from botondstats.indicators.stochastics.Stochastics
(There are several ways to maintain the structure, but to make the import shorter, but that is another question).
You can put this structure under src/ if you want, but this is not necessary. I never do that. Instead, I have a main directory:
BotondStatistics/ docs/ botonstats/
In this directory, I also usually have virtualenv, so I also have bin / lib / et al. Development is usually done by running
./bin/python setup.py tests
How I use Distrubute test runner to run tests.
How I do it. :-)
Lennart Regebro Mar 01 2018-11-11T00: 00Z
source share