smart-text-randomizer v0.1.0

Smart Text Randomizer

Create different variations of the same message using curly braces and vertical bars syntax.

Python Text Randomizer Variable Text Lightweight PyPI

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.

  • Variable Text Generation — create message variations
  • Curly Brace Syntax{option1|option2|option3}
  • Multiple Groups — use multiple randomization groups in one message
  • Lightweight — minimal dependencies
  • Simple APITextRandomizer.randomize(text)

Basic elements:

  • Curly braces {} — group text options. Anything inside will be randomly selected
  • Vertical bar | — separate different text options within braces

Syntax example:

'{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'

Syntax: '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'

Possible results:

  • Salute comrade!
  • Salute buddy!
  • Salute dear friend!
  • Hello comrade!
  • Hello buddy!
  • Hello dear friend!
  • Good morning comrade!
  • Good morning buddy!
  • Good morning dear friend!

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:

  1. Create your text — identify variable parts and place in curly braces
  2. Add options — separate alternatives with a vertical bar
  3. Generate — 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