Skip to main content

Cookiecutter utilities for jcook3701's cookiecutter templates.

Project description

Nutri-Matic

Author: Jared Cook
Version: 0.1.2

Overview

Cookiecutter utilities for streamlining development and utilization of Cookiecutter templates.


black-format ruff-lint tests typecheck yaml-lint

Command Examples:

🔧 nutrimatic (add_docs, extract, run, list)

Add Docs:

Description: Add GitHub docs to an existing project using the github-docs-cookiecutter template.

  1. $ nutrimatic add-docs $(target_dir)
    

Extract:

Description: Clone a repo, extract cookiecutter.json, remove Jinja placeholders, save locally.

  1. Run extract command to local cookiecutter repository:
    $ nutrimatic extract ./python3-cookiecutter  
    

    OR

  2. Run extract command to remote github cookiecutter repository:
    $ nutrimatic extract \
     --repo git@github.com:jcook3701/python3-cookiecutter.git \
     --branch develop \
     --output clean_cookiecutter.json  
    
  3. Modify extracted json to meet you new projects requirements.

Run:

Description: Run a cookiecutter template using a pre-supplied JSON configuration file.

$ nutrimatic run $(template) $(config)

List:

Description: List available cookiecutter templates under a namespace.

$ nutrimatic list

⚙️ Config (nm-config)

Description: nutrimatic configuration tools.
Note: These are tools that are used to manage package configuration file.

Sub-commands: (show)

Show:

Description:

$ nm-config show

🔨 Build (nm-build)

Description: Cookiecutter build automation utilities.
Note: These commands are intended to be used within project Makefiles as build tools. Examples will assume for use in Makefile.

Sub-commands: (readme, add-yaml-front-matter)

Readme:

Description: Generates project readme from projects github-docs jekyll project. The intention is keep the readme within ./docs/jekyll as the projects single source of truth.
Note: Replace with real values.

PROJECT_ROOT := $(PWD)
DOCS_DIR := $(PROJECT_ROOT)/docs
JEKYLL_DIR := $(DOCS_DIR)/jekyll
JEKYLL_BUILD := bundle exec jekyll build --quiet
README_GEN_DIR := $(JEKYLL_DIR)/tmp_readme

readme: nm-build readme $(JEKYLL_DIR) ./README.md </span> --tmp-dir $(README_GEN_DIR) --jekyll-cmd '$(JEKYLL_BUILD)'

add-yaml-front-matter:

Description: This adds yaml-front-matter to the head of (md, yml, & yaml) files to help beautify github docs. Intended to be used with github-docs-cookiecutter

$ nm-build add-yaml-front-matter

🍪 Template (nm-templates)

Description: nm-templates tools. Note: github-docs-cookiecutter will either be moved to cc-templates or be added to cc-templates as a submodule. #### Sub-commands: (generate)

Generate:

Description: This is for custom Cookiecutter template (cc-templates) that utilizes ccmeta.toml files to organize projects.
Note: This feature is still in development. (Use at your own risk!!!)
Arguments:

  • repo: Path to the template repository to generate README.md and Makefile
    $ nm-templates generate $(repo)
    

Development Strategy

Note: All Makefile commands are used in ci/cd to ensure that if they pass locally they should also pass once pushed to github.

🐍️ Build environment (.venv)

$ make install  

🔍 Linting (ruff & yaml-lint)

$ make lint-check  
$ make lint-fix  

🎨 Formatting (black)

$ make format-check
$ make format-fix

🧠 Typechecking (mypy)

$ make typecheck  

🧪 Testing (pytest)

$ make test  

🔖 Version Bumping (bumpy-my-version)

$ make bump-version-patch

📦 Building (build)

$ make build

🚀 Publishing (Twine)

$ make pubish

Build Help

$ make help  

🍹Authors Notes:

Their fundamental design flaws are completely hidden by their superficial design flaws.

TODO’s:

  1. cc-templates/ccindex.toml
    • create/update this file using the individual ccmeta.toml files in cc-templates
  2. Finish updating this.readme with command usage.
  3. Readme make readme should end up being a ci/cd process to ensure it is always up to date.
  4. Thinking about adding a ci/cd process for version bumping. To create a git tag.

Future Design Decisions:

  1. I need to decide whether to change all my current Cookiecutter projects to use the prefix cc- and use them as submodules within the cc-templates repository. Or to just move the code directly into the cc-templates repository and use it as a monolithic repo.

Package:

PyPi: (stable)

https://pypi.org/project/nutri-matic/

TestPyPi: (development)

https://test.pypi.org/project/nutri-matic/

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

nutri_matic-0.1.2.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

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

nutri_matic-0.1.2-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file nutri_matic-0.1.2.tar.gz.

File metadata

  • Download URL: nutri_matic-0.1.2.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for nutri_matic-0.1.2.tar.gz
Algorithm Hash digest
SHA256 85f350a38c4b56e0fa49daa984b1bdb32dce6bf5edeb704a47aabba35aa1e037
MD5 d51dc796f046d26c5e4e27e36dfe1eea
BLAKE2b-256 882c334c1c16d154dcc65f37a602ae3496f13d90254a2a19386eecd372aaf7ec

See more details on using hashes here.

File details

Details for the file nutri_matic-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nutri_matic-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for nutri_matic-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88001b79d21403763adb5197725ecc440773786642ce8ece08d7f41c9e9417ac
MD5 2007d391c26e20e747f75ddbeb226bc4
BLAKE2b-256 28bfce2020ecaed131b284342717d005307013e5fe0e112a373d78df5e515b62

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