Skip to main content

Apply advanced templating by smartly using CookieCutter.

Project description

Library Package: cookieslicer

Project Version Python Versions platforms License GitHub top language
Quality GitHub Workflow Status (event) Issues codecov Sourcery snyk
GitHub Pipenv locked dependency version (branch) GitHub Pipenv locked dependency version (branch) GitHub Pipenv locked dependency version (branch) GitHub Pipenv locked dependency version (branch) GitHub Pipenv locked dependency version (branch) GitHub Pipenv locked dependency version (branch)
Community Maintenance Stars Forks Contributors Downloads
Maintainers LinkedIn

The cookieslicer project was born out of a simple need: to have a templating system that we could apply multiple times as our knowledge grew. With multiple open source projects being maintained, it was becoming difficult to remember which versions of which files were "the best". While the cookiecutter project is a good first step to solving these problems, we felt it needed something in front of it to help control the templating.

The cookieslicer application adds three files to a project that assist it in maintaining good templates. The source directory is the location of the template to be applied, and contains a cookieslicer.json file that gives addition instructions on how to handle certain situations that arise when re-applying a template. The output directory is the location that the template is applied to. This directory contains a cookiecutter-config.yaml that is applied to the template in the source directory using cookiecutter. This directory also contains a cookieslicer.json file with configuration information for the cookieslicer application.

The rest of the process is (mostly) simple. Cookieslicer uses the cookiecutter-config.yaml file and the source directory to generate a completed template in a temporary directory. With that template including the source directory's cookieslicer.json file, cookieslicer then checks to see if the source directory's template version is the same as the output directory's template version, quickly exitting if they are the same. Otherwise, the source directory's cookieslicer.json file tells Cookieslicer how to alter files in the output directory.

Outside of a normal file copy, there are three different modes in which this happens. The once mode instructs Cookieslicer to only copy a file if it does not exist in the output directory. The attention mode instructs Cookieslicer to copy the file if it is different and to place it on an attention list. This list is relayed to the end-user at the end of the templating. Finally, the remove mode instructs Cookieslicer to remove a file with a specific path from the output directory. While we are not sure if this is a complete list of actions to take, we feel that it was a good enough list to start with.

Requirements

This project required Python 3.8 or later to function.

Installation

pip install cookieslicer

How To Use This Package

NOTE: This project is under development. More to come in the following weeks.

Examples

For concrete examples that show the power of this library package, please consult the Examples Document. If you come up with a normal example of how to use our package that we have missed, or come up with a novel example of how to use our package, please file an issue using the process below and let us know. From our experience, one example can often paint a picture of how to use our project that is difficult to explain clearly with just words.

Issues and Future Plans

If you would like to report an issue with the library or the documentation, please file an issue using GitHub. Please remember to fill in as much information as possible including a good, repeatable pattern for reproducing the issue. Do not overflow us with too much information, but provide us with enough information to make the problem evident to us.

If you would like to us to implement a feature that you believe is important, please file an issue using GitHub that includes what you want to add, why you want to add it, and why it is important to you, and how you think it will help others. We truly want to listen to what you see as a good feature, so please do not be upset if we say "no" or "let me think about it".

Please note that the issue you file will usually be the start of a conversation, so be ready for more questions. If you have any Python developer skills, please mention that as well. The conversations about "hey, can you..." is a lot different than "if I do... can I add it to the project?".

When Did Things Change?

The changelog for this project is maintained at this location.

Still Have Questions?

If you still have questions, please consult our Frequently Asked Questions document.

Instructions For Contributing

Developer notes on various topics are kept in the the Developer Notes document.

If you attempting to contribute something to this project, please follow the steps outlined in the CONTRIBUTING.md file.

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

cookieslicer-0.1.5.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

cookieslicer-0.1.5-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file cookieslicer-0.1.5.tar.gz.

File metadata

  • Download URL: cookieslicer-0.1.5.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cookieslicer-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d9b60a19e103a706766520bdefbeda23cbf3a1afcb6680e3560e681a12019a0b
MD5 07ca5c33e8c54998792b95df93f36142
BLAKE2b-256 75f18197ee4cdbf77d9ca1d6a962d3401e6ec0c777cdeb49846e5f19042a0328

See more details on using hashes here.

File details

Details for the file cookieslicer-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cookieslicer-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cookieslicer-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cf3c96eb587ba894a31ff78da007c7d86ce58ca680223ec3ddbd87c0282c6c80
MD5 edcf1cfbea052a2bb98fb7dbccbd9335
BLAKE2b-256 b68543b0cf83b59189809744dc612abd2eb44462022e012b9b82b36e47ffb6bb

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