Skip to main content

PyHatchery: A Python project scaffolding tool.

Project description

PyHatchery 🐍🥚

License: MIT

main develop
Main Tests Main Publish Develop Tests Develop Publish
cute snake hatching

Hatch new Python projects instantly!

PyHatchery is a command-line tool that generates a standardized, best-practice project structure with modern tooling like uv for dependency management, and ruff and pylint for linting/formatting, all pre-configured.

Stop wrestling with boilerplate and start coding faster. Inspired by the efficiency of hatchling, PyHatchery helps you seamlessly start new Python projects with a well-organized structure in minutes!

Key Goals & Features

  • 🚀 Rapid Project Scaffolding: Generate a complete project skeleton with a single command.
  • 🛠️ Modern Tooling Pre-configured: Comes with:
    • uv for lightning-fast dependency management and virtual environments.
    • ruff and pylint configurations for immediate code quality checks.
    • (hatchling for building the package).
  • ⚙️ Best Practices Baked In: Standardized directory layout, basic testing setup, .gitignore, and essential configuration files.
  • 📝 Automated Personalization: Automatically customizes project name, author details, and license information.
  • Standardized: Ensures consistency across your Python projects, making them easier to navigate and maintain.
  • 🌱 Foundation for Growth: Provides a solid, clean base for projects of any scale.

Installation

You can install PyHatchery directly from PyPI:

pip install pyhatchery

How it Works: The PyHatchery Wizard

Using PyHatchery is designed to be simple and intuitive. Open your terminal and run:

pyhatchery new your_project_name

alt text

PyHatchery will then typically:

  1. Ask for Project Details: Prompt you for information such as:
    • Author Name (e.g., "Your Name")
    • Author Email (e.g., "your.email@example.com")
    • Project Description (a short summary of your project)
  2. Clone Template: Internally, it clones its built-in, best-practice project template.
  3. Personalize Files: It intelligently updates key files (like pyproject.toml, LICENSE, README.md_template) with your provided project name, author details, and the current copyright year.
  4. Finalize Structure: Sets up a fresh project structure in a new directory named your_project_name.
  5. Clean Up: Removes the template's .git history, allowing you to initialize your own version control.

NOTE: pyhatchery will also check if the project name you have chosen is already taken on PyPi. It will then present you with a choice:

alt text

Once completed, navigate to your new project:

cd your_project_name

Your new Python project is ready. You can now initialize your own Git repository if you wish

git init
git add .
git commit -m "Initial project structure from PyHatchery"

Start developing!

Post-Setup Recommendations

After your project is hatched, you might want to:

  • Review the generated README.md in your new project and fill in your project's specific details.
  • Begin outlining your project's purpose and vision in a project brief document.
  • To enable auto-publishing of your package to TestPyPI and PyPI (on pushes to develop and main, respectively) via the included GitHub Actions workflow:
    1. In your new project, set ENABLE_PUBLISHING to true in .github/workflows/publish.yml.
    2. Add the necessary PYPI_API_TOKEN (for PyPI) and TEST_PYPI_API_TOKEN (for TestPyPI) as GitHub Actions secrets to your new repository.
  • To enforce Git PR discipline in your new repository, consider creating Git branch protection rules or rulesets as outlined in PyHatchery's docs/contributing.md (adapt as needed for your project).

Happy hacking!!!

Understanding the Project Structure (Optional)

PyHatchery creates projects based on its embedded template structure. This includes a standard layout for Python projects, such as:

  • src/your_project_name/: The main package directory.
  • tests/: For your unit and integration tests.
  • docs/: For project documentation.
  • pyproject.toml: Pre-configured for uv, hatchling, ruff, pylint, and your project metadata.
  • LICENSE: Typically an MIT License, personalized with your details.
  • .gitignore: A standard Python .gitignore file.
  • GitHub Actions workflows for testing and publishing.
  • .pylintrc and .ruff.toml settings files.

This structure is designed to be a comprehensive starting point.

Contributing

Feedback on PyHatchery itself is highly welcome! Please open an issue on the PyHatchery GitHub repository to share your thoughts, suggestions, or report bugs.

Read the contribution document here and please follow the guidelines for this repository.

License

PyHatchery is licensed under the MIT License. Generated projects will also include a personalized MIT License by default.

Copyright (c) 2025, Kayvan Sylvan


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

pyhatchery-0.7.1.tar.gz (522.3 kB view details)

Uploaded Source

Built Distribution

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

pyhatchery-0.7.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file pyhatchery-0.7.1.tar.gz.

File metadata

  • Download URL: pyhatchery-0.7.1.tar.gz
  • Upload date:
  • Size: 522.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for pyhatchery-0.7.1.tar.gz
Algorithm Hash digest
SHA256 5f5534b7fba92e165bcabfbb0356f60b73da8a9afc7ebf34f52997327ec74ca3
MD5 f668fb53a24914504553b66ee6e2bdff
BLAKE2b-256 5ed1c492a6317f5d26a88915803285229288cf028b35a66b619eb09a74ca9d0c

See more details on using hashes here.

File details

Details for the file pyhatchery-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: pyhatchery-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for pyhatchery-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9152842eee156bac74c1763841a0699b269e9ef59b65dd0fb61b80f296b1c1f
MD5 04188035ccbd334e5ee0121945b55373
BLAKE2b-256 b6d7c956f6287dfca4e05f5f0764c303d028bc8fb2d5e35e064dfdf406936bff

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