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:
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:
[pymaker]author_email="user@server.com"author_name="Python User"default_license="MIT"
+include_linters=true
+include_mkdocs=false
+include_testing=trueschema_version="1.0"# for internal use, generally don't change thistemplate_folder="/home/user/.pymaker/template"use_default_template=true
-
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.
View configuration
You can list the current configuration with the command:
$ pymaker config show
+use_git=true
+
If this file does not exist, it will be created on first run. The app will ask for the values of author_name, author_email and default_license. 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.
View configuration
You can list the current configuration with the command:
$ pymaker config show
Set configuration
The configuration is set the first time you run the app, but you can change these defaults at any time using the command:
$ pymakerconfigchange
-
The latter command will prompt you for the values of the fields, and then update the configuration file.
Last update: August 10, 2023 Created: July 30, 2023
\ No newline at end of file
+
The latter command will prompt you for the values of Author name, email and default License, and then update the configuration file.
Last update: August 31, 2023 Created: July 30, 2023
\ No newline at end of file
diff --git a/future-plans/index.html b/future-plans/index.html
index 09e11de7..b6769e25 100644
--- a/future-plans/index.html
+++ b/future-plans/index.html
@@ -1 +1 @@
-Future Plans - Python Project Generation Tool
The below is a list of things I'd like to add to the project in the future, and is kinda a 'work list' for me.
Everything below will be implemented and are in no particular order or importance.
General
Ask for more settings ie homepage, repo, etc. and add them to the generated pyproject.toml file (if the new project is not standalone).
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.
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. Not sure if this is needed once we add the CLI parameters to the config file. May be useful for automation though.
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.
modify boolean settings in the config to have the values 'yes', 'no' or 'ask'? This will be a bit lower priority and not sure if it's worth it.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
Code Quality
refactor the PyMaker class as its getting a bit messy. Maybe split it into multiple classes with specific responsibilities.
sort out the nested if/else statements in PyMaker.get_sanitized_package_name.
Documentation
Add usage examples and perhaps a walk-through to the documentation. Maybe with a YouTube video?
The below is a list of things I'd like to add to the project in the future, and is kinda a 'work list' for me.
Everything below will be implemented and are in no particular order or importance.
General
Ask for more settings ie homepage, repo, etc. and add them to the generated pyproject.toml file (if the new project is not standalone).
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.
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. Not sure if this is needed once we add the CLI parameters to the config file. May be useful for automation though.
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.
modify boolean settings in the config to have the values 'yes', 'no' or 'ask'? This will be a bit lower priority and not sure if it's worth it.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
Code Quality
refactor the PyMaker class as its getting a bit messy. Maybe split it into multiple classes with specific responsibilities.
sort out the nested if/else statements in PyMaker.get_sanitized_package_name.
Documentation
Add usage examples and perhaps a walk-through to the documentation. Maybe with a YouTube video?
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.5
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.5
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/installation/index.html b/installation/index.html
index a852341c..5fe9be4c 100644
--- a/installation/index.html
+++ b/installation/index.html
@@ -1,4 +1,4 @@
-Installation - Python Project Generation Tool
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.
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:
$ pipinstallpyproject-maker
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.
Last update: August 13, 2023 Created: July 26, 2023
\ No newline at end of file
+License - Python Project Generation Tool
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.
Last update: August 13, 2023 Created: July 26, 2023
\ No newline at end of file
diff --git a/quick-start/index.html b/quick-start/index.html
deleted file mode 100644
index cece7153..00000000
--- a/quick-start/index.html
+++ /dev/null
@@ -1,79 +0,0 @@
-Quick Start - Python Project Generation Tool
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.
Choose a package name and description
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, spaces or dots.
For a stand-alone tool that will not be 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.
For option 1 above, the App will check if the package name is available on PyPI or if it has already been used. In the latter case, you will be asked to choose another name.
Choose to create an MkDocs site or not
If you answer "y" to the question "Use MkDocs for documentation?", then the app will create a new MkDocs site in the docs folder, and will add the mkdocs-material theme to the mkdocs.yml file along with a few other useful plugins and markdown extensions.
Command line options
There are a few command line options that can be used to customise the build
-y or --yes
Accept all defaults and do not ask any questions.
--no-git
This will skip the step of initialising a git repository.
--no-test
This will skip the step of creating a test directory, and will not add the pytest dependency or any related plugins to the pyproject.toml file.
--no-lint
This will skip adding any linting dependencies to the pyproject.toml file, nor will it add any linting configuration options or related tasks.
Run poetry install automatically
You will be asked if you want to run poetry install automatically. This will create a virtual environment and install the dependencies, plus also create a bare MkDocs site and configuration. This is the recommended option.
You will still need to run poetry shell to activate the virtual environment from inside the new project folder.
Start developing
You should now change into the new directory, install dependencies and activate the virtual environment:
$ cd<project-folder>
-$ poetryinstall# if not done automatically already
-$ poetryshell
-
Now, you can start developing
Example run
$ pymakernewsecret-docs
-PyMaker - Generate a Python project skeleton.
-
-Creating a new project at /home/bathroom/secret-docs
-
-Name of the Application? (Secret Docs):
-Package Name? (Use '-' for standalone script) (secret_docs):
-Description of the Application?: Store all the Bigly amount of secret documents
-I have in the bathroom
-
-Author Name? (): Orange Tango
-Author Email? (): bigly@straytan.org
-Application License? [None/Apache2/BSD3/BSD2/GPL2/GPL3/LGPL/MIT/MPL2/CDDL/EPL2] (MIT):
-Use MkDocs for documentation? [y/n] (y):
-
-Creating a New Python app with the below settings :
-
- Description : Store all the Bigly amount of secret documents I have in the
- bathroom
- Package Name : secret_docs
- Author : Orange Tango
- Email : bigly@straytan.org
- License : MIT
- Use Mkdocs : True
- Project Dir : /home/bathroom/secret-docs
- Name : Secret Docs
- Standalone : False
-
-Is this correct? [y/n] (y):
-
---> Creating project folder ... Done
-
-Should I Run 'poetry install' now? [y/n] (y):
-Creating virtualenv secret-docs in /home/bathroom/secret-docs/.venv
-Updating dependencies
-Resolving dependencies... (11.6s)
-
-Package operations: 103 installs, 1 update, 0 removals
-
- • Installing lazy-object-proxy (1.9.0)
- • Installing six (1.16.0)
-
- <snippy snip>
-
- • Installing pytest-xdist (3.3.1)
- • Installing tryceratops (2.3.2)
-
-Writing lock file
-
-Installing the current project: secret-docs (0.1.0)
-
---> Creating MkDocs project
-INFO - Writing config file: ./mkdocs.yml
-INFO - Writing initial docs: ./docs/index.md
-
---> Creating Git repository ... Done
-
---> Project created successfully.
-
-Next steps:
-
-1. Change to the project directory:
-2. Install the dependencies if not done (creates a virtual environment):
- 'poetry install'
-3. Activate the virtual environment:
- 'poetry shell'
-4. Run the application:
- 'secret-docs'
-5. Code!
-
-See the README.md file for more information.
-
Last update: August 17, 2023 Created: July 26, 2023
\ No newline at end of file
diff --git a/search/search_index.json b/search/search_index.json
index 952f5d85..337c578d 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 not standalone).
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.
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. Not sure if this is needed once we add the CLI parameters to the config file. May be useful for automation though.
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.
modify boolean settings in the config to have the values 'yes', 'no' or 'ask'? This will be a bit lower priority and not sure if it's worth it.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
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, spaces or dots.
For a stand-alone tool that will not be 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.
For option 1 above, the App will check if the package name is available on PyPI or if it has already been used. In the latter case, you will be asked to choose another name.
"},{"location":"quick-start/#choose-to-create-an-mkdocs-site-or-not","title":"Choose to create an MkDocs site or not","text":"
If you answer \"y\" to the question \"Use MkDocs for documentation?\", then the app will create a new MkDocs site in the docs folder, and will add the mkdocs-material theme to the mkdocs.yml file along with a few other useful plugins and markdown extensions.
"},{"location":"quick-start/#command-line-options","title":"Command line options","text":"
There are a few command line options that can be used to customise the build
"},{"location":"quick-start/#-y-or-yes","title":"-y or --yes","text":"
You will be asked if you want to run poetry install automatically. This will create a virtual environment and install the dependencies, plus also create a bare MkDocs site and configuration. This is the recommended option.
You will still need to run poetry shell to activate the virtual environment from inside the new project folder.
$ pymaker new secret-docs\nPyMaker - Generate a Python project skeleton.\n\nCreating a new project at /home/bathroom/secret-docs\n\nName of the Application? (Secret Docs):\nPackage Name? (Use '-' for standalone script) (secret_docs):\nDescription of the Application?: Store all the Bigly amount of secret documents\nI have in the bathroom\n\nAuthor Name? (): Orange Tango\nAuthor Email? (): bigly@straytan.org\nApplication License? [None/Apache2/BSD3/BSD2/GPL2/GPL3/LGPL/MIT/MPL2/CDDL/EPL2] (MIT):\nUse MkDocs for documentation? [y/n] (y):\n\nCreating a New Python app with the below settings :\n\n Description : Store all the Bigly amount of secret documents I have in the\n bathroom\n Package Name : secret_docs\n Author : Orange Tango\n Email : bigly@straytan.org\n License : MIT\n Use Mkdocs : True\n Project Dir : /home/bathroom/secret-docs\n Name : Secret Docs\n Standalone : False\n\nIs this correct? [y/n] (y):\n\n--> Creating project folder ... Done\n\nShould I Run 'poetry install' now? [y/n] (y):\nCreating virtualenv secret-docs in /home/bathroom/secret-docs/.venv\nUpdating dependencies\nResolving dependencies... (11.6s)\n\nPackage operations: 103 installs, 1 update, 0 removals\n\n \u2022 Installing lazy-object-proxy (1.9.0)\n \u2022 Installing six (1.16.0)\n\n <snippy snip>\n\n \u2022 Installing pytest-xdist (3.3.1)\n \u2022 Installing tryceratops (2.3.2)\n\nWriting lock file\n\nInstalling the current project: secret-docs (0.1.0)\n\n--> Creating MkDocs project\nINFO - Writing config file: ./mkdocs.yml\nINFO - Writing initial docs: ./docs/index.md\n\n--> Creating Git repository ... Done\n\n--> Project created successfully.\n\nNext steps:\n\n1. Change to the project directory:\n2. Install the dependencies if not done (creates a virtual environment):\n 'poetry install'\n3. Activate the virtual environment:\n 'poetry shell'\n4. Run the application:\n 'secret-docs'\n5. 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 (or custom) 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 author_name, author_email and default_license. 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 not standalone).
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.
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. Not sure if this is needed once we add the CLI parameters to the config file. May be useful for automation though.
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.
modify boolean settings in the config to have the values 'yes', 'no' or 'ask'? This will be a bit lower priority and not sure if it's worth it.
include an optional vscode settings file in the generated project, optimized for python projects. This could include recommended extensions.
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.
The task-runner Poe the Poet is installed in the new project as a development dependency which allows us to run simple tasks (similar to npm scripts).
These are run (from within the virtual environment) using the poe command and then the script name, for example:
$ poe pre\n
You can define your own, but there are 8 specific ones provided with the script.
pre : Run pre-commit run --all-files
pylint: Run Pylint on all Python files in the project.
mypy = Run MyPy type-checker on all Python files in the project.
flake8 = Run Flake8 linter on all Python files in the project.
black = Run Black code formatter on all Python files in the project.
try = Run Tryceratops linter on all Python files in the project.
markdown = Run pymarkdown on all markdown files in the project.
lint = Runs black, flake8, mypy, try, and pylint in sequence
These are defined in the pyproject.toml file in the [tool.poe.tasks] section. Take a look at this file if you want to add or remove tasks.
"},{"location":"usage/","title":"Using PyMaker","text":""},{"location":"usage/#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":"usage/#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, spaces or dots.
For a stand-alone tool that will not be 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.
For option 1 above, the App will check if the package name is available on PyPI or if it has already been used. In the latter case, you will be asked to choose another name.
"},{"location":"usage/#choose-to-create-an-mkdocs-site-or-not","title":"Choose to create an MkDocs site or not","text":"
If you answer \"y\" to the question \"Use MkDocs for documentation?\", then the app will create a new MkDocs site in the docs folder, and will add the mkdocs-material theme to the mkdocs.yml file along with a few other useful plugins and markdown extensions.
"},{"location":"usage/#command-line-options","title":"Command line options","text":"
There are a few command line options that can be used to customise the build. Command line options override any settings in the config file.
For example, if use_git = false is set in the config file, then passing --git on the command line will override this and initialise a Git repository.
"},{"location":"usage/#-y-or-yes","title":"-y or --yes","text":"
Create a test directory and add the pytest dependency plus a few related plugins to the pyproject.toml file. Default is True unless include_testing = false is set in the config file or --no-test is passed on the command line.
Add linting dependencies and configuration to the pyproject.toml file. Default is True unless include_linters = false is set in the config file or --no-lint is passed on the command line.
Add MkDocs and some plugins to the pyproject.toml file. Default is True unless include_mkdocs = false is set in the config file or --no-docs is passed on the command line.
If you choose to run poetry automatically, this will also add a customized mkdocs.yml file and create a new default MkDocs site in the docs folder.
You will be asked if you want to run poetry install automatically. This will create a virtual environment and install the dependencies, plus also create a bare MkDocs site and configuration. This is the recommended option.
You will still need to run poetry shell to activate the virtual environment from inside the new project folder.
$ pymaker new secret-docs\nPyMaker - Generate a Python project skeleton.\n\nCreating a new project at /home/bathroom/secret-docs\n\nName of the Application? (Secret Docs):\nPackage Name? (Use '-' for standalone script) (secret_docs):\nDescription of the Application?: Store all the Bigly amount of secret documents\nI have in the bathroom\n\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 : Store all the Bigly amount of secret documents I have in the\n bathroom\n Package Name : secret_docs\n Author : Orange Tango\n Email : bigly@straytan.org\n License : MIT\n Project Dir : /home/bathroom/secret-docs\n Name : Secret Docs\n Standalone : False\n\nIs this correct? [y/n] (y):\n\n--> Creating project folder ... Done\n\nShould I Run 'poetry install' now? [y/n] (y):\nCreating virtualenv secret-docs in /home/bathroom/secret-docs/.venv\nUpdating dependencies\nResolving dependencies... (11.6s)\n\nPackage operations: 103 installs, 1 update, 0 removals\n\n \u2022 Installing lazy-object-proxy (1.9.0)\n \u2022 Installing six (1.16.0)\n\n <snippy snip>\n\n \u2022 Installing pytest-xdist (3.3.1)\n \u2022 Installing tryceratops (2.3.2)\n\nWriting lock file\n\nInstalling the current project: secret-docs (0.1.0)\n\n--> Creating MkDocs project\nINFO - Writing config file: ./mkdocs.yml\nINFO - Writing initial docs: ./docs/index.md\n\n--> Creating Git repository ... Done\n\n--> Project created successfully.\n\nNext steps:\n\n1. Change to the project directory:\n2. Install the dependencies if not done above (creates a virtual environment):\n $ poetry install\n3. Activate the virtual environment:\n $ poetry shell\n4. Run the application:\n $ secret-docs\n5. 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 (or custom) 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 0747d2f7..63a33099 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -26,12 +26,12 @@
daily
- https://pymaker.seapagan.net/quick-start/
+ https://pymaker.seapagan.net/tasks/2023-08-31daily
- https://pymaker.seapagan.net/tasks/
+ https://pymaker.seapagan.net/usage/2023-08-31daily
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index 2b6ad270..0495767b 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ
diff --git a/tasks/index.html b/tasks/index.html
index 5b698d5d..d1faf324 100644
--- a/tasks/index.html
+++ b/tasks/index.html
@@ -1,2 +1,2 @@
-Task Runner - Python Project Generation Tool
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 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.
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 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.
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.
Last update: August 10, 2023 Created: August 8, 2023
\ No newline at end of file
+Modifying - Python Project Generation Tool
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.
Last update: August 10, 2023 Created: August 8, 2023
\ No newline at end of file
diff --git a/template/replace/index.html b/template/replace/index.html
index db3fce55..fe3c6706 100644
--- a/template/replace/index.html
+++ b/template/replace/index.html
@@ -1,4 +1,4 @@
-Replacing - Python Project Generation Tool
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.
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:
$ pymakertemplatedump
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.
Change the location of the Template folder
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:
$ pymakertemplatereset
Choose to use the Default Template or not
Running the dump command will give you the option to disable the default template completely and ONLY use the exported (or custom) template. You can also do this (or revert back to the default template) by running the following command:
$ pymakertemplatedefault<enable|disable>
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.
Last update: August 17, 2023 Created: August 8, 2023
\ No newline at end of file
diff --git a/usage/index.html b/usage/index.html
new file mode 100644
index 00000000..1ff30a27
--- /dev/null
+++ b/usage/index.html
@@ -0,0 +1,77 @@
+Usage - Python Project Generation Tool
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.
Choose a package name and description
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, spaces or dots.
For a stand-alone tool that will not be 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.
For option 1 above, the App will check if the package name is available on PyPI or if it has already been used. In the latter case, you will be asked to choose another name.
Choose to create an MkDocs site or not
If you answer "y" to the question "Use MkDocs for documentation?", then the app will create a new MkDocs site in the docs folder, and will add the mkdocs-material theme to the mkdocs.yml file along with a few other useful plugins and markdown extensions.
Command line options
There are a few command line options that can be used to customise the build. Command line options override any settings in the config file.
For example, if use_git = false is set in the config file, then passing --git on the command line will override this and initialise a Git repository.
-y or --yes
Accept all defaults and do not ask any questions.
--git / --no-git
Initialise a Git repository. Default is True unless use_git = false is set in the config file or --no-git is passed on the command line.
--test / --no-test
Create a test directory and add the pytest dependency plus a few related plugins to the pyproject.toml file. Default is True unless include_testing = false is set in the config file or --no-test is passed on the command line.
--lint / --no-lint
Add linting dependencies and configuration to the pyproject.toml file. Default is True unless include_linters = false is set in the config file or --no-lint is passed on the command line.
--docs / --no-docs
Add MkDocs and some plugins to the pyproject.toml file. Default is True unless include_mkdocs = false is set in the config file or --no-docs is passed on the command line.
If you choose to run poetry automatically, this will also add a customized mkdocs.yml file and create a new default MkDocs site in the docs folder.
Run poetry install automatically
You will be asked if you want to run poetry install automatically. This will create a virtual environment and install the dependencies, plus also create a bare MkDocs site and configuration. This is the recommended option.
You will still need to run poetry shell to activate the virtual environment from inside the new project folder.
Start developing
You should now change into the new directory, install dependencies and activate the virtual environment:
$ cd<project-folder>
+$ poetryinstall# if not done automatically already
+$ poetryshell
+
Now, you can start developing
Example run
$ pymakernewsecret-docs
+PyMaker - Generate a Python project skeleton.
+
+Creating a new project at /home/bathroom/secret-docs
+
+Name of the Application? (Secret Docs):
+Package Name? (Use '-' for standalone script) (secret_docs):
+Description of the Application?: Store all the Bigly amount of secret documents
+I have in the bathroom
+
+Author Name? (): Orange Tango
+Author Email? (): bigly@spraytan.org
+Application License? [None/Apache2/BSD3/BSD2/GPL2/GPL3/LGPL/MIT/MPL2/CDDL/EPL2] (MIT):
+
+Creating a New Python app with the below settings :
+
+ Description : Store all the Bigly amount of secret documents I have in the
+ bathroom
+ Package Name : secret_docs
+ Author : Orange Tango
+ Email : bigly@straytan.org
+ License : MIT
+ Project Dir : /home/bathroom/secret-docs
+ Name : Secret Docs
+ Standalone : False
+
+Is this correct? [y/n] (y):
+
+--> Creating project folder ... Done
+
+Should I Run 'poetry install' now? [y/n] (y):
+Creating virtualenv secret-docs in /home/bathroom/secret-docs/.venv
+Updating dependencies
+Resolving dependencies... (11.6s)
+
+Package operations: 103 installs, 1 update, 0 removals
+
+ • Installing lazy-object-proxy (1.9.0)
+ • Installing six (1.16.0)
+
+ <snippy snip>
+
+ • Installing pytest-xdist (3.3.1)
+ • Installing tryceratops (2.3.2)
+
+Writing lock file
+
+Installing the current project: secret-docs (0.1.0)
+
+--> Creating MkDocs project
+INFO - Writing config file: ./mkdocs.yml
+INFO - Writing initial docs: ./docs/index.md
+
+--> Creating Git repository ... Done
+
+--> Project created successfully.
+
+Next steps:
+
+1. Change to the project directory:
+2. Install the dependencies if not done above (creates a virtual environment):
+ $ poetryinstall
+3. Activate the virtual environment:
+ $ poetryshell
+4. Run the application:
+ $ secret-docs
+5. Code!
+
+See the README.md file for more information.
+
Last update: August 31, 2023 Created: July 26, 2023