This is a command line tool to help you create new Python projects. It will create a new directory for your project, initialise a git repository, create a virtual environment, and install some basic dependencies.
Latest Version : v0.4.3
Testing
The generated project includes pytest and some related plugins to allow you to set up testing straight away.
Write your tests in the tests directory and run them with pytest.
Linting
The generated project includes flake8 (with several plugins) for linting and Black for formatting. Mypy is installed for type checking. isort, Pylint and tyrceratops are also installed as standard.
Customize the generated project
You can add extra or edited files to the generated project by adding them to the ~/.pymaker/template directory. The files in this directory will be copied into the generated project, overwriting any existing files with the same name.
It is also possible to dump the whole template into this folder or the current folder so full customization and even removal of files is possible.
Pre-commit
The generated project uses pre-commit to run some checks on the code before it is committed. This is a great tool to help keep your code clean.
To install pre-commit, run the following command from inside your venv:
This is a command line tool to help you create new Python projects. It will create a new directory for your project, initialise a git repository, create a virtual environment, and install some basic dependencies.
Latest Version : v0.4.4
Testing
The generated project includes pytest and some related plugins to allow you to set up testing straight away.
Write your tests in the tests directory and run them with pytest.
Linting
The generated project includes flake8 (with several plugins) for linting and Black for formatting. Mypy is installed for type checking. isort, Pylint and tyrceratops are also installed as standard.
Customize the generated project
You can add extra or edited files to the generated project by adding them to the ~/.pymaker/template directory. The files in this directory will be copied into the generated project, overwriting any existing files with the same name.
It is also possible to dump the whole template into this folder or the current folder so full customization and even removal of files is possible.
Pre-commit
The generated project uses pre-commit to run some checks on the code before it is committed. This is a great tool to help keep your code clean.
To install pre-commit, run the following command from inside your venv:
$ pre-commitinstall
pre-commit installed at .git/hooks/pre-commit
Last update: August 8, 2023 Created: July 26, 2023
\ No newline at end of file
diff --git a/search/search_index.json b/search/search_index.json
index 06a5cca9..c6d784bd 100644
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Python Project Generation Tool","text":"
This is a command line tool to help you create new Python projects. It will create a new directory for your project, initialise a git repository, create a virtual environment, and install some basic dependencies.
The generated project includes flake8 (with several plugins) for linting and Black for formatting. Mypy is installed for type checking. isort, Pylint and tyrceratops are also installed as standard.
"},{"location":"#customize-the-generated-project","title":"Customize the generated project","text":"
You can add extra or edited files to the generated project by adding them to the ~/.pymaker/template directory. The files in this directory will be copied into the generated project, overwriting any existing files with the same name.
It is also possible to dump the whole template into this folder or the current folder so full customization and even removal of files is possible.
This app needs minimal configuration, currently just storing defaults for the author_name, author_email and default_license. This is stored in a configuration file in a sub-folder of the user's home directory. By default (and currently the only option) this file is stored in ~/.pymaker/config.toml. An example of this file is:
If this file does not exist, it will be created on first run. The app will ask for the values of these fields. For author_name and author_email it will try to use the current git user name and email if they are set as defaults, though the user can override these.
Ask for more settings ie homepage, repo, etc. and add them to the generated pyproject.toml file (if the new project is likely to be uploaded to PyPI)
check manually entered package name to ensure no dashes.
add a flag to overwrite existing files if the directory exists. Make this require confirmation. Alternately allow overwrite with confirmation if an existing/populated directory is found. Add a force flag to skip confirmation. I think DO NOT allow this when '.' is specified as this could be disastrous.
when creating a package project, quickly check PyPI to see if the package name is already taken. If it is, either abort or ask the user if they want to continue (making clear they will need to rename the package before it can be uploaded).
add some form of 'extra packages' command line option and config setting to automatically add extra packages to the generated pyproject.toml file.
add cmd line options to specify the project name, author, etc. so the user doesn't have to enter them manually.
add a command line option to specify the project type so the user doesn't have to enter it manually. ie --standalone or --package(latter is default and wouldn't need to be specified).
add a command to the CLI template command to show the template files as a tree, marking whether each file/folder is from the internal templates or the user's templates.
add some sort of 'plugin' functionality where we can specify modified/extra files to be added to the generated project. This would also add a command line flag (ie --django, --pydantic or --fastapi or whatever) to use that plugin, and a config setting to specify using this plugin always.
add CLI options to enable/disable creating a git repo, disable adding test or linting packages etc (expand for any future options). These should also be added to the config file. Settings in the config would have the values 'yes', 'no' or 'ask' (default). CLI values overwrite config values.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
add a CLI option to accept all defaults when generating a project.
Ask if we should run poetry install after generating the project. At this time we can also generate the MkDocs site if requested.
after creating the MkDocs boilerplate (if requested), change the config to use the material theme and add the pymdown-extensions plugin.
It is probably better to install this package globally, rather than in a virtual environment, as it is intended to be used to create new projects. Since we are using Poetry to manage the dependencies, a virtual environment will be created for you anyway specific to each project you are creating.
Install the package globally using pip:
$ pip install pyproject-maker\n
If you cannot install globally due to permissions, you can install it to your user install directory:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"},{"location":"quick-start/","title":"Quick Start","text":""},{"location":"quick-start/#create-a-new-project","title":"Create a new project","text":"
To create a new project, run the following command:
$ pymaker new <project-folder>\n
This will create a new directory with the name you provide.
You can create a new project in the current directory by using . as the project folder name. This must be an empty directory:
$ mkdir test-project\n$ cd test-project\n$ pymaker new .\n
The App will then run the steps needed to get you started quickly:
Copy the template files into the new directory
Initialise a git repository
Commit the boilerplate to Git
You will be asked a series of questions to customise the new project.
"},{"location":"quick-start/#choose-a-package-name-and-description","title":"Choose a package name and description","text":"
When it asks \"Package Name?\" you can choose two variants :
If you are creating a standard Python package that can optionally be uploaded to PyPI, enter a package name here. Note that underscores (\"_\") must be used as opposed to dashes (\"-\") to comply with Python package naming rules. Default is the project folder name with underscores replacing dashes.
For a stand-alone tool that will not ne uploaded to PyPI, or is not a library, enter '-' for the package name. In this case the main.py will just be placed in the project root and no package folder will be created or referenced.
$ pymaker new test-project\nPyMaker - Generate a Python project skeleton.\n\nCreating a new project at /home/bathroom/test-project\n\nName of the Application? (Test Project):\nPackage Name? (Use '-' for standalone script) (test_project):\nDescription of the Application?: An amazing Bigly test project.\nAuthor Name? (Orange Tango):\nAuthor Email? (bigly@spraytan.org):\nApplication License? [None/Apache2/BSD3/BSD2/GPL2/GPL3/LGPL/MIT/MPL2/CDDL/EPL2] (MIT):\n\nCreating a New Python app with the below settings :\n\n Description : An amazing Bigly test project. better than you've ever seen before!\n Package Name : test_project\n Author : Orange Tango\n Email : bigly@spraytan.org\n License : MIT\n Project Dir : /home/bathroom/test-project\n Name : Test Project\n\nIs this correct? [y/n] (y): y\n\n--> Creating project folder ... Done\n--> Creating Git repository ... Done\n\n--> Project created successfully.\n\nNext steps:\n\n 1) Change to the project directory:\n 2) Install the dependencies (creates a virtual environment):\n 'poetry install'\n 3) Activate the virtual environment:\n 'poetry shell'\n 4) Run the application:\n 'test-project'\n 5) Code!\n\nSee the README.md file for more information.\n
By default, the generated application will have a basic template that you can use to get started, this template is stored inside the package itself. It will contain all you need to get started, including a basic README.md file.
The dependency management is handled by Poetry, and we include a pyproject.toml file with several useful dependencies:
PyTest for testing, along with several useful plugins.
The Black code formatter.
The Flake8 linter, along with a good selection of plugins. It is also set up to use the pyproject.toml for it's configuration, and to work nicely with Black.
Pylint and Pydocstyle linters.
MyPy for static type checking.
Isort for sorting imports.
pre-commit for running checks before committing code.
"},{"location":"template/modify/","title":"Adding or Modifying files in the template","text":"
If you wish to add or change specific files in the template, you can do so by adding them to the ~/.pymaker/template folder. The files (and folders) in this folder will be copied to the root of the project when the template is generated.
Files in this global template folder will override any files in the default template, so you can for example change the README.md file, add to the .gitignore or even add a complete extra folder structure.
If you want to do a major change to the template, you can actually dump the default template to this folder and modify or delete files as you see fit. See the next section for more information on how to do this.
"},{"location":"template/replace/","title":"Replacing the Default Template","text":""},{"location":"template/replace/#dump-the-default-template","title":"Dump the Default Template","text":"
Should you wish to heavily modify the default template, or even replace it completely, you can do so by dumping the default template to the ~/.pymaker/template folder. This will copy all files from the default template to the global template folder, where you can modify or delete them as you see fit.
To do this, run the following command:
$ pymaker template dump\n
This will copy the default template to the global template folder (~/.pymaker/template). You can then modify or delete files as you see fit.
Running this command will ask you if you wish to set this exported template as the default template. It will then ask you if you want to disable the internal template. If you answer yes, then the internal template will be disabled, and ONLY the exported template will be used instead. Otherwise, both will still be used with the exported template taking precedence.
"},{"location":"template/replace/#change-the-location-of-the-template-folder","title":"Change the location of the Template folder","text":"
If you wish to change the location of the template folder, you can do so in 2 ways:
By adding the --local flag to the above command (e.g. pymaker template dump --local). This will dump the default template to the current folder, giving you the option to disable the default template if needed. Note that any files in the folder will be overwritten.
By changing to the folder containing your template and running pymaker template set. This will set the current folder as the template folder and give you the same option to disable the default template.
You can reset the template location back to the default ~/.pymaker/template folder by running the following command:
$ pymaker template reset\n
"},{"location":"template/replace/#choose-to-use-the-default-template-or-not","title":"Choose to use the Default Template or not","text":"
Running the dump command will give you the option to disable the default template completely and ONLY use the exported template. You can also do this (or revert back to the default template) by running the following command:
$ pymaker template default <enable|disable>\n
enable will enable the default template, and disable will disable it. Please note that any custom templates you have created will still be used, and will overwrite the default template if they have the same file name.
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Python Project Generation Tool","text":"
This is a command line tool to help you create new Python projects. It will create a new directory for your project, initialise a git repository, create a virtual environment, and install some basic dependencies.
The generated project includes flake8 (with several plugins) for linting and Black for formatting. Mypy is installed for type checking. isort, Pylint and tyrceratops are also installed as standard.
"},{"location":"#customize-the-generated-project","title":"Customize the generated project","text":"
You can add extra or edited files to the generated project by adding them to the ~/.pymaker/template directory. The files in this directory will be copied into the generated project, overwriting any existing files with the same name.
It is also possible to dump the whole template into this folder or the current folder so full customization and even removal of files is possible.
This app needs minimal configuration, currently just storing defaults for the author_name, author_email and default_license. This is stored in a configuration file in a sub-folder of the user's home directory. By default (and currently the only option) this file is stored in ~/.pymaker/config.toml. An example of this file is:
If this file does not exist, it will be created on first run. The app will ask for the values of these fields. For author_name and author_email it will try to use the current git user name and email if they are set as defaults, though the user can override these.
Ask for more settings ie homepage, repo, etc. and add them to the generated pyproject.toml file (if the new project is likely to be uploaded to PyPI)
check manually entered package name to ensure no dashes.
add a flag to overwrite existing files if the directory exists. Make this require confirmation. Alternately allow overwrite with confirmation if an existing/populated directory is found. Add a force flag to skip confirmation. I think DO NOT allow this when '.' is specified as this could be disastrous.
when creating a package project, quickly check PyPI to see if the package name is already taken. If it is, either abort or ask the user if they want to continue (making clear they will need to rename the package before it can be uploaded).
add some form of 'extra packages' command line option and config setting to automatically add extra packages to the generated pyproject.toml file.
add cmd line options to specify the project name, author, etc. so the user doesn't have to enter them manually.
add a command line option to specify the project type so the user doesn't have to enter it manually. ie --standalone or --package(latter is default and wouldn't need to be specified).
add a command to the CLI template command to show the template files as a tree, marking whether each file/folder is from the internal templates or the user's templates.
add some sort of 'plugin' functionality where we can specify modified/extra files to be added to the generated project. This would also add a command line flag (ie --django, --pydantic or --fastapi or whatever) to use that plugin, and a config setting to specify using this plugin always.
add CLI options to enable/disable creating a git repo, disable adding test or linting packages etc (expand for any future options). These should also be added to the config file. Settings in the config would have the values 'yes', 'no' or 'ask' (default). CLI values overwrite config values.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
add a CLI option to accept all defaults when generating a project.
Ask if we should run poetry install after generating the project. At this time we can also generate the MkDocs site if requested.
after creating the MkDocs boilerplate (if requested), change the config to use the material theme and add the pymdown-extensions plugin.
It is probably better to install this package globally, rather than in a virtual environment, as it is intended to be used to create new projects. Since we are using Poetry to manage the dependencies, a virtual environment will be created for you anyway specific to each project you are creating.
Install the package globally using pip:
$ pip install pyproject-maker\n
If you cannot install globally due to permissions, you can install it to your user install directory:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"},{"location":"quick-start/","title":"Quick Start","text":""},{"location":"quick-start/#create-a-new-project","title":"Create a new project","text":"
To create a new project, run the following command:
$ pymaker new <project-folder>\n
This will create a new directory with the name you provide.
You can create a new project in the current directory by using . as the project folder name. This must be an empty directory:
$ mkdir test-project\n$ cd test-project\n$ pymaker new .\n
The App will then run the steps needed to get you started quickly:
Copy the template files into the new directory
Initialise a git repository
Commit the boilerplate to Git
You will be asked a series of questions to customise the new project.
"},{"location":"quick-start/#choose-a-package-name-and-description","title":"Choose a package name and description","text":"
When it asks \"Package Name?\" you can choose two variants :
If you are creating a standard Python package that can optionally be uploaded to PyPI, enter a package name here. Note that underscores (\"_\") must be used as opposed to dashes (\"-\") to comply with Python package naming rules. Default is the project folder name with underscores replacing dashes.
For a stand-alone tool that will not ne uploaded to PyPI, or is not a library, enter '-' for the package name. In this case the main.py will just be placed in the project root and no package folder will be created or referenced.
$ pymaker new test-project\nPyMaker - Generate a Python project skeleton.\n\nCreating a new project at /home/bathroom/test-project\n\nName of the Application? (Test Project):\nPackage Name? (Use '-' for standalone script) (test_project):\nDescription of the Application?: An amazing Bigly test project.\nAuthor Name? (Orange Tango):\nAuthor Email? (bigly@spraytan.org):\nApplication License? [None/Apache2/BSD3/BSD2/GPL2/GPL3/LGPL/MIT/MPL2/CDDL/EPL2] (MIT):\n\nCreating a New Python app with the below settings :\n\n Description : An amazing Bigly test project. better than you've ever seen before!\n Package Name : test_project\n Author : Orange Tango\n Email : bigly@spraytan.org\n License : MIT\n Project Dir : /home/bathroom/test-project\n Name : Test Project\n\nIs this correct? [y/n] (y): y\n\n--> Creating project folder ... Done\n--> Creating Git repository ... Done\n\n--> Project created successfully.\n\nNext steps:\n\n 1) Change to the project directory:\n 2) Install the dependencies (creates a virtual environment):\n 'poetry install'\n 3) Activate the virtual environment:\n 'poetry shell'\n 4) Run the application:\n 'test-project'\n 5) Code!\n\nSee the README.md file for more information.\n
By default, the generated application will have a basic template that you can use to get started, this template is stored inside the package itself. It will contain all you need to get started, including a basic README.md file.
The dependency management is handled by Poetry, and we include a pyproject.toml file with several useful dependencies:
PyTest for testing, along with several useful plugins.
The Black code formatter.
The Flake8 linter, along with a good selection of plugins. It is also set up to use the pyproject.toml for it's configuration, and to work nicely with Black.
Pylint and Pydocstyle linters.
MyPy for static type checking.
Isort for sorting imports.
pre-commit for running checks before committing code.
"},{"location":"template/modify/","title":"Adding or Modifying files in the template","text":"
If you wish to add or change specific files in the template, you can do so by adding them to the ~/.pymaker/template folder. The files (and folders) in this folder will be copied to the root of the project when the template is generated.
Files in this global template folder will override any files in the default template, so you can for example change the README.md file, add to the .gitignore or even add a complete extra folder structure.
If you want to do a major change to the template, you can actually dump the default template to this folder and modify or delete files as you see fit. See the next section for more information on how to do this.
"},{"location":"template/replace/","title":"Replacing the Default Template","text":""},{"location":"template/replace/#dump-the-default-template","title":"Dump the Default Template","text":"
Should you wish to heavily modify the default template, or even replace it completely, you can do so by dumping the default template to the ~/.pymaker/template folder. This will copy all files from the default template to the global template folder, where you can modify or delete them as you see fit.
To do this, run the following command:
$ pymaker template dump\n
This will copy the default template to the global template folder (~/.pymaker/template). You can then modify or delete files as you see fit.
Running this command will ask you if you wish to set this exported template as the default template. It will then ask you if you want to disable the internal template. If you answer yes, then the internal template will be disabled, and ONLY the exported template will be used instead. Otherwise, both will still be used with the exported template taking precedence.
"},{"location":"template/replace/#change-the-location-of-the-template-folder","title":"Change the location of the Template folder","text":"
If you wish to change the location of the template folder, you can do so in 2 ways:
By adding the --local flag to the above command (e.g. pymaker template dump --local). This will dump the default template to the current folder, giving you the option to disable the default template if needed. Note that any files in the folder will be overwritten.
By changing to the folder containing your template and running pymaker template set. This will set the current folder as the template folder and give you the same option to disable the default template.
You can reset the template location back to the default ~/.pymaker/template folder by running the following command:
$ pymaker template reset\n
"},{"location":"template/replace/#choose-to-use-the-default-template-or-not","title":"Choose to use the Default Template or not","text":"
Running the dump command will give you the option to disable the default template completely and ONLY use the exported template. You can also do this (or revert back to the default template) by running the following command:
$ pymaker template default <enable|disable>\n
enable will enable the default template, and disable will disable it. Please note that any custom templates you have created will still be used, and will overwrite the default template if they have the same file name.
"}]}
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index 9b5a081d..a6fe7ad7 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,52 +2,52 @@
https://pymaker.seapagan.net/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/configuration/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/future-plans/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/installation/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/license/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/quick-start/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/tasks/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/template/internal/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/template/modify/
- 2023-08-15
+ 2023-08-16dailyhttps://pymaker.seapagan.net/template/replace/
- 2023-08-15
+ 2023-08-16daily
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index 1eda76ac..59edfcac 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ