This project template simplifies creating new projects and facilitating maintaining existing projects by standardizing their structure. Using such a project enhances efficiency and reduces development time for Python projects.
This is an example of how the template will look like after generation.
Copier is required to use this template. Copier is an open source tool that hydrates projects from templates and natively supports updating projects as the original template matures. It's really neat!
See the detailed user guide in readthedocs for more information.
This project itself is just the template, but you need to install these tools to use it:
Choose where you would like to create your new project, and call copier with the template.
>$ python3 -m pip install copier
>$ copier gh:kylr42/universe ~/path/to/your/subproject
Copier will ask you a lot of questions. Answer them to properly generate the template.
If you always used Copier with this project, getting last updates with Copier is simple:
cd ~/path/to/your/downstream/scaffolding
copier update
Copier will ask you all questions again, but default values will be those you answered
last time. Just hit Enter to accept those defaults, or change them if
needed... or you can use copier --force update
instead to avoid answering again all
things.
Basically, read Copier docs and copier --help-all
to know how to use it.
Main application directory. This is where the main application code is stored.
Private application and library code. This is the code you don't want others importing in their applications or libraries. Note that you are not limited to the top level app/internal
directory. You can have more than one app/internal
directory at any level of your project tree.
You can optionally add a bit of extra structure to your internal packages to separate your shared and non-shared internal code. It's not required (especially for smaller projects), but it's nice to have visual clues showing the intended package use. Your actual application code can go in the app/internal
directory and the code shared by those apps in the app/internal/pkg
directory (e.g., app/internal/pkg/middlewares
).
Library code that's ok to use by external applications (e.g., app/pkg/connectors
). Other projects will import these libraries expecting them to work, so think twice before you put something here :-)
The app/pkg
directory is still a good way to explicitly communicate that the code in that directory is safe for use by others.
Scripts to perform various build, install, analysis, etc operations.
Configuration file templates or default configs.
Additional external test apps and test data. Feel free to structure the /tests
directory anyway you want. For bigger projects it makes sense to have a data subdirectory. For example, you can have /tests/data
or /tests/testdata
if you need Go to ignore what's in that directory.
Contributions are welcome! Please see CONTRIBUTING.md for more information.
This project is licensed under the terms of the MIT License.
This project was created with Copier.