dev_template is a user-friendly tool for setting up new Python projects. It provides a consistent structure, easy to use features, and cross-platform compatibility. This tool is for those of us that are lazy, simplifying the installation of packages, creation of directories, config files, and virtual environments. Ideal for both beginners and pros.
CC0-1.0 License
The dev_template
tool is designed with simplicity and speed in mind, providing a streamlined approach to setting up new Python projects. Unlike other feature-rich tools, dev_template
focuses on quick development, allowing you to get started without the need to wade through extensive documentation (hopefully).
This tool was created to help enforce better development standards, even for quick tools and hobbyist programs. It offers essential features that facilitate a consistent project structure and dependency management, making it ideal for developers who need a reliable setup process without the overhead of complex configurations.
For those who want a bit more customization, the project's README
provides clear instructions on how to modify templates and configuration settings. Everything you need to know is right there, making it easy to tailor the tool to fit your specific needs. (If you still have/find issues please submit an issue).
With dev_template
, you can start your projects quickly, maintain good development practices, and avoid the hassle of extensive setup processes and documentation crawling.
this tool is for those of us that are lazy
User-Friendly
Interactive Prompts:
Cross-Platform Compatibility:
Project Directory Creation:
src
, tests
) and basic files (README.md
, .gitignore
, requirements.txt
, etc.).setup.py
and pyproject.toml
based on configuration settings.Configuration Management:
Template Copying:
Virtual Environment Management:
Package Management:
requirements.txt
and pyproject.toml
with successfully installed packages and their versions.Error Handling:
Logging:
project
├── project_venv
├── src
│ └── project
│ ├── __init__.py
│ └── main.py
├── tests
│ ├── __init__.py
│ └── test_main.py
├── .gitignore
├── README.md
├── requirements.txt
├── setup.py (creation disabled by default)
└── pyproject.toml (creation enabled by default)
To install the package using pip, run the following command:
pip install dev-template
Once installed, you can start the tool by typing the following command in your terminal:
dev_template
Alternatively, you can run it as a Python module:
python -m dev_template.dev_template
After setting up your project, navigate into the project directory and activate the virtual environment.
For Linux/macOS:
source project_venv/bin/activate
For Windows (Powershell):
.\project_venv\Scripts\Activate.ps1
To deactivate the virtual environment, simply type:
deactivate
git clone https://github.com/http-kennedy/dev_template.git
cd dev_template
python -m venv venv
source venv/bin/activate
git clone https://github.com/http-kennedy/dev_template.git
cd dev_template
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .
pip install .
Once installed, you can start the tool by typing the following command in your terminal:
dev_template
Alternatively, you can run the script directly:
python src/dev_template/dev_template.py
After setting up your project, navigate into the project directory and activate the virtual environment.
For Linux/macOS:
source project_venv/bin/activate
For Windows (Powershell):
.\project_venv\Scripts\Activate.ps1
To deactivate the virtual environment, simply type:
deactivate
The dev_template
tool can be ran with various flags to perform different actions. Here are the available options:
-h
, --help
:
-c
, --config
:
setup.py
and pyproject.toml
files.-d
, --debug
:
~/.config/dev_template/logs
%LOCALAPPDATA%\dev_template\logs
The dev_template
tool offers a configuration mode to customize default settings. You can enter configuration mode by running:
dev_template -c
or
dev_template --config
When in configuration mode you can set the following values:
Default packages to install:
commma delimited
.dev_template
'package_name'=='version'
pandas==2.1.4
Absolute path for default project directory creation:
dev_template
Create setup.py
for new project directories:
setup.py
file in new project directories.No
Create pyproject.toml
for new project directories:
pyproject.toml
file in new project directories.Yes
Configuration File Locations
Linux/macOS:
~/.config/dev_template/config.ini
~/.config/dev_template/templates/
Windows:
%LOCALAPPDATA%\dev_template\config.ini
%LOCALAPPDATA%\dev_template\templates\
typer
package.'package_name'=='version'
pandas==2.1.4
pyproject.toml: The dependencies
section must be present in the pyproject.toml
file. The absence of this section can cause installation issues.
Config Template Directory: Problems may arise if not all expected files are present in the templates directory. Ensure that all necessary template files are included to avoid errors.
config directory
and re-run dev_template
.
~/.config/dev_template
%LOCALAPPDATA%\dev_template