Apply advanced templating by smartly using CookieCutter.
Project description
Library Package: cookieslicer
Project | |
Quality | |
Community | |
Maintainers |
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cookieslicer-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc6ee709a37efa7aee909d38fe4bf2352c877cf44887fdcf463679e21320e9e0 |
|
MD5 | 48361820c8c6d343aa1e9ef23ff51b67 |
|
BLAKE2b-256 | 19fe742831546f8e3a968850c71c36bf5698cc241e63f4a7479090393817e0f4 |