Plugemin
plugemin is a simple utility which uses the amazing jinja2 templating engine and structured data such as XML, JSON or CSV to plug values into templates many times. Think of a form letter, but endlessly useful. With this you can render plain text, HTML, XML, JSON or even Python or C. Anything is possible as long as it is plain text (UTF is supported) in the end.
plugemin was initially designed to template commands which were to be sent over SSH to target systems.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
You will need the following software installed:
Python >= 2.7
jinja2
lxml
lxml is the only one which needs a compiler to install. If this is an issue, I would recomend the great Anaconda Python Distribution which includes all the prerequisites installed by default.
Installing
You can install the latest stable version with the following command:
$ pip install plugemin
or for the latest development version, you can use the following command:
$ pip install git+https://github.com/ilovetux/plugemin.git
Running the tests
In order to run the tests, you will need to clone the repository and kick off the tests with a single command. All of that can be done with the following commands:
$ git clone https://github.com/ilovetux/plugemin
$ cd plugemin
$ python setup.py nosetests
That’s it, the tests should pass, if they don’t please open an issue and be sure to include:
The commands you ran to get your results
The versions of Python, lxml and jinja2 you have installed
What Operating system
Any details which would cause your setup to be considered non-standard such as running an obscure version of Linux
Basic Usage
Plugemin will look for templates in a series of locations and take a structured data format as input. It will render the template with each piece of data.
Example
in C:\plugemin\templates\backup-delete.j2:
cp {{src}} {{dst}}
rm {{src}}
in C:\tmp\files.csv:
src,dst /var/log/*,/tmp/. /usr/var/log/*,/tmp/. /var/www/*,/tmp/.
Then you can use the following command:
C:\> plugemin -t backup-delete.j2 -d C:\plugemin\files.csv cp /var/log/* /tmp/. rm /var/log/* cp /usr/var/log/* /tmp/. rm /usr/var/log/* cp /var/www/* /tmp/. rm /var/www/*
Contributing
Please read CONTRIBUTING.rst for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the GPL Version 3 or later, please see the LICENSE file for details
Acknowledgments
Hat tip to anyone who’s code was used (Jinja2, lxml and Python)
Brian Kearney and James Brennan for the inspiration to build this utility
Anyone listed in the contributors file
Everyone who helps us by submitting issues and pull requests
Metadata
Release files for plugemin 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plugemin-0.1.1.zip | 8.6 kB | Without provenance | Details for plugemin-0.1.1.zip |
Release files / plugemin-0.1.1.zip
| Download URL | plugemin-0.1.1.zip |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d93573f9f476df91df9a8cbd931e2e7ec1b78474029c9c89d0b4fe25d9b21b80
|
|
BLAKE2b-256 checksum How to use checksums |
24b1d8375d66c102cdfab9feb6fc7d6244977f54db9d90a950a7426256da150c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for plugemin 0.1.1
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.