Metadata-Version: 2.1
Name: ppieces
Version: 0.5.1
Summary: A command-line utility to streamline the setup of new Python projects.
Author-email: Patilla Code <patillacode@gmail.com>
License: MIT
Project-URL: homepage, https://github.com/patillacode/ppieces
Project-URL: repository, https://github.com/patillacode/ppieces
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click==8.1.7
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: pyfiglet==1.0.2
Requires-Dist: pygments==2.17.2
Requires-Dist: rich==13.7.0
Requires-Dist: termcolor==2.4.0
Provides-Extra: test
Requires-Dist: asttokens==2.4.1; extra == "test"
Requires-Dist: build==1.0.3; extra == "test"
Requires-Dist: cfgv==3.4.0; extra == "test"
Requires-Dist: click==8.1.7; extra == "test"
Requires-Dist: colorama==0.4.6; extra == "test"
Requires-Dist: distlib==0.3.8; extra == "test"
Requires-Dist: executing==2.0.1; extra == "test"
Requires-Dist: filelock==3.13.1; extra == "test"
Requires-Dist: icecream==2.1.3; extra == "test"
Requires-Dist: identify==2.5.33; extra == "test"
Requires-Dist: markdown-it-py==3.0.0; extra == "test"
Requires-Dist: mdurl==0.1.2; extra == "test"
Requires-Dist: nodeenv==1.8.0; extra == "test"
Requires-Dist: packaging==23.2; extra == "test"
Requires-Dist: pip-tools==7.3.0; extra == "test"
Requires-Dist: platformdirs==4.2.0; extra == "test"
Requires-Dist: pre-commit==3.6.0; extra == "test"
Requires-Dist: pyfiglet==1.0.2; extra == "test"
Requires-Dist: pygments==2.17.2; extra == "test"
Requires-Dist: pyproject-hooks==1.0.0; extra == "test"
Requires-Dist: pyyaml==6.0.1; extra == "test"
Requires-Dist: rich==13.7.0; extra == "test"
Requires-Dist: six==1.16.0; extra == "test"
Requires-Dist: termcolor==2.4.0; extra == "test"
Requires-Dist: virtualenv==20.25.0; extra == "test"
Requires-Dist: wheel==0.42.0; extra == "test"
Requires-Dist: asttokens==2.4.1; extra == "test"
Requires-Dist: build==1.0.3; extra == "test"
Requires-Dist: cfgv==3.4.0; extra == "test"
Requires-Dist: click==8.1.7; extra == "test"
Requires-Dist: colorama==0.4.6; extra == "test"
Requires-Dist: coverage==7.4.1; extra == "test"
Requires-Dist: distlib==0.3.8; extra == "test"
Requires-Dist: executing==2.0.1; extra == "test"
Requires-Dist: filelock==3.13.1; extra == "test"
Requires-Dist: icecream==2.1.3; extra == "test"
Requires-Dist: identify==2.5.33; extra == "test"
Requires-Dist: iniconfig==2.0.0; extra == "test"
Requires-Dist: markdown-it-py==3.0.0; extra == "test"
Requires-Dist: mdurl==0.1.2; extra == "test"
Requires-Dist: nodeenv==1.8.0; extra == "test"
Requires-Dist: packaging==23.2; extra == "test"
Requires-Dist: pip-tools==7.3.0; extra == "test"
Requires-Dist: platformdirs==4.2.0; extra == "test"
Requires-Dist: pluggy==1.4.0; extra == "test"
Requires-Dist: pre-commit==3.6.0; extra == "test"
Requires-Dist: pyfiglet==1.0.2; extra == "test"
Requires-Dist: pygments==2.17.2; extra == "test"
Requires-Dist: pyproject-hooks==1.0.0; extra == "test"
Requires-Dist: pytest==8.0.0; extra == "test"
Requires-Dist: pytest-click==1.1.0; extra == "test"
Requires-Dist: pytest-mock==3.12.0; extra == "test"
Requires-Dist: pyyaml==6.0.1; extra == "test"
Requires-Dist: rich==13.7.0; extra == "test"
Requires-Dist: six==1.16.0; extra == "test"
Requires-Dist: termcolor==2.4.0; extra == "test"
Requires-Dist: virtualenv==20.25.0; extra == "test"
Requires-Dist: wheel==0.42.0; extra == "test"

| Latest Version | Downloads | Tests |
|----------------|-----------|-------|
[![PyPI version](https://badge.fury.io/py/ppieces.svg)](https://badge.fury.io/py/ppieces)|[![Downloads](https://pepy.tech/badge/ppieces)](https://pepy.tech/project/ppieces)|[![cov](https://github.com/patillacode/ppieces/blob/main/coverage.svg)](https://github.com/patillacode/ppieces/actions)


# ppieces


### What?

Python Project Creator Script -> PPCS -> PythonPieCeS -> ppieces

`ppieces` is a command-line utility designed to streamline the setup of new Python projects.
It automates various tasks such as creating project directories, initializing git repositories, setting up virtual environments, handling requirements (with or without pip-tools) and installing pre-commit hooks.


### Why?

I tend to always have a python project or two on the go, usually for my own benefit, little scripts to make my day to day easier/faster/automated or just learning new things or experimenting with ideas.

Because of that I found myself repeating the same steps over and over again when setting up new Python projects. *Same song & dance*.

I wanted a way to automate the setup for new projects, so I created `ppieces`.


### Installation

#### Plug & Play:
```bash
# Install via pipx, recommended since you will most likely want to use this tool globally.
pipx install ppieces

# Install via pip, if you prefer to use a virtual environment.
pip install ppieces
```

#### Install for development:

Clone the repository:
```bash
git clone https://github.com/patillacode/ppieces.git
cd ppieces
```

Install the dependencies and the package:
```bash
make install

# or manually:

python -m venv venv
source venv/bin/activate
pip install -e .
```

#### System Requirements

Before using `ppieces`, ensure you have the following installed:

- Python >= `3.10`

Optional:
- `pre-commit` (can be installed via `pipx` or `Homebrew` - see [here](https://pre-commit.com/#install) for more details)
- `autoenv` (optional for auto-activation of virtual environments - see [here](https://github.com/hyperupcall/autoenv?tab=readme-ov-file) for more details)


### Usage

`ppieces` can be used in an interactive mode (by default) or with command-line options for scripting:

Interactive mode will ask you a series of questions to configure your new project.
```bash
$ ppieces
```

https://github.com/patillacode/ppieces/assets/10074977/0a4b4dda-4809-4248-8215-7d4fb0765546


For scripting, use the following options:
```bash
$ ppieces --help

Usage: ppieces [OPTIONS]

Options:
  -ni, --non-interactive     Run the script in non-interactive mode.
  -f, --project-folder PATH  The path to your projects folder.
  -n, --project-name TEXT    The name of the new project.
  -v, --virtual-env          Create a virtual environment.
  -g, --git                  Initialize a git repository (with .gitignore and README files)
  -c, --pre-commit           Add pre-commit configuration.
  -r, --ruff                 Add a ruff configuration file.
  -a, --autoenv              Set up autoenv.
  -m, --makefile             Add a default Makefile.
  -p, --pip-tools            Add a default pip-tools setups.
  -u, --username TEXT        GitHub username to use in README (default: $USER)
  --version                  Show the version of ppieces.
  --help                     Show this message and exit.
```

Example usage:
```bash
ppieces -ni -p /home/user/projects -n my_new_project -u my_github_username -mcragvp
```


### Features

- **Project Directory Creation**: Automatically creates a new directory for your project.
- **Git Repository Initialization**: Initializes a new git repository in the project directory.
- **Virtual Environment**: Sets up a Python virtual environment within the project.
- **autoenv Setup**: Configures autoenv to automatically activate the virtual environment when entering the project directory.
- **ruff Configuration**: Adds a default `.ruff.toml` configuration file for the Ruff static analysis tool.
- **Makefile**: Adds a default `Makefile` for common tasks like installing or running the project.
- **pip-Tools**: Adds a default `requirements` folder with all the `.in` default requirements files and generates `requirements.txt` file for managing project dependencies with pip-tools.
- **pre-commit Hooks**: Installs pre-commit hooks to ensure code quality and standards are maintained.
- **Template Files**: Provides template files like `.gitignore`, `requirements.txt`, and `.pre-commit-config.yaml` to get started quickly.


### Acknowledgments

This project makes use of several open-source packages including, but not limited to:
- [`autoenv`](https://github.com/hyperupcall/autoenv?tab=readme-ov-file)
- [`bamp`](https://github.com/inirudebwoy/bamp)
- [`hatch`](https://hatch.pypa.io/latest/)
- [`icecream`](https://github.com/gruns/icecream)
- [`pip-tools`](https://github.com/jazzband/pip-tools)
- [`pre-commit`](https://pre-commit.com/)
- [`pyfiglet`](https://github.com/pwaller/pyfiglet)
- [`rich`](https://github.com/Textualize/rich)
- [`termcolor`](https://github.com/termcolor/termcolor)

A big thank you to the maintainers of all these projects and the python and open-source communities in general.


### Contributing

Contributions are welcome!

If you have a feature request, bug report, or a pull request, please open an issue or submit a PR.


### License

`ppieces` is released under the MIT License. See the LICENSE file for more details.

