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.0rc6.tar.gz (3.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: detokenizer-1.0.0rc6.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.0rc6.tar.gz
Algorithm Hash digest
SHA256 203641d573de95dc1a645b0fc71ed9043ceb96cbda5e684d06febfc51487b82b
MD5 22f896496cb21bc1a8e4b5d88a000be5
BLAKE2b-256 3bc9a1f53f372f5deca512d634b6116a5a5dfca64aa7f266d77b3840f6ca3f7b

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