Name | bnf-string-generator JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A tool for generating random strings based on Backus-Naur Form (BNF) grammar. |
upload_time | 2024-12-09 20:58:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | MIT |
keywords |
bnf
generator
grammar
random
string
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# BNF String Generator
## Description
This is a tool for generating random strings from grammars defined in Backus-Naur Form (BNF). It operates by iteratively expanding non-terminal symbols into their corresponding production rules until only terminal symbols remain.
### Install from PyPI:
```bash
pip install bnf-string-generator
```
### Install from Source:
Clone the repository and install:
```bash
git clone https://github.com/yourusername/bnf-string-generator.git
cd bnf-string-generator
pip install .
```
## Usage
You can generate random strings by providing a BNF grammar. Here’s an example:
### Example:
```python
from bnf_string_generator import bnf_string_generator
bnf_grammar = """
<greeting> ::= <salutation> | <salutation> <intro> <EOL> <reply>
<reply> ::= <salutation>
<salutation> ::= "Hello" | "Hi" | "Hey" | "Greetings"
<intro> ::= ", I'm " <name>
<name> ::= "Alice" | "Bob" | "Charlie" | "Sam" | "Emma" | "John"
"""
random_string = bnf_string_generator(bnf_grammar)
print(random_string)
```
This will generate a random greeting like:
```
Hello, I'm Bob
```
Raw data
{
"_id": null,
"home_page": null,
"name": "bnf-string-generator",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "BNF, generator, grammar, random, string",
"author": null,
"author_email": "Romelium <romeomanzanillaiii@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f8/61/d08cbae7900b92fdeb4fe257087f75d6f45b95955a5c3dbca97c3e75c4a8/bnf_string_generator-0.1.0.tar.gz",
"platform": null,
"description": "# BNF String Generator\n\n## Description\n\nThis is a tool for generating random strings from grammars defined in Backus-Naur Form (BNF). It operates by iteratively expanding non-terminal symbols into their corresponding production rules until only terminal symbols remain.\n\n### Install from PyPI:\n\n```bash\npip install bnf-string-generator\n```\n\n### Install from Source:\n\nClone the repository and install:\n\n```bash\ngit clone https://github.com/yourusername/bnf-string-generator.git\ncd bnf-string-generator\npip install .\n```\n\n## Usage\n\nYou can generate random strings by providing a BNF grammar. Here\u2019s an example:\n\n### Example:\n\n```python\nfrom bnf_string_generator import bnf_string_generator\n\nbnf_grammar = \"\"\"\n<greeting> ::= <salutation> | <salutation> <intro> <EOL> <reply>\n<reply> ::= <salutation>\n<salutation> ::= \"Hello\" | \"Hi\" | \"Hey\" | \"Greetings\"\n<intro> ::= \", I'm \" <name>\n<name> ::= \"Alice\" | \"Bob\" | \"Charlie\" | \"Sam\" | \"Emma\" | \"John\"\n\"\"\"\n\nrandom_string = bnf_string_generator(bnf_grammar)\nprint(random_string)\n```\n\nThis will generate a random greeting like:\n\n```\nHello, I'm Bob\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for generating random strings based on Backus-Naur Form (BNF) grammar.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/romelium/bnf-string-generator",
"Issues": "https://github.com/romelium/bnf-string-generator/issues"
},
"split_keywords": [
"bnf",
" generator",
" grammar",
" random",
" string"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fc7b8d8b14a870cd35e04dcf57f125bdcdc89cf871071a668e336e5c48248925",
"md5": "147cfca37535db484f53bd0e34b40622",
"sha256": "8878f58bd44071afb63e7040abc863ad71902eddfdd057beeb9c885b9fc8059d"
},
"downloads": -1,
"filename": "bnf_string_generator-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "147cfca37535db484f53bd0e34b40622",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4459,
"upload_time": "2024-12-09T20:58:03",
"upload_time_iso_8601": "2024-12-09T20:58:03.566992Z",
"url": "https://files.pythonhosted.org/packages/fc/7b/8d8b14a870cd35e04dcf57f125bdcdc89cf871071a668e336e5c48248925/bnf_string_generator-0.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f861d08cbae7900b92fdeb4fe257087f75d6f45b95955a5c3dbca97c3e75c4a8",
"md5": "673263d825b94614d91e03a8472b6847",
"sha256": "9c3496b127acb00a49e50c6cce49a16a6787fc9db117426e3eee8fd8e2220b2d"
},
"downloads": -1,
"filename": "bnf_string_generator-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "673263d825b94614d91e03a8472b6847",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3718,
"upload_time": "2024-12-09T20:58:06",
"upload_time_iso_8601": "2024-12-09T20:58:06.145201Z",
"url": "https://files.pythonhosted.org/packages/f8/61/d08cbae7900b92fdeb4fe257087f75d6f45b95955a5c3dbca97c3e75c4a8/bnf_string_generator-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-09 20:58:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "romelium",
"github_project": "bnf-string-generator",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bnf-string-generator"
}