Skip to main content

Shadow

https://img.shields.io/pypi/v/shadowgen.svg https://img.shields.io/travis/karma0/shadow.svg Documentation Status Updates

A comprehensive command line utility to render templates and ease code generation.

https://github.com/karma0/shadow/raw/master/shadow-devil.gif

Features

  • Incorporates a convention over configuration mentality.

  • Use the default *.tpl extension to find and render templates, or specify your own.

  • Use the template extension on a directory to render all files under it.

  • Specify the path(s) or let it default to searching for templates in the current working directory.

  • Use template variables in filenames to render scalar filename outputs.

  • Use hash/dict or list/array types in filenames to render multiple files.

  • Default configuration expects a file named shadowconf with any of the following extensions: .json, .hcl, .env, .yml, .ini.

  • If no configuration file is specified, it will load and use the shell environment to render variables.

  • All defaults can be overriden.

Quick Install

Install from PyPi:

pip install shadowgen

Install from GitHub:

git clone https://github.com/karma0/shadow
cd shadow
pip install -U .

Examples

Display the help and exit:

shadow --help

Discover templates to be generated:

shadow sim

Find all templates in the current working directory and generate them using the config file shadowconf.json as the variables to build them:

shadow fax

Find all generated templates and remove them:

shadow clean

Generate templates in the tests directory on files ending in *.j2, using environment variables to fill and render the templates:

shadow fax -e -t .j2 tests

Generate the single template file named test.txt using the HCL config file test.txt.hcl:

shadow fax -c test.txt.hcl test.txt.tpl

Credits

Created and maintained by karma0.

This package was created with Cookiecutter and the karma0/cookiecutter-pypackage project template.

History

0.3.2 (2019-04-01)

  • Updated installation documentation.

0.3.1 (2019-04-01)

  • Renamed PyPi project to shadowgen.

  • Dependency upgrades.

0.3.0 (2019-02-06)

  • Added config passthrough from CLI.

  • Fixed yield bug in rendering of filenames.

  • Added some preliminary tests.

  • Fixed logging.

  • Added always fallback to loading the environment if no config file is present.

  • Added checks for shadowconf file using extensions: json, ini, env, etc.

0.2.2 (2019-01-31)

  • Documentation fixes.

0.2.1 (2019-01-31)

  • Version bump; getting everything working.

0.2.0 (2019-01-31)

  • First release on PyPI.

Metadata

Release files for shadowgen 0.3.2

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

Source distribution (sdist)

Source distribution for shadowgen 0.3.2
File Size Uploaded
shadowgen-0.3.2.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shadowgen 0.3.2
File Interpreter ABI Platform
shadowgen-0.3.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 23.2 kB

Release files / shadowgen-0.3.2.tar.gz

Download URL shadowgen-0.3.2.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
efafccf19e698ae9f52c98da788e981d7ad0b07728ab45165d74d31bee1d63e4
BLAKE2b-256 checksum
How to use checksums
eb3f23720da4a1ed2b52f3f07e52e8f830655e7b585677753a0c1aee63867c1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / shadowgen-0.3.2-py2.py3-none-any.whl

Download URL shadowgen-0.3.2-py2.py3-none-any.whl
Size 9.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ff27cab9d7c5b14b42bf706f8ddc78c0f5aa8101ef40a81af4c7bf605f8d3ca6
BLAKE2b-256 checksum
How to use checksums
f085cba99cb58ca9f8f06a1e73097b4c1c7c4f333b2decca70fb0a890b86f7c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

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