Skip to main content
Latest Version Downloads Tests
PyPI version Downloads cov

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:

# 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:

git clone https://github.com/patillacode/ppieces.git
cd ppieces

Install the dependencies and the package:

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 for more details)
  • autoenv (optional for auto-activation of virtual environments - see here 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.

$ ppieces

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

For scripting, use the following options:

$ 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:

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:

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.

Release files for ppieces 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ppieces 0.5.2
File Size Uploaded
ppieces-0.5.2.tar.gz 23.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ppieces 0.5.2
File Interpreter ABI Platform
ppieces-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / ppieces-0.5.2.tar.gz

Download URL ppieces-0.5.2.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c7df9d4997dd147a7952443589c77cb70d54dea1195a2c76dd346f61448b2b81
BLAKE2b-256 checksum
How to use checksums
a8d17bc7fa47ea3cc1e68d9f03d7b53e9f42368dec3226f437cfed6bc7659d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.2

Release files / ppieces-0.5.2-py3-none-any.whl

Download URL ppieces-0.5.2-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86001623d2ad036805c02e10fe9b221362069c51e12d5e374f46c768ff737f44
BLAKE2b-256 checksum
How to use checksums
9803a978a09bc6373830648afbba311bd1581be93dd0e906da077fe476bb04ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.2

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.8

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page