Skip to main content

Nutri-Matic

Author: Jared Cook
Version: 0.1.15

Overview

Cookiecutter utilities for streamlining development and utilization of Cookiecutter templates.


black-format dependency-check ruff-lint security-audit spellcheck tests typecheck yaml-lint


📦 Package Information:

GitHub: Source Code
GitDocs: Api Documentation

📦 Package Installation:

PyPi: (stable)

$ python -m pip install nutri-matic

TestPyPi: (development)

$ python -m pip install -i https://test.pypi.org/simple/ nutri-matic

Command Examples:

🔧 nutrimatic (add_docs, extract, run, list)

Add Docs:

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

$ nutrimatic add-docs $(target_dir)

Extract:

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

Run extract command to local cookiecutter repository:

$ nutrimatic extract ./python3-cookiecutter

OR: Run extract command to from github cookiecutter repository:

$ nutrimatic extract \
    --repo git@github.com:jcook3701/python3-cookiecutter.git \
    --branch develop \
    --output clean_cookiecutter.json

AFTER: 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 project’s single source of truth.
Note: Intended for use within project Makefile as shown below.

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_FILE := $(PROJECT_ROOT)/README.md

readme: nm-build readme $(JEKYLL_DIR) $(README_FILE) </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 < Directory > --project < Project Name >  

🍪 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:

🐍️ Build environment (.venv)

Description: This creates python virtual environment and installs all necessary packages.

$ make install

CI/CD Checklist: 🧬 + 🛡️ + 🎨 + 🔍 + 🎓 + 🧠 + 🧪

Description: Runs all checks that are used for CI/CD. This should pass without error before attempting a pull-request.
Note: All Makefile commands are used in CI/CD to ensure that if they pass locally they should also pass once pushed to github.

$ make pre-commit

🧪 📢 Test Release Project (Test PyPi):

Description: This runs the entire build cycle and results in a new test release to test.pypi.

$ make test-release

📢 Release Project (Github & PyPi):

Description: This runs the entire build cycle and results in a new release to Github and Pypi. Project is also versioned up after release has been published.

$ make release

Make Toolkit (Individual Commands):

🧬 Dependency Management (deptry)

$ make dependency-check

🛡️ Security Audit (pip-audit)

$ make security

🎨 Formatting (black)

$ make format-check
$ make format-fix

🔍 Linting (ruff, toml, & yaml-lint)

$ make lint-check
$ make lint-fix

🎓 Spellchecking (codespell)

$ make spellcheck

🧠 Typechecking (mypy)

$ make typecheck

🧪 Testing (pytest)

$ make test

📦 Building (build)

$ make build

🚀 Publishing (Twine + Github)

$ make publish

🔖 Version Bumping (bumpy-my-version)

$ make bump-version-patch

❓ Build Help

$ make help

Commit Help:

Note: Commits are required to be conventional git commit message. This helps with the auto-generation of the changelog files and is enforced by pre-commit.
example:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

  • <type>: A required noun that describes the nature of the change.
  • [optional scope]: An optional phrase within parentheses that specifies the part of the codebase being affected (e.g., fix(parser):).
  • <description>: A required short, imperative-mood summary of the changes.
  • [optional body]: A longer description providing additional context and “what and why” details.
  • [optional footer(s)]: Used for adding meta-information, such as issue references (Fixes #123) or indicating breaking changes.

Requirements:

Python 3.11

$ sudo apt install python3.11

rustup

Note: I found that it is easiest to use rustup to manage rustc and cargo but this is not required.
Example: Install rustup with the following:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

git-cliff

Note: git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers.

$ cargo install git-cliff

🍹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.

Metadata

Release files for nutri-matic 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nutri-matic 0.1.15
File Size Uploaded Provenance Actions
nutri_matic-0.1.15.tar.gz 39.6 kB Without provenance Details for nutri_matic-0.1.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nutri-matic 0.1.15
File Interpreter ABI Platform Actions
nutri_matic-0.1.15-py3-none-any.whl Python 3 none any Details for nutri_matic-0.1.15-py3-none-any.whl

Total release size: 93.1 kB

Release files / nutri_matic-0.1.15.tar.gz

Download URL nutri_matic-0.1.15.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d42040606d0530d6cecb5e0ac2d0f15f370364ea6491594793270b1631554cb0
BLAKE2b-256 checksum
How to use checksums
0c2c9dcec823391e08c6bd3eb3c1376589d5574c992a633bafd7f843377c6a5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Release files / nutri_matic-0.1.15-py3-none-any.whl

Download URL nutri_matic-0.1.15-py3-none-any.whl
Size 53.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
980182ab00d330154379360c231a47a5cc21c2c282ca0c605cb0c8d0d0533165
BLAKE2b-256 checksum
How to use checksums
64793638a7fe80a4a37f841e674325fb1b0c6f0d20ea4932d2bdd6097120bf82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Security for nutri-matic 0.1.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page