Filesystem structure of a Python project
Doesn't too much matter. Whatever makes you happy will work. There aren't a lot of silly rules because Python projects can be simple.
/scriptsor/binfor that kind of command-line interface stuff/testsfor your tests/libfor your C-language libraries/docfor most documentation/apidocfor the API docs.- A README file to explain your app.
Don't:
- put your source in a directory called
srcorlib. This makes it hard to run without installing. - put your tests outside of your Python package. This makes it hard to run the tests against an installed version.
- create a package that only has a
__init__.pyand then put all your code into__init__.py. Just make a module instead of a package, it's simpler. - try to come up with magical hacks to make Python able to import your module or package without having the user add the directory containing it to their import path (either via
PYTHONPATHor some other mechanism). You will not correctly handle all cases and users will get angry at you when your software doesn't work in their environment.
sources: