Skip to main content

Python command line for property injection.

Project description

detokenizer

detokenizer of configuration files. Inject properties in source code before deployment.

Usage

This parameters are positional parameters.

Parameters Description
source source file, all tokens in this file will be replaced with properties
target target file, output after the replacement
config config files, this fils is a yaml file defining the delimiters for the token
properties properties file, this file contains the dictionary of properties which shall be injected into the source file

the following command run the tool on the test data contained in this repo:

python3 -m detokenizer \
  ./test/data/source_folder/config.properties.php \
  ./build/config.php \
  ./test/data/config.yaml \
  ./test/data/default.properties

Example

Source file:

<?php

ini_set('memory_limit', '${packaging.memory_limit}');

$ENVIRONMENT_NAME = '${packaging.environment_name}';

#region URL
$site_URL = '${packaging.site_URL}';
#endregion
...

Properties file:

packaging.memory_limit=1024
packaging.environment_name=default
packaging.site_URL=

packaging.host=193.168.1.12
packaging.port=3000
packaging.db=db_ms_12
...

Produced target:

<?php

ini_set('memory_limit', '1024');

$ENVIRONMENT_NAME = 'default';

#region URL
$site_URL = '';
#endregion
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

detokenizer-1.0.0rc7.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file detokenizer-1.0.0rc7.tar.gz.

File metadata

  • Download URL: detokenizer-1.0.0rc7.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.2

File hashes

Hashes for detokenizer-1.0.0rc7.tar.gz
Algorithm Hash digest
SHA256 435eb16e45373f0502546fa0157912c56f211974420253d12046024910442043
MD5 078de0245eaee5b8864851bc5fbfe7ac
BLAKE2b-256 873fe452edc0f4e245b0f523e9b9e4d90a72cffa110e6856967c159742e50b51

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page