https://github.com/grahammitchell/minja
A minimal engine to replace things in a folder full of files
https://github.com/grahammitchell/minja
python3 template-engine untested
Last synced: 7 months ago
JSON representation
A minimal engine to replace things in a folder full of files
- Host: GitHub
- URL: https://github.com/grahammitchell/minja
- Owner: grahammitchell
- License: mit
- Created: 2020-04-01T22:42:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-01T22:59:34.000Z (about 6 years ago)
- Last Synced: 2025-02-15T07:51:22.252Z (over 1 year ago)
- Topics: python3, template-engine, untested
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minja - a minimal templating replacement engine
Kind of like Cookiecutter or Jinja but with 70% fewer features and 90% less code!
Also barely tested.
Pure Python 3, no external dependencies.
Given a dictionary of "from" -> "to" replacements, and a folder full of files:
- replaces all occurrences in the body of all files
- also within filenames
- also within folder names
Attempts to:
- leave binary files alone
- preserve the line ending of text files (Unix, DOS)
- preserve the permissions (executable bit should say set even after modification/renaming)
Don't blame me if this accidentally destroys the files in the folder you provide, but it probably won't.
## Usage
```
./minja.py /path/to/template/folder
```
## FAQ
Q: Do you realize how terrible the name is?
A: Yeah. Naming is hard.