Are there any tools which generate a project layout for python specific projects, much similar to what maven accomplishes with mvn archetype:generate
for java p
In Python (just as in any language) there are a lot of pieces to configure if you want to make all of them play nicely together. Documentation, testing, virtual envs, packaging, ...
You can add those configuration along the way, when you actually need them, or when your project starts growing. Having a tool that can configure all that for you and just let you fill the blanks does help quite a bit.
A few projects to look at:
It is the good news: you do not need any tool. You can organise your source code in any way you want.
Let recap why we need tools in the java world:
In java you want to generate directories upfront because the namespace system dictates that each class must live in one file in a directory structure that reflects that package hierarchy. As a consequence you have a deep folder structure. Maven enforces an additional set of convention for file location. You want to have tools to automate this.
Secondly, different artefacts require use of different goals and even additional maven projects (e.g. a ear project requires a few jars and war artefacts). There are so many files to create you want to have tools to automate this.
The complexity makes tools like mvn archetype:generate
not just helpful. It is almost indispensable.
In python land, we just do not have these complexity in the language.
If my project is small, I can put all my classes and functions in a single file (if it makes sense)
If my project is of a bigger size (LOC or team size), it makes sense to group .py
files into modules in whatever way makes sense to you and your peers.
At the end of the days, it is about striking a balance between ease of maintenance and readability.
The following few bash commands work pretty well for me:
mkdir myproject
cd myproject
mkdir docs
mkdir tests
touch tests/__init__.py
With python, unlike java or c, you generally don't need much more than this. See the answers to a related question. If you think you need more, you're going to have to be more specific about your requirements.