# smartrandom <sup>v0.2.1</sup>
---
## Random Data Generators:
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. Generates smart, recoverable passwords.
---
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smartrandom)](https://github.com/smartlegionlab/smartrandom/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/smartrandom?label=pypi%20downloads)](https://pypi.org/project/smartrandom/)
![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smartrandom)
[![PyPI](https://img.shields.io/pypi/v/smartrandom)](https://pypi.org/project/smartrandom)
[![GitHub](https://img.shields.io/github/license/smartlegionlab/smartrandom)](https://github.com/smartlegionlab/smartrandom/blob/master/LICENSE)
[![PyPI - Format](https://img.shields.io/pypi/format/smartrandom)](https://pypi.org/project/smartrandom)
***
Author and developer: ___A.A. Suvorov.___
***
## What is news:
smartrandom 0.2.1 - new improved version of the library.
- Added a regular password generator.
- Added a smart password generator.
- Improved tests
***
## Help:
`pip install smartrandom`
```python
from smartrandom import RandomDataGenerator
secret_code = RandomDataGenerator.generate_secret_code(6) # 'zREkjF'
number_secret_code = RandomDataGenerator.generate_random_numbers(6) # '986741'
symbols = RandomDataGenerator.generate_random_symbols(10) # '&&!@@&@!_!'
hash_ = RandomDataGenerator.generate_hash('text') # '1798b0ae66b1ca6f3b88e00f9d17ce1470549e97687a1c97e26110bb8853ad41797e83831efe7eedbd29042a9a8991fd1adb4f7680946d57eed99b8b6e5502c4'
urandom_string = RandomDataGenerator.generate_random_hex_string(32) # '7b1dd304b42e79d9e26bfb9f839abf8d001fed2039bcc3c5bfd14c0b05cfcab2'
urandom_bytes = RandomDataGenerator.generate_random_bytes(32) # b'f_@\x1bnP\xb4\xa8\xb7$a\xbf\x13\r#\x96\xe5\x07D\xa1N\xf5\xe9\x9a\x95\x91\xe4\xd0\x8fR"\''
randomized_text = RandomDataGenerator.randomize_text('{Salute|Hello|Good morning} {comrade|buddy|dear friend}!') # Good morning buddy!
password = RandomDataGenerator.generate_password(15) # 'b$L^#7rfIUzgY!2'
```
### 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:
```python
from smartrandom import TextRandomizer
text = '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'
randomized_text = TextRandomizer.randomize(text)
print(randomized_text) # Good morning buddy!
```
---
### Test coverage:
#### Run tests:
- `pip install pytest`
- `pytest -v`
#### __Test coverage 100%__
- `pip install pytest-coverage`
- `pytest --cov`
![commandpack image](https://github.com/smartlegionlab/smartrandom/raw/master/data/images/coverage_report.png)
#### Report html:
- `pytest --cov --cov-report=html`
***
***
## 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.
--------------------------------------------------------
Raw data
{
"_id": null,
"home_page": "https://github.com/smartlegionlab/smartrandom/",
"name": "smartrandom",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "password generator, code generator, random generator, random code generator, random string generator, random bytes generator, text randomizer, smartrandom, smartlegionlab, A.A Suvorov",
"author": "A.A. Suvorov",
"author_email": "smartlegiondev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/10/53/383dbc01a25f54fd804add1bd11ea1508bef0968e1a732a42b241bfd7379/smartrandom-0.2.1.tar.gz",
"platform": null,
"description": "# smartrandom <sup>v0.2.1</sup>\n---\n\n## Random Data Generators:\n\nRandom 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. Generates smart, recoverable passwords.\n\n---\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smartrandom)](https://github.com/smartlegionlab/smartrandom/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/smartrandom?label=pypi%20downloads)](https://pypi.org/project/smartrandom/)\n![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smartrandom)\n[![PyPI](https://img.shields.io/pypi/v/smartrandom)](https://pypi.org/project/smartrandom)\n[![GitHub](https://img.shields.io/github/license/smartlegionlab/smartrandom)](https://github.com/smartlegionlab/smartrandom/blob/master/LICENSE)\n[![PyPI - Format](https://img.shields.io/pypi/format/smartrandom)](https://pypi.org/project/smartrandom)\n\n***\n\nAuthor and developer: ___A.A. Suvorov.___\n\n***\n\n## What is news:\n\nsmartrandom 0.2.1 - new improved version of the library.\n\n- Added a regular password generator.\n- Added a smart password generator.\n- Improved tests\n\n***\n\n## Help:\n\n`pip install smartrandom`\n\n```python\nfrom smartrandom import RandomDataGenerator\n\n\nsecret_code = RandomDataGenerator.generate_secret_code(6) # 'zREkjF'\nnumber_secret_code = RandomDataGenerator.generate_random_numbers(6) # '986741'\nsymbols = RandomDataGenerator.generate_random_symbols(10) # '&&!@@&@!_!'\nhash_ = RandomDataGenerator.generate_hash('text') # '1798b0ae66b1ca6f3b88e00f9d17ce1470549e97687a1c97e26110bb8853ad41797e83831efe7eedbd29042a9a8991fd1adb4f7680946d57eed99b8b6e5502c4'\nurandom_string = RandomDataGenerator.generate_random_hex_string(32) # '7b1dd304b42e79d9e26bfb9f839abf8d001fed2039bcc3c5bfd14c0b05cfcab2'\nurandom_bytes = RandomDataGenerator.generate_random_bytes(32) # b'f_@\\x1bnP\\xb4\\xa8\\xb7$a\\xbf\\x13\\r#\\x96\\xe5\\x07D\\xa1N\\xf5\\xe9\\x9a\\x95\\x91\\xe4\\xd0\\x8fR\"\\''\nrandomized_text = RandomDataGenerator.randomize_text('{Salute|Hello|Good morning} {comrade|buddy|dear friend}!') # Good morning buddy!\npassword = RandomDataGenerator.generate_password(15) # 'b$L^#7rfIUzgY!2'\n\n\n\n```\n\n### Text randomizer:\n\n\"Text randomization\" or \"variable text\". It is used to create different variations of the same message.\n\nYou are using special syntax. Example: `'{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'`\n\nThis syntax allows you to create variable messages by using curly braces and vertical bars to indicate alternatives.\n\nBasic elements of syntax:\n\n1. Curly braces {}: Used to group text options. Anything inside the curly braces will be randomly selected when generating the text.\n2. Vertical bar |: Used to separate different text options within curly braces. Each option will be treated as a separate choice.\n\nExample of use:\n\n- Syntax: `'{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'`\n- Possible results:\n - Salute comrade!\n - Salute buddy!\n - Salute dear friend!\n - Hello comrade!\n - Hello buddy!\n - Hello dear friend!\n - Good morning comrade!\n - Good morning buddy!\n - Good morning dear friend!\n- How to use:\n 1. Create your text: Identify which parts of your message can vary and place them in curly braces.\n 2. Add options: Separate alternatives with a vertical bar.\n 3. Text Generation: Use RandomStringMaster() to generate a random message.\n\n- Notes:\n - Make sure all options inside the curly braces make sense and fit the context.\n - You can use multiple randomization groups in a single message to create more complex variations.\n\n\nExample of text randomization:\n\n```python\nfrom smartrandom import TextRandomizer\n\ntext = '{Salute|Hello|Good morning} {comrade|buddy|dear friend}!'\nrandomized_text = TextRandomizer.randomize(text)\nprint(randomized_text) # Good morning buddy!\n```\n\n---\n\n### Test coverage:\n\n#### Run tests:\n- `pip install pytest`\n- `pytest -v`\n \n\n#### __Test coverage 100%__\n\n- `pip install pytest-coverage`\n- `pytest --cov`\n\n![commandpack image](https://github.com/smartlegionlab/smartrandom/raw/master/data/images/coverage_report.png)\n\n\n#### Report html:\n\n- `pytest --cov --cov-report=html`\n\n***\n\n\n***\n\n## Disclaimer of liability:\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n***\n\n## Copyright:\n --------------------------------------------------------\n Licensed under the terms of the BSD 3-Clause License\n (see LICENSE for details).\n Copyright \u00a9 2018-2024, A.A. Suvorov\n All rights reserved.\n --------------------------------------------------------\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "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. Generates smart, recoverable passwords.",
"version": "0.2.1",
"project_urls": {
"Documentation": "https://github.com/smartlegionlab/smartrandom/blob/master/README.md",
"Homepage": "https://github.com/smartlegionlab/smartrandom/",
"Release notes": "https://github.com/smartlegionlab/smartrandom/releases"
},
"split_keywords": [
"password generator",
" code generator",
" random generator",
" random code generator",
" random string generator",
" random bytes generator",
" text randomizer",
" smartrandom",
" smartlegionlab",
" a.a suvorov"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "64439de7e078988823a51e5454fbee827bc612f3883b0c6cb87fd91a7829b81a",
"md5": "77224d3c43e411890c042972c766e985",
"sha256": "160083ab45aa1177e11fab2b1156da298fa359171b5154a945f8410c79f896bf"
},
"downloads": -1,
"filename": "smartrandom-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "77224d3c43e411890c042972c766e985",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7473,
"upload_time": "2024-08-01T09:53:04",
"upload_time_iso_8601": "2024-08-01T09:53:04.070145Z",
"url": "https://files.pythonhosted.org/packages/64/43/9de7e078988823a51e5454fbee827bc612f3883b0c6cb87fd91a7829b81a/smartrandom-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1053383dbc01a25f54fd804add1bd11ea1508bef0968e1a732a42b241bfd7379",
"md5": "25e11a92aad9de21084f3d25645d2650",
"sha256": "3972b7a2c0ed9f28eeac59099fe589bb03baf4c9cc343cf4922a977ad7a395bf"
},
"downloads": -1,
"filename": "smartrandom-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "25e11a92aad9de21084f3d25645d2650",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 8664,
"upload_time": "2024-08-01T09:53:05",
"upload_time_iso_8601": "2024-08-01T09:53:05.399910Z",
"url": "https://files.pythonhosted.org/packages/10/53/383dbc01a25f54fd804add1bd11ea1508bef0968e1a732a42b241bfd7379/smartrandom-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-01 09:53:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "smartlegionlab",
"github_project": "smartrandom",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "smartrandom"
}