Provides method for dynamically injecting variables into a document and/or HTML like object
Project description
Document argument injector
Provides a simple helper method
Argument(s):
- document (str) the document loaded as a string
- params (dict) key,value == match,replacement
- encapsulation (tuple) variable encapsulation ('leftisde', 'rightside')
Returns the provided document with injected parameters
Usage
from injector import injector
document: str
with open('profile.html', 'r') as file:
document = file.read()
payload: dict = {
'user.firstName': 'John',
'user.lastName': 'Smith',
'user.email': 'jsmith@example.com',
'user.phone': '+555111444'
'user.postcode': '1234 Town',
'user.address': '12 Street'
}
injector(
document=document,
params=params,
encapsulation=('{', '}')
)
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
Close
Hashes for document-variable-injector-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26de880dccca0a4a6cb9c1487941d7c6341a9cd5212dcdebff254e903b21df84 |
|
MD5 | 06e7bc7cf7d50857ef6c8716300eb0a6 |
|
BLAKE2b-256 | be17e4cce240dc83e80cbb944ccb90edeb562a457727e2cf550303cf19a07535 |
Close
Hashes for document_variable_injector-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 590bcc54854318e50bf0ae43095c6ca0c52ccecab6dc7d1e15c838f781ed9fcb |
|
MD5 | e7607a00cd4862111a97072396245ed5 |
|
BLAKE2b-256 | b17dfd370ae9efdcb34e5d916d0cb4fc9903729034658260eaa40b65e63e386d |