create-app 0.6.2
A tool that allows to quickly get your basic project structure ready, while adopting the best technologies, tools, and practices.
License: MIT
Requires Python: >=3.6.2

<p align="center">
  <img alt="Create App logo" src="https://raw.githubusercontent.com/application-creators/create_app/main/docs/static/logo-cropped.png">
</p>

<p align="center">
    <a href="https://github.com/application-creators/create_app/actions"><img alt="Test Workflow Status" src="https://github.com/application-creators/create_app/workflows/Test/badge.svg"></a>
    <a href="https://github.com/application-creators/create_app/actions"><img alt="Linting Workflow Status" src="https://github.com/application-creators/create_app/workflows/Lint/badge.svg"></a>
    <a href="https://github.com/application-creators/create_app/actions"><img alt="PyPI Publication Workflow Status" src="https://github.com/application-creators/create_app/workflows/Publish%20to%20PyPI/badge.svg"></a>
    <a href="https://coveralls.io/github/application-creators/create_app?branch=main"><img alt="Coverage Status" src="https://coveralls.io/repos/github/application-creators/create_app/badge.svg?branch=main"></a>
    <!-- <a href="https://github.com/application-creators/create_app/blob/main/LICENSE"><img alt="License: MIT" src="https://create_app.readthedocs.io/en/stable/_static/license.svg"></a> -->
    <!-- <a href="https://create_app.readthedocs.io/en/stable/?badge=stable"><img alt="Documentation Status" src="https://readthedocs.org/projects/create_app/badge/?version=stable"></a>  -->
    <a href="https://pypi.org/project/create_app/"><img alt="PyPI" src="https://img.shields.io/pypi/v/create_app"></a>
    <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

_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](https://cookiecutter.readthedocs.io/en/stable/).


## Installation

Just install it with PIP:
```shell
python -m pip install create_app
```

## Usage

Learn how to use the _create_app_ command:
```shell
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:

```shell
python -m create_app list
```


### Create your project from a template

Use the _create_ subcommand and specify the _TEMPLATE_NAME_ you wish to use:
```shell
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:
```shell
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:
```shell
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:
```shell
create_app list --index="https://www.somewhere.com/templates-index"
```

And create your project from a template in that index:
```shell
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:

```python
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](https://cookiecutter.readthedocs.io/en/stable/) 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:
```shell
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](https://create-react-app.dev/docs/getting-started#selecting-a-template), 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](/templates.json), from which you can get your project started:

| **Template**                                                                                         | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [python_simple](https://github.com/application-creators/python_simple)                               | Python project with unit tests, GIT hooks ([pre-commit](https://pre-commit.com/), [black](https://github.com/psf/black), [isort](https://pycqa.github.io/isort/), and [flake8](https://flake8.pycqa.org/en/latest/)), and Docker                                                                                                                                                                                                                   |
| [python_compose](https://github.com/application-creators/python_compose)                             | Python project with unit tests, GIT hooks ([pre-commit](https://pre-commit.com/), [black](https://github.com/psf/black), [isort](https://pycqa.github.io/isort/), and [flake8](https://flake8.pycqa.org/en/latest/)), and Docker Compose                                                                                                                                                                                                           |
| [python_fastapi](https://github.com/application-creators/python_fastapi)                             | FastAPI project with unit tests, GIT hooks ([pre-commit](https://pre-commit.com/), [black](https://github.com/psf/black), [isort](https://pycqa.github.io/isort/), and [flake8](https://flake8.pycqa.org/en/latest/)), and Docker                                                                                                                                                                                                                  |
| [python_fastapi_with_database](https://github.com/application-creators/python_fastapi_with_database) | FastAPI project with unit tests, GIT hooks ([pre-commit](https://pre-commit.com/), [black](https://github.com/psf/black), [isort](https://pycqa.github.io/isort/), and [flake8](https://flake8.pycqa.org/en/latest/)), Docker Compose, a [PostgreSQL](https://www.postgresql.org/) database (which can be very easily changed for any other), [SQLAlchemy](https://www.sqlalchemy.org/), and [Alembic](https://alembic.sqlalchemy.org/) migrations |


## Contribute

[Application Creators](https://github.com/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!