Smart Text Randomizer
Create different variations of the same message using curly braces and vertical bars syntax.
smart-text-randomizer — "Text randomization" or "variable text". Used to create different variations of the same message.
Uses special syntax with curly braces {} to group text options and vertical bars | to separate alternatives.
{option1|option2|option3}TextRandomizer.randomize(text)Basic elements:
Syntax example:
'{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'
Syntax: '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'
Possible results:
Note: You can use multiple randomization groups in a single message to create more complex variations.
pip install smart-text-randomizer
from smart_text_randomizer import TextRandomizer
text_randomizer = TextRandomizer()
text = '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'
randomized_text = TextRandomizer.randomize(text)
print(randomized_text) # Good morning buddy!
How to use:
TextRandomizer.randomize()⚠️ Make sure all options inside the curly braces make sense and fit the context.
By using this software, you agree to the full disclaimer terms.
Software provided "AS IS" without warranty. You assume all risks.
Full legal disclaimer: See DISCLAIMER.md
License: BSD 3-Clause License