Skip to main content

Random Data Generators. Allows you to generate random strings of a given length from letters, numbers and symbols, as well as randomize text. Helps generate passwords, service codes (for example, for sending via SMS), hashes and much more.

Project description

smartrandom v0.1.3


Random Data Generators:

Allows you to generate random strings of a given length from letters, numbers and symbols, as well as randomize text. Helps generate passwords, service codes (for example, for sending via SMS), hashes and much more.


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


Author and developer: A.A. Suvorov.


What is news:

  • Added the ability to randomize text.

Help:

pip install smartrandom

from smartrandom.random_master import RandomStringMaster

random_string = RandomStringMaster.create_string(length=10)
string_hash = RandomStringMaster.create_hash('text')
number_code = RandomStringMaster.create_numeric_code(length=6)
letter_code = RandomStringMaster.create_letters_code(length=6)
symbol_code = RandomStringMaster.create_letters_code(length=6)
code = RandomStringMaster.create_code(length=10, numeric_flag=True, letters_flag=True, symbols_flag=True)

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 smartrandom.random_master import RandomStringMaster

random_master = RandomStringMaster()

text = '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'
randomized_text = random_master.randomize_text(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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartrandom-0.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

smartrandom-0.1.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file smartrandom-0.1.3.tar.gz.

File metadata

  • Download URL: smartrandom-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for smartrandom-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b9af4b3db50e6fd48189923b1f16c690ed18dbe38929ca8bb5e49c65cad10d9a
MD5 8960dfe04845a6e91054a7990e1a232d
BLAKE2b-256 4bda5503032fed5de5b7fe078bf8b8479b72bb87dbf9b965b5c2efe81a8782b7

See more details on using hashes here.

File details

Details for the file smartrandom-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: smartrandom-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for smartrandom-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 19372e1889b42315f662ff39d9ad7287d1ba6d9d49f287ae485b86137d16df8b
MD5 0285047edd74262a04a3e3c92d1d662e
BLAKE2b-256 1e000ec444ae37a40a7dbad009ad9348c1f867bdda8226e6ac5a4ad9054f0827

See more details on using hashes here.

Supported by

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