A tool that allows to quickly get your basic project structure ready, while adopting the best technologies, tools, and practices.
Project description
create_app is a tool for creating applications from templates.
When developers start a new project, they perform some repetitive tasks to build the basic project structure before actually start coding features. This basic structure involves things like: Well, the project structure, unit testing, code coverage, containerization, code linting and formatting, GIT hooks, building code documentation, among many others.
create_app is a tool that allows to quickly get your basic project structure ready. It provides a set of templates from which you can get your project started, plus it's super easy to use and encourages the adoption of the best technologies, tools, and practices.
At the moment, there are only Python templates available. But create_app can generate projects of any language, as it uses cookiecutter.
Installation
Just install it with PIP:
python -m pip install create_app
Usage
Learn how to use the create_app command:
python -m create_app --help
You can use the --help option for all subcommands too.
List templates
Use the list subcommand to know which templates you can use:
python -m create_app list
Create your project from a template
Use the create subcommand and specify the TEMPLATE_NAME you wish to use:
create_app create TEMPLATE_NAME
Using the template defaults
If you don't want to configure your project and just want to create it from the template using all the default values, use the --use-defaults flag:
create_app create TEMPLATE_NAME --use-defaults
Using a configuration file
When creating a project, you are asked to type your project configuration in. If you already know which the template settings are and the values you want to use, you can use the --config-file option to specify these values from a JSON file. This option is specially useful for scripting:
create_app create TEMPLATE_NAME --config-file=config.json
Using a custom templates index
You or your organization may need to keep a separate index with your own templates.
If that's the case, you can list the templates in the custom index by running:
create_app list --index="https://www.somewhere.com/templates-index"
And create your project from a template in that index:
create_app create TEMPLATE_NAME --index="https://www.somewhere.com/templates-index"
Using create_app from Python
You can import create_app from Python too, which is great for scripting or creating multiple projects at once:
from create_app.main import create_app
# Create from a template named "python_simple"
create_app("python_simple")
How it works
It uses a great tool named cookiecutter to build your project from a template. The templates are cookiecutters, so you could simply use cookiecutter to build your project from the template repo URL:
python -m cookiecutter https://github.com/application-creators/python_simple
create_app is just an entry point to a set of templates, and I was inspired by create-react-app, which lets you create your project from a template by just specifying a template name.
The main goal though, and what I would like to focus on, is to come up with great project templates. Then people can choose to directly use cookiecutter to build their projects, or could use this tool to discover which templates are available and to create their project.
Index of Available Templates
There's an index of templates, from which you can get your project started:
Template | Description |
---|---|
python_simple | Python project with unit tests, GIT hooks (pre-commit, black, isort, and flake8), and Docker |
python_compose | Python project with unit tests, GIT hooks (pre-commit, black, isort, and flake8), and Docker Compose |
python_fastapi | FastAPI project with unit tests, GIT hooks (pre-commit, black, isort, and flake8), and Docker |
python_fastapi_with_database | FastAPI project with unit tests, GIT hooks (pre-commit, black, isort, and flake8), Docker Compose, a PostgreSQL database (which can be very easily changed for any other), SQLAlchemy, and Alembic migrations |
Contribute
Application Creators is a new GitHub organization I've created to host, debate, and maintain this tool and the project templates. Its goal is to generate state-of-the-art templates useful to everyone. Feel free to express you opinion and contribute!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file create_app-0.6.2.tar.gz
.
File metadata
- Download URL: create_app-0.6.2.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c32f2641f1965663b7d200bd952af30f5dab33c56685f2fd4fd794e4e49ecd39 |
|
MD5 | 0beb0891093b73b4d9719f98d793fe90 |
|
BLAKE2b-256 | 41c3a6288b9e247b0bb84b3ad313932794648998198e81f1a0f85e9f7addcbde |
File details
Details for the file create_app-0.6.2-py3-none-any.whl
.
File metadata
- Download URL: create_app-0.6.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b73272100e3a634317ed4b0187d4a344b4de5c313c8457ed286a0890ad2447 |
|
MD5 | fde44fff6f6d33fc64cbb5f171008fd2 |
|
BLAKE2b-256 | 4b8fd102aefe79c18d3ea0d11fabaf70a48853b837d66a672e777c74fd7bf75f |