Skip to main content

Use `cookiecutter` with existing code and git integration

Project description

cookiebaker - Use cookiecutter with existing code and git integration

cookiebaker is a simple wrapper for cookiecutter which attempts to:

  • Set full_name and email in the cookiecutter config from your Git config
  • Use existing folders or files as the initial project source
  • Initialize a Git repository in the newly created project folder
  • Commit the initial set of files to the Git repository

src layout is assumed, and the cookiecutter is expected not to contain a src/ folder. An empty src/ folder will be created in the template, and files and folders will be copied under that directory.

Because of the high probability that the project shares a name with a source folder, the cookiecutter is assembled in a local temporary directory first. Upon successful assembly, the original source is removed, the new project folder is moved out to the current level, and the temporary directory is removed.

A simple compatible cookiecutter is also included, and will be used by default. It assumes you are the sole author of the project, so it does not attempt to provide a code of conduct, contributor license agreement, guidelines for contributors etc. It does, however, attempt to adapt the project contents to your choice of license, and assumes the project will be a pure Python project following modern packaging standards.

Installation

With pipx (recommended)

If you already have cookiecutter installed via pipx:

pipx inject --include-apps cookiecutter cookiebaker

This will add cookiebaker to your existing cookiecutter installation, so you don't need a second copy of cookiecutter as a dependency.

If you don't have cookiecutter, but you have pipx:

pipx install --include-deps cookiebaker

This will download and install cookiecutter as a dependency of cookiebaker, and make its command-line tools available as well.

If you don't have pipx, get it first.

With pip

If you don't want to use pipx, you can install cookiebaker with pip instead. Please keep in mind that cookiebaker is an application, and does not provide any meaningful API or library. No particular guidance is provided here, as users who have a good reason to do it this way should know what they're doing already.

Documentation

Run the program with new-project, specifying a name for the new project and then the files and/or folders to use as the initial project source.

For example, from a single file:

new-project "My Awesome Project" example.py

The new project will be created in my_awesome_project, and example.py will be moved directly under src.

To choose a license for the project, specify its SPDX id when prompted.

Currently these licenses are supported:

  • the MIT license (MIT)
  • The Unlicense (Unlicense)

Copyright © 2024 Karl Knechtel

This project is open source software, distributed under the terms of The Unlicense. Please see LICENSE.txt for details.

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

cookiebaker-0.2.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

cookiebaker-0.2.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file cookiebaker-0.2.1.tar.gz.

File metadata

  • Download URL: cookiebaker-0.2.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for cookiebaker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d02413d8de5c794d67b07cd179d2d99bfe1bc1f3d9e37bcc89d04b4e984e869c
MD5 a177123f33260affb05f388ff4562a78
BLAKE2b-256 e78dbce60386bc88637931738b28618444ef84debcefed2281f80e14f4faa979

See more details on using hashes here.

File details

Details for the file cookiebaker-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: cookiebaker-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for cookiebaker-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5d04dc13616f687145897c74bc4118567a9c8c94b9c2615c393a7193802e6ca
MD5 6a2429080505f887f14d8cafad0496f9
BLAKE2b-256 3eb82e6836ff39565af41b0d932369495029874f4141483c6118b86702d825bf

See more details on using hashes here.

Supported by

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