Skip to main content

Sets up a new (python) project using a template

Project description

acme-project-create

Sets up a new (python) project using a template.

Uses a three-step process:

  1. Template files are copied to the -target-dir location from a --template-dir-path directory. Default template for a python project is included in the package.
  2. Directory names in the template following the pattern {{<variable>}} are substituted with value provided by the user.
  3. Filenames in the template directory that end with j2template (e.g. pyproject.toml.j2template) are assumed to be Jinja2 templates and a file is generated in the target location with variable substitutions provided by the user i.e. pyproject.toml.

And that's it.

Note: to provide all values to compile the template the template dir needs to contain a template_manifest.py file that must implement a function:

def configure_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser

which takes an existing instance of ArgumentParser, adds arguments specific to the template and returns the parser object.

Default template

The default template makes several notable choices:

  • Uses venv for virtual environments and .venv dir to store built environment (and uv to build it)
  • Uses .env file for setting up environment variables
  • Uses setuptools for packaging
  • Uses pytest for testing
  • Uses mkdocs for documentation

Problem

Setting up all files to create a new project is time consuming and involves lots of small technical choices.

Why use this project?

You are probably better off using Cookiecutter

Example usage

apc -target-dir . -project-name hello-world -desc "Say hello to the world" -package-name hello_world -command hello -owner-email hello@example.com

Project template

This project has been setup with acme-project-create, a python code template library.

Required setup post use

  • Enable GitHub Pages to be published via GitHub Actions
  • Create release environment for GitHub Actions
  • Setup auth to PyPI for the GitHub Action implemented in release.yml: Link & uv publish doc
  • Once you create the python environment for the first time add the uv.lock file that will be created in project directory to the source control and update it each time environment is rebuilt

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

acme_project_create-0.0.6.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

acme_project_create-0.0.6-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file acme_project_create-0.0.6.tar.gz.

File metadata

  • Download URL: acme_project_create-0.0.6.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.18

File hashes

Hashes for acme_project_create-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f02e800c21996ee7306c43f9e5937105328765f9536b8b559ea1152e63ced646
MD5 44f78e163ae0bc119de326e07ecb6399
BLAKE2b-256 15b9f56a5320b39f6a53989ea453b19335c51ea848e39b3a9e862492ed973f3a

See more details on using hashes here.

File details

Details for the file acme_project_create-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for acme_project_create-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 36d18e7425d66a2e12ab3e868a2f3a881e72418049fd46ad2d200236afb54115
MD5 2f22476c468f6d748257c06fe14a3ea6
BLAKE2b-256 68372ee3789a0dd8fac068a4552224d65fd8a286053176e0e615723d7012f010

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