Smart Text Randomizer.
Project description
smart_text_randomizer
Smart Text Randomizer.
Author and developer: A.A. Suvorov.
What is news:
smart_text_randomizer v0.0.2
- 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:
- Curly braces {}: Used to group text options. Anything inside the curly braces will be randomly selected when generating the text.
- 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:
- Create your text: Identify which parts of your message can vary and place them in curly braces.
- Add options: Separate alternatives with a vertical bar.
- 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-2024, A.A. Suvorov
All rights reserved.
--------------------------------------------------------
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file smart_text_randomizer-0.0.2.tar.gz
.
File metadata
- Download URL: smart_text_randomizer-0.0.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c72c2328f595ab70d018c43afc89d5486362b99389892e971a9b012f10b8a759 |
|
MD5 | 127b08c1aa2fb6d7781ac1f35cc1d080 |
|
BLAKE2b-256 | 3b5d1d8c22d41f4e86abcb1303ccaffb4f02f393d3ac4e4e0623fabcd616f22c |
File details
Details for the file smart_text_randomizer-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: smart_text_randomizer-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47435dcb392772187643e327322f8717092f1afb97b2a783c9dc65f23e0ca678 |
|
MD5 | bfe974ed6663cab88aa76a2829e7f3ab |
|
BLAKE2b-256 | 6a98f471810d058ea95892eeda903890527db4739428cab36388634023e4e34e |