Skip to main content

Spawn Python projects from templates.

Project description

pj-py

Spawn and ship Python projects from templates.

pip install pj-py
pj-py init my-lib   # create
# ... code, commit, push ...
pj-py ship           # release

Commands

init — create a project

pj-py init my-lib -d "Does one thing well"

Spawns a new GitHub repo from 1iis/py (the reference Python template), clones it locally, renames my_package to your project name, installs dependencies, and makes the initial commit.

from pj_py import init

p = init("my-lib")
# → Project(owner="1iis", repo="my-lib", path=Path("my-lib"))
Param Default Description
name (required) Repo name and local directory
desc "" Short project description
template "py" Alias → 1iis/py. Full owner/repo also accepted
org "1iis" GitHub owner for the new repo
private True Whether the repo is private
path cwd Parent directory for the clone
token $GITHUB_TOKEN GitHub PAT

ship — release a new version

pj-py ship "### Added\n\n- Feature X"
pj-py ship                    # auto-generates boilerplate

Non-interactive, one-call release: bumps the version via fastship, writes the changelog entry, commits and pushes, creates a GitHub release, and uploads to PyPI.

from pj_py import ship

v = ship()                     # patch bump
v = ship("minor")              # minor bump
v = ship("major")              # major bump
# → "0.0.3"
Param Default Description
msg "" Changelog entry. Empty → boilerplate
bump "patch" Version part to bump
path cwd Project root
token $GITHUB_TOKEN / $FASTSHIP_TOKEN For GitHub releases (optional, falls back to no GH release)

Requires .pypirc configured for PyPI uploads.

Prerequisites

What you get

my-lib/
├── src/
│   └── my_lib/          # renamed from my_package
│       ├── __init__.py   # version + main entry point
│       ├── __main__.py   # python -m support
│       └── py.typed     # typed marker
├── tests/
│   └── test_main.py     # smoke test
├── pyproject.toml        # hatchling, ruff, fastship
├── .python-version      # 3.12
├── CHANGELOG.md         # fastship-ready
├── .github/workflows/ci.yml
└── LICENSE              # Apache 2.0

Architecture

1iis/py    — Language template (hatchling, ruff, uv, fastship)
    ↓
pj-py      — init() + ship() from templates
 ↓
pj         — (future) Language-agnostic wrapper

Design

  • Pure library — all UX (colors, progress bars, interactive prompts) lives in a higher-level wrapper
  • Raise, don't print — errors are exceptions (PjPyError, AuthError, ShipError)
  • Blockinginit() and ship() return only when the project is fully ready
  • Single responsibility — knows Python templates and Python packaging. That's it.
  • Lean — delegates to fastship for version bumping and PyPI upload, to ghapi for GitHub API, to uv for dependency management

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pj_py-0.0.4.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pj_py-0.0.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file pj_py-0.0.4.tar.gz.

File metadata

  • Download URL: pj_py-0.0.4.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pj_py-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e456d1061d94f6b9182cb3b9dc1bb6deb2f9a854ca0e732b2ba94cbc58c986c2
MD5 c567e31b3427ad19f00b2b7a3427ab15
BLAKE2b-256 8e1707d8d88eff8bb76a45c0711c87352fdb527c558a01a1f6997a47f3a4d91d

See more details on using hashes here.

File details

Details for the file pj_py-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pj_py-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pj_py-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 43f06f7a3c1abe2ec32742861199f7d484c301fc1709d722dd4b9f3355430b28
MD5 e76cc0af38b925ad4d694973e3c43de5
BLAKE2b-256 d8d0ba93a6a874fc3ba0f81143a1e0c453afd559f1712b414cda4f27f1284f5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page