# `mrproject` - make projects from templates
This project is [home cooked software](https://www.robinsloan.com/notes/home-cooked-app/).
But of course, you are free to use it as you wish.
You might even like it.
Features:
- Generate projects from templates: `mrproject new --template <template> <project_name>`
- Templates are normal python projects and don't use any templating language.
That means you can actually **use/test your template while you add new features**.
- The default templates are build with a high degree of automation in mind.
- List existing templates: `mrproject list`
- That's it 🤷
## Usage
```bash
mrproject help
```
```text
usage: mrproject command
Commands:
new Create a new project from a template with `project_name`.
list List all available templates.
help Print usage documentation on a specific command.
```
### Usage: `mrproject new`
```bash
mrproject help new
```
```text
usage: mrproject new [-t|--template] [-n|--no-interaction] project_name
Create a new project from a template with `project_name`.
Example usage:
mrproject new my_new_project
mrproject new my_new_project --template my_fancy_template
Options:
--template
The name or path of the template to use.
Use `mrproject list` to list all available templates.
--no-interaction
Don't ask for user input but accept defaults.
```
When calling `mrproject new`
- the user config file is read (`~/.config/mrproject/config.toml`),
- the user is asked to specify/overwrite all variables defined in `mrproject_template.toml`,
- the template project is copied to the current working directory,
- every occurrence of `MRPROJECT_*` is replaced with the corresponding value
(including the folder and file names),
- and that's it.
This approach is very limited (on purpose) and very simple.
### Usage: `mrproject list`
```bash
mrproject help list
```
```text
usage: mrproject list
List all available templates.
```
## Template
Currently `mrproject` comes with the following templates:
- [default](mrproject/templates/default/README.md)
### What Is A Template?
A `template` is a just a folder that with these files:
```text
mrproject_template.toml # contains the variables that are substituted
README.md # README desribing the features of the template
MRPROJECT_PROJECT_NAME/ # the acual project that is copied
... # anything you want really :)
tests/ # optional tests for your template
...
```
The file `mrproject_template.toml` MUST contain the following fields:
```toml
[mrproject.template.substitutions]
MRPROJECT_AUTHOR = "your name"
MRPROJECT_EMAIL = "your@email.com"
```
Some additional fields are added by `mrproject` automatically:
- `MRPROJECT_CURRENT_YEAR` - the current year
The fields MUST start with `MRPROJECT_` and MUST be upper case.
### Create Your Own Template
First, read the section above.
Then, you can create your own template by putting it in the `templates` folder under:
`~/.local/share/mrproject/templates/`.
```text
~/.local/share/mrproject/templates/
my_template/
README.md
mrproject_template.toml
MRPROJECT_PROJECT_NAME/
...
tests/
...
```
## User Config
The user config file is located at `~/.config/mrproject/config.toml`.
Currently you can only specify default substitutions:
```toml
[mrproject.template.substitutions]
MRPROJECT_AUTHOR = "your name"
MRPROJECT_EMAIL = "your@email.com"
```
## Why `mrproject`?
There are many project template generators out there,
and many of them are great and more feature rich than this one.
But I want to have a **simple** one
where I can **actually use/test the project template as I add new features**.
This is achieved by not using any templating language, but reserved keywords.
Raw data
{
"_id": null,
"home_page": "https://github.com/sotte/mrproject/",
"name": "mrproject",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "mrproject,template,scaffold",
"author": "Stefan Otte",
"author_email": "stefan.otte@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6c/60/9bbf3b793de2618356d0bca59b5bcd1a4106819d3155f119dfaaf6c00458/mrproject-0.2.0.tar.gz",
"platform": null,
"description": "# `mrproject` - make projects from templates\n\nThis project is [home cooked software](https://www.robinsloan.com/notes/home-cooked-app/).\nBut of course, you are free to use it as you wish.\nYou might even like it.\n\nFeatures:\n\n- Generate projects from templates: `mrproject new --template <template> <project_name>`\n- Templates are normal python projects and don't use any templating language.\n That means you can actually **use/test your template while you add new features**.\n- The default templates are build with a high degree of automation in mind.\n- List existing templates: `mrproject list`\n- That's it \ud83e\udd37\n\n## Usage\n\n```bash\nmrproject help\n```\n\n```text\nusage: mrproject command\n\nCommands:\n\n new Create a new project from a template with `project_name`.\n list List all available templates.\n help Print usage documentation on a specific command.\n```\n\n### Usage: `mrproject new`\n\n```bash\nmrproject help new\n```\n\n```text\nusage: mrproject new [-t|--template] [-n|--no-interaction] project_name\n\nCreate a new project from a template with `project_name`.\n\n Example usage:\n\n mrproject new my_new_project\n mrproject new my_new_project --template my_fancy_template\n\n Options:\n\n --template\n The name or path of the template to use.\n Use `mrproject list` to list all available templates.\n\n --no-interaction\n Don't ask for user input but accept defaults.\n```\n\nWhen calling `mrproject new`\n- the user config file is read (`~/.config/mrproject/config.toml`),\n- the user is asked to specify/overwrite all variables defined in `mrproject_template.toml`,\n- the template project is copied to the current working directory,\n- every occurrence of `MRPROJECT_*` is replaced with the corresponding value\n (including the folder and file names),\n- and that's it.\nThis approach is very limited (on purpose) and very simple.\n\n### Usage: `mrproject list`\n\n```bash\nmrproject help list\n```\n\n```text\nusage: mrproject list\n\nList all available templates.\n```\n\n## Template\n\nCurrently `mrproject` comes with the following templates:\n\n- [default](mrproject/templates/default/README.md)\n\n### What Is A Template?\n\nA `template` is a just a folder that with these files:\n\n```text\nmrproject_template.toml # contains the variables that are substituted\nREADME.md # README desribing the features of the template\nMRPROJECT_PROJECT_NAME/ # the acual project that is copied\n ... # anything you want really :)\ntests/ # optional tests for your template\n ...\n```\n\nThe file `mrproject_template.toml` MUST contain the following fields:\n\n```toml\n[mrproject.template.substitutions]\nMRPROJECT_AUTHOR = \"your name\"\nMRPROJECT_EMAIL = \"your@email.com\"\n```\n\nSome additional fields are added by `mrproject` automatically:\n\n- `MRPROJECT_CURRENT_YEAR` - the current year\n\nThe fields MUST start with `MRPROJECT_` and MUST be upper case.\n\n### Create Your Own Template\n\nFirst, read the section above.\nThen, you can create your own template by putting it in the `templates` folder under:\n`~/.local/share/mrproject/templates/`.\n\n```text\n~/.local/share/mrproject/templates/\n my_template/\n README.md\n mrproject_template.toml\n MRPROJECT_PROJECT_NAME/\n ...\n tests/\n ...\n```\n\n## User Config\n\nThe user config file is located at `~/.config/mrproject/config.toml`.\nCurrently you can only specify default substitutions:\n\n```toml\n[mrproject.template.substitutions]\nMRPROJECT_AUTHOR = \"your name\"\nMRPROJECT_EMAIL = \"your@email.com\"\n```\n\n## Why `mrproject`?\n\nThere are many project template generators out there,\nand many of them are great and more feature rich than this one.\n\nBut I want to have a **simple** one\nwhere I can **actually use/test the project template as I add new features**.\nThis is achieved by not using any templating language, but reserved keywords.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "`mrproject` - make projects from templates",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/sotte/mrproject/"
},
"split_keywords": [
"mrproject",
"template",
"scaffold"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2bb862d224e51452dbe6710142f02efdb1c833134e01991851ca2cf4cd298b65",
"md5": "b65098155dbb2f235be70f71b12415f7",
"sha256": "9d5e56a9df49b7a67c78b8152d9bb71708b5ae08827d7b1c2d8dcedf151a34b3"
},
"downloads": -1,
"filename": "mrproject-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b65098155dbb2f235be70f71b12415f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 40326,
"upload_time": "2024-02-17T19:58:36",
"upload_time_iso_8601": "2024-02-17T19:58:36.411066Z",
"url": "https://files.pythonhosted.org/packages/2b/b8/62d224e51452dbe6710142f02efdb1c833134e01991851ca2cf4cd298b65/mrproject-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c609bbf3b793de2618356d0bca59b5bcd1a4106819d3155f119dfaaf6c00458",
"md5": "444bec09ccbd73565cd089420c5c32cd",
"sha256": "7d6646dc9d4c1de331f896aaee8b71567961407b6d086a479f01a8620d11abfc"
},
"downloads": -1,
"filename": "mrproject-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "444bec09ccbd73565cd089420c5c32cd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 36338,
"upload_time": "2024-02-17T19:59:01",
"upload_time_iso_8601": "2024-02-17T19:59:01.804162Z",
"url": "https://files.pythonhosted.org/packages/6c/60/9bbf3b793de2618356d0bca59b5bcd1a4106819d3155f119dfaaf6c00458/mrproject-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-17 19:59:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sotte",
"github_project": "mrproject",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mrproject"
}