Skip to content

replace patterns in text based on modular configuration files

Notifications You must be signed in to change notification settings

dan-ringwald/util-remplacement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

util-remplacement

replace patterns in text based on modular configuration files

Actions

Build a replacement map

  1. Create a ReplacementMap object (Optionally with an initial YAML file). mapper = ReplacementMap(some_replacements.yaml)
  2. Append rules to the replacement map. Rules' order is preserved inside files and between files. mapper = ReplacementMap.add_yaml_file(other_replacements.yaml)

Apply a replacement map

Applies replacement map on a text: mapper.process_text('some text to be processed')

Test the package

python -m unittest tests/test_replacement_map.py

About

replace patterns in text based on modular configuration files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages