Skip to main content

Smart Text Randomizer.

Project description

smart-text-randomizer v0.0.3

Smart Text Randomizer


PyPI Downloads GitHub release (latest by date) PyPI - Downloads GitHub top language PyPI GitHub PyPI - Format


Author and developer: A.A. Suvorov.


What is news:

smart-text-randomizer v0.0.3

  • Fixed bugs.
  • Added documentation.
  • Improved security. random was replaced with secrets.

Help:

pip install smart-text-randomizer

"Text randomization" or "variable text". It is used to create different variations of the same message.

You are using special syntax. Example: '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'

This syntax allows you to create variable messages by using curly braces and vertical bars to indicate alternatives.

Basic elements of syntax:

  1. Curly braces {}: Used to group text options. Anything inside the curly braces will be randomly selected when generating the text.
  2. Vertical bar |: Used to separate different text options within curly braces. Each option will be treated as a separate choice.

Example of use:

  • 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!
  • How to use:

    1. Create your text: Identify which parts of your message can vary and place them in curly braces.
    2. Add options: Separate alternatives with a vertical bar.
    3. Text Generation: Use RandomStringMaster() to generate a random message.
  • Notes:

    • Make sure all options inside the curly braces make sense and fit the context.
    • You can use multiple randomization groups in a single message to create more complex variations.

Example of text randomization:

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!

Disclaimer of liability:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright:

--------------------------------------------------------
Licensed under the terms of the BSD 3-Clause License
(see LICENSE for details).
Copyright © 2018-2025, A.A. Suvorov
All rights reserved.
--------------------------------------------------------

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

smart_text_randomizer-0.0.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smart_text_randomizer-0.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file smart_text_randomizer-0.0.3.tar.gz.

File metadata

  • Download URL: smart_text_randomizer-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for smart_text_randomizer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 50f93bff23c0d869b5ee93830066eb1c1ee665ac3ac51eb2fe5900f0784469ba
MD5 13d4df4b82f1ff17c81f09d97b1cdb11
BLAKE2b-256 da54184ad98d8874d6fbb35ba9be3c828eb5c4447f54841208b29eb03c366316

See more details on using hashes here.

File details

Details for the file smart_text_randomizer-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_text_randomizer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bf614489ef42f1502abf16c381cf3a14277944395d7b259c3d07f15fb02bed0b
MD5 c3b974812c7ea61616ab408d4178940c
BLAKE2b-256 579df5f8af40bda5e7c26170f745d784b467a87d62e77f29944d2b6d270ad3f6

See more details on using hashes here.

Supported by

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