re-generate


Namere-generate JSON
Version 0.1.8 PyPI version JSON
download
home_pagehttps://github.com/Warrfie/re-generate
SummaryPackage for random data generation via ReGex
upload_time2023-04-02 18:48:55
maintainer
docs_urlNone
authorKuklikov Maxim (Warrfie)
requires_python>=3.7, <4
license
keywords qa random string reverse regular expression regex generator testing autotesting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPi Package Version](https://img.shields.io/pypi/v/re-generate.svg)](https://pypi.python.org/pypi/re-generate)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/re-generate.svg)](https://pypi.python.org/pypi/re-generate)
[![PyPi status](https://img.shields.io/pypi/status/re-generate.svg?style=flat-square)](https://pypi.python.org/pypi/re-generate)

# <p align="center">Re-Generate

<p align="center">A simple and light package for QA development which can generate random strings via RegExr.</p>
<p align="center">Not all RegExr mechanics are available now. But you can use all base methods and generate any string.</p>

## New features
1.0.8:
1) Finally, added () groups syntax support
2) Global changes in generation start function (sorry, it's alpha)

## Getting started

This package is tested with Python 3.9-3.11 and Pypy 3.
There are two ways to install the library:

* Installation using pip (a Python package manager):

```
pip install re_generate
```
* Installation from source (requires git):

```
git clone https://github.com/Warrfie/re-generate
cd re-generate
python setup.py install
```
or:
```
pip install git+https://github.com/Warrfie/re-generate
```

It is generally recommended to use the first option.

*Package is still under development, and it has regular updates, do not forget to update it regularly by calling*
```
pip install re_generate --upgrade
```

# <p align="center">Summary</a>

## What RegExr syntax supported

|              type               | is supported       |
|:-------------------------------:|--------------------|
|       [] square brackets        | √ |
|      [^] ! square brackets      | √ |
|      {} braces quantifiers      | √ |
| {i,j} range braces quantifiers  | √ |
|           	&#124;  or           | √ |
|            () groups            | √                |
| \n,\s,\d...etc reserved samples | ✖                |
|   *?,+?,?? greedy quantifiers   | ✖                |
|     *,+,? lazy quantifiers      | ✖                |

## Main functionality
How generate
```python
from re_generate import re_generate
print(re_generate(r"69[0-9]abc[a-zA-Z]228"))
```
    '693abcb228'
How generate several strings ot once
```python
from re_generate import re_generate_list
print(re_generate_list(r"69[0-9]abc[a-zA-Z]228"), 10)
```
    ['694abcO228', '693abcG228', '692abcV228', '696abcy228', '693abca228', '690abcb228', '694abcD228', '696abck228', '696abcJ228', '692abca228']

## What you can configue
If you want to use your own library
```python
from re_generate import re_generator
re_generator.char_lib = "你f好п我Э的$中(国*朋Ъ友1234+=\/,."
```

Sometimes you need generate string without spaces at begin and end, like after .strip() function.
```python
from re_generate import re_generator
re_generator.will_be_stripped = True
```
# Tips and tricks
In large project you can link that lib throw cfg py file like that
```
cfg.py
```

```python
from re_generate import re_generator
re_generator.char_lib = "你f好п我Э的$中(国*朋Ъ友1234+=\/,."
re_generator.will_be_stripped = True
your_func = re_generator.re_generator
```
and use it in your project
```
your_code.py
```

```python
from cfg import your_func
print(your_func(r"69[^0-9]abc[a-zA-Z]22[ 8]"))
```
    '69我abcb228'




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Warrfie/re-generate",
    "name": "re-generate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7, <4",
    "maintainer_email": "",
    "keywords": "QA,random string,reverse regular expression,regex generator,testing,autotesting",
    "author": "Kuklikov Maxim (Warrfie)",
    "author_email": "\"MaximKuklikov(Warrfie)\" <warrfie@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a3/1b/239537de8ec50943592d5084c370a74e8b0521b638444a823ab07f1c1dd5/re-generate-0.1.8.tar.gz",
    "platform": null,
    "description": "[![PyPi Package Version](https://img.shields.io/pypi/v/re-generate.svg)](https://pypi.python.org/pypi/re-generate)\r\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/re-generate.svg)](https://pypi.python.org/pypi/re-generate)\r\n[![PyPi status](https://img.shields.io/pypi/status/re-generate.svg?style=flat-square)](https://pypi.python.org/pypi/re-generate)\r\n\r\n# <p align=\"center\">Re-Generate\r\n\r\n<p align=\"center\">A simple and light package for QA development which can generate random strings via RegExr.</p>\r\n<p align=\"center\">Not all RegExr mechanics are available now. But you can use all base methods and generate any string.</p>\r\n\r\n## New features\r\n1.0.8:\r\n1) Finally, added () groups syntax support\r\n2) Global changes in generation start function (sorry, it's alpha)\r\n\r\n## Getting started\r\n\r\nThis package is tested with Python 3.9-3.11 and Pypy 3.\r\nThere are two ways to install the library:\r\n\r\n* Installation using pip (a Python package manager):\r\n\r\n```\r\npip install re_generate\r\n```\r\n* Installation from source (requires git):\r\n\r\n```\r\ngit clone https://github.com/Warrfie/re-generate\r\ncd re-generate\r\npython setup.py install\r\n```\r\nor:\r\n```\r\npip install git+https://github.com/Warrfie/re-generate\r\n```\r\n\r\nIt is generally recommended to use the first option.\r\n\r\n*Package is still under development, and it has regular updates, do not forget to update it regularly by calling*\r\n```\r\npip install re_generate --upgrade\r\n```\r\n\r\n# <p align=\"center\">Summary</a>\r\n\r\n## What RegExr syntax supported\r\n\r\n|              type               | is supported       |\r\n|:-------------------------------:|--------------------|\r\n|       [] square brackets        | \u221a |\r\n|      [^] ! square brackets      | \u221a |\r\n|      {} braces quantifiers      | \u221a |\r\n| {i,j} range braces quantifiers  | \u221a |\r\n|           \t&#124;  or           | \u221a |\r\n|            () groups            | \u221a                |\r\n| \\n,\\s,\\d...etc reserved samples | \u2716                |\r\n|   *?,+?,?? greedy quantifiers   | \u2716                |\r\n|     *,+,? lazy quantifiers      | \u2716                |\r\n\r\n## Main functionality\r\nHow generate\r\n```python\r\nfrom re_generate import re_generate\r\nprint(re_generate(r\"69[0-9]abc[a-zA-Z]228\"))\r\n```\r\n    '693abcb228'\r\nHow generate several strings ot once\r\n```python\r\nfrom re_generate import re_generate_list\r\nprint(re_generate_list(r\"69[0-9]abc[a-zA-Z]228\"), 10)\r\n```\r\n    ['694abcO228', '693abcG228', '692abcV228', '696abcy228', '693abca228', '690abcb228', '694abcD228', '696abck228', '696abcJ228', '692abca228']\r\n\r\n## What you can configue\r\nIf you want to use your own library\r\n```python\r\nfrom re_generate import re_generator\r\nre_generator.char_lib = \"\u4f60f\u597d\u043f\u6211\u042d\u7684$\u4e2d(\u56fd*\u670b\u042a\u53cb1234+=\\/,.\"\r\n```\r\n\r\nSometimes you need generate string without spaces at begin and end, like after .strip() function.\r\n```python\r\nfrom re_generate import re_generator\r\nre_generator.will_be_stripped = True\r\n```\r\n# Tips and tricks\r\nIn large project you can link that lib throw cfg py file like that\r\n```\r\ncfg.py\r\n```\r\n\r\n```python\r\nfrom re_generate import re_generator\r\nre_generator.char_lib = \"\u4f60f\u597d\u043f\u6211\u042d\u7684$\u4e2d(\u56fd*\u670b\u042a\u53cb1234+=\\/,.\"\r\nre_generator.will_be_stripped = True\r\nyour_func = re_generator.re_generator\r\n```\r\nand use it in your project\r\n```\r\nyour_code.py\r\n```\r\n\r\n```python\r\nfrom cfg import your_func\r\nprint(your_func(r\"69[^0-9]abc[a-zA-Z]22[ 8]\"))\r\n```\r\n    '69\u6211abcb228'\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Package for random data generation via ReGex",
    "version": "0.1.8",
    "split_keywords": [
        "qa",
        "random string",
        "reverse regular expression",
        "regex generator",
        "testing",
        "autotesting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49de78e18c3fb8e92e2520904827b72e297beed331228ddf2d606d5a765137d3",
                "md5": "f8e4c30a5d2bd542773c846016dd3c67",
                "sha256": "36ae15f384b641d2912848bf6753d15d6c645e8e6aa905b00b0a6173c971d9e0"
            },
            "downloads": -1,
            "filename": "re_generate-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8e4c30a5d2bd542773c846016dd3c67",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7, <4",
            "size": 6857,
            "upload_time": "2023-04-02T18:48:54",
            "upload_time_iso_8601": "2023-04-02T18:48:54.249608Z",
            "url": "https://files.pythonhosted.org/packages/49/de/78e18c3fb8e92e2520904827b72e297beed331228ddf2d606d5a765137d3/re_generate-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a31b239537de8ec50943592d5084c370a74e8b0521b638444a823ab07f1c1dd5",
                "md5": "6c11d78c9a41f5938f963db0f3a50478",
                "sha256": "4ea702b3f965b811f6bf2aeb4300bfa4876239327136e51d333c172f2f724896"
            },
            "downloads": -1,
            "filename": "re-generate-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "6c11d78c9a41f5938f963db0f3a50478",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7, <4",
            "size": 7168,
            "upload_time": "2023-04-02T18:48:55",
            "upload_time_iso_8601": "2023-04-02T18:48:55.596427Z",
            "url": "https://files.pythonhosted.org/packages/a3/1b/239537de8ec50943592d5084c370a74e8b0521b638444a823ab07f1c1dd5/re-generate-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-02 18:48:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Warrfie",
    "github_project": "re-generate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "re-generate"
}
        
Elapsed time: 0.05324s