Python application template for personal use
Project description
pyprefab
Creates a new Python package from an opinioned set of templates.
Installing pyprefab
To install this package via pip:
pip install pyprefab
Generating boilerplate for a new Python package
Use pyprefab's command line interface to create a new Python package:
➜ pyprefab --help
Usage: pyprefab [OPTIONS] NAME
Generate a new Python project from templates.
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * name TEXT Name of the project [default: None] [required] │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * --author TEXT Project author [default: None] [required] │
│ --description TEXT Project description │
│ --directory PATH Directory that will contain the project (defaults to current directory) [default: None] │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
For example:
pyprefab-create project_test --author lassie --description "this is a pet project for lassie" --directory ~/code/lassie
Setting up the package's dev environment
Follow the steps below to create a development environment for the package.
These directions use uv, but you can use your preferred tooling.
-
cdto the directory of the new Python package -
Create a virtual environment seeded with pip:
uv venv --seed
-
Install dependencies + project as editable module
uv sync
-
Test the project setupt:
uv run <your_package_name>
You should see a log output stating that the project has been set up correctly.
For example:
2025-01-13 02:29:08 [info ] project_test successfully created.You can also run the tests:
uv run pytest
Note:
uv runruns commands in the virtual environment created by uv (see step 2). Alternately, you can activate the virtual environment the old-fashioned way and then run commands without theuv runprefix:source .venv/bin/activate <your package name> pytest
Optional:
-
Add the new project to a git repository:
git init git add . git commit -am "Initial commit"
-
If you use pre-commit, pyprefab's boilerplate includes a baseline
pre-commit-config.yamlconfiguration. To use it, make sure the project has been added to git (see above) and run the following command to install the pre-commit git hook scripts:pre-commit install
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyprefab-0.3.2.tar.gz.
File metadata
- Download URL: pyprefab-0.3.2.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69cc65bd5f1c104d34b970aa7e1fb6f62f9b37d85ee0363441e848d79cfd250b
|
|
| MD5 |
e5667565a5b2d306efc8920f48a0fed1
|
|
| BLAKE2b-256 |
626afec9c05aa651f73fb88ff8190fe859e32fd5b9ddfad6eb35fe70ccf7e137
|
Provenance
The following attestation bundles were made for pyprefab-0.3.2.tar.gz:
Publisher:
publish-pypi.yml on bsweger/pyprefab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprefab-0.3.2.tar.gz -
Subject digest:
69cc65bd5f1c104d34b970aa7e1fb6f62f9b37d85ee0363441e848d79cfd250b - Sigstore transparency entry: 162034787
- Sigstore integration time:
-
Permalink:
bsweger/pyprefab@472ef356b3778b7473ffffd735a7049aaa4dfc3c -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/bsweger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@472ef356b3778b7473ffffd735a7049aaa4dfc3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyprefab-0.3.2-py3-none-any.whl.
File metadata
- Download URL: pyprefab-0.3.2-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb87a8884d6d5245f73b7f59ea0bcb4ec738f81bfaaf99149f805b80fac1cba7
|
|
| MD5 |
8be4cd168b3c57f63bb27352e99630ed
|
|
| BLAKE2b-256 |
0a1e303a9a8cbec7a5686b767b293ffb9a2e7e4f7af5b192f35eef787be8e5ab
|
Provenance
The following attestation bundles were made for pyprefab-0.3.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on bsweger/pyprefab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprefab-0.3.2-py3-none-any.whl -
Subject digest:
eb87a8884d6d5245f73b7f59ea0bcb4ec738f81bfaaf99149f805b80fac1cba7 - Sigstore transparency entry: 162034788
- Sigstore integration time:
-
Permalink:
bsweger/pyprefab@472ef356b3778b7473ffffd735a7049aaa4dfc3c -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/bsweger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@472ef356b3778b7473ffffd735a7049aaa4dfc3c -
Trigger Event:
push
-
Statement type: