string-gen
String generator by regex
Installation
Install using pip with
pip install string_gen
Example
from string_gen import StringGen
generator = StringGen(r'(A|B)\d{4}(\.|-)\d{1}')
print(generator.render())
print(generator.render())
generator = StringGen(r'[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}')
print(generator.render())
generator = StringGen(r'(A|B)\d{4}\.\d{1}')
print(generator.render_list(5))
generator = StringGen(r'\d')
print(generator.render_set(10))
Changelog
Contributing
Contributions are very welcome.
You might want to:
- Fix spelling errors
- Improve documentation
- Add tests for untested code
- Add new features
- Fix bugs
Getting started
- python 3.12
- pipenv 2023.11.15+
- Clone the repository
git clone https://github.com/tolstislon/string-gen.git
cd string-gen
- Install dev dependencies
pipenv install --dev
pipenv shell
- Run the black
pipenv run black
- Run the flake8
pipenv run flake
- Run tests
pipenv run tests