# GeneratorNames
## Overview
GeneratorNames is a Python module that generates random names based on predefined lists of first and last names. It supports both Russian and English names with gender differentiation.
## Features
- Generate random names in English and Russian.
- Supports both male and female name generation.
- Customizable output format.
- Option to save name generation history.
## Installation
```sh
pip install generator-names
```
## Usage
### Initializing the Generator
```python
from generator_names import GeneratorNames
generator = GeneratorNames(save_history=True, format='{firstname} {lastname}')
```
- `save_history` (bool): If `True`, stores generated names in history.
- `format` (str): Defines the output format using `{firstname}` and `{lastname}` placeholders. If set to `'dict'`, returns a dictionary.
### Generating Names
```python
# Generate a random male name in English
en_name = generator.generate_name(language='en', gender='male')
print(en_name)
# Generate a random female name in Russian
ru_female_name = generator.generate_name(language='ru', gender='female')
print(ru_female_name)
```
- `language` (str): `'en'` for English, `'ru'` for Russian.
- `gender` (str): `'male'` or `'female'`.
### Custom Formatting
```python
generator = GeneratorNames(format="{lastname}, {firstname}")
print(generator.generate_name(language='en')) # Output: Doe, John
```
### Returning as Dictionary
```python
generator = GeneratorNames(format='dict')
name_dict = generator.generate_name(language='ru')
print(name_dict) # Output: {'firstname': 'Иван', 'lastname': 'Петров'}
```
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/generator-names",
"name": "generator-names",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Misha",
"author_email": "bobyyy239@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d0/22/aec791b2a2dc4b300809809aff3afd525a8c281e6da58384a5c9d5c35024/generator_names-0.3.0.tar.gz",
"platform": null,
"description": "# GeneratorNames\n\n## Overview\nGeneratorNames is a Python module that generates random names based on predefined lists of first and last names. It supports both Russian and English names with gender differentiation.\n\n## Features\n- Generate random names in English and Russian.\n- Supports both male and female name generation.\n- Customizable output format.\n- Option to save name generation history.\n\n## Installation\n```sh\npip install generator-names\n```\n\n## Usage\n### Initializing the Generator\n```python\nfrom generator_names import GeneratorNames\n\ngenerator = GeneratorNames(save_history=True, format='{firstname} {lastname}')\n```\n- `save_history` (bool): If `True`, stores generated names in history.\n- `format` (str): Defines the output format using `{firstname}` and `{lastname}` placeholders. If set to `'dict'`, returns a dictionary.\n\n### Generating Names\n```python\n# Generate a random male name in English\nen_name = generator.generate_name(language='en', gender='male')\nprint(en_name)\n\n# Generate a random female name in Russian\nru_female_name = generator.generate_name(language='ru', gender='female')\nprint(ru_female_name)\n```\n- `language` (str): `'en'` for English, `'ru'` for Russian.\n- `gender` (str): `'male'` or `'female'`.\n\n### Custom Formatting\n```python\ngenerator = GeneratorNames(format=\"{lastname}, {firstname}\")\nprint(generator.generate_name(language='en')) # Output: Doe, John\n```\n\n### Returning as Dictionary\n```python\ngenerator = GeneratorNames(format='dict')\nname_dict = generator.generate_name(language='ru')\nprint(name_dict) # Output: {'firstname': '\u0418\u0432\u0430\u043d', 'lastname': '\u041f\u0435\u0442\u0440\u043e\u0432'}\n```\n\n## License\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A module for generating random names in English and Russian.",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/yourusername/generator-names"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3f799a2d637c467a06231487509e9c305fcf8f858eb93a30bde4d3340abcf903",
"md5": "f659a5a94688b4690c1c322885bd4a27",
"sha256": "b61e2b78f12f0b562aadbd77337575236d34fcbdd19ebf6c6cc0995783b340e3"
},
"downloads": -1,
"filename": "generator_names-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f659a5a94688b4690c1c322885bd4a27",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 18628,
"upload_time": "2025-02-07T16:32:30",
"upload_time_iso_8601": "2025-02-07T16:32:30.113713Z",
"url": "https://files.pythonhosted.org/packages/3f/79/9a2d637c467a06231487509e9c305fcf8f858eb93a30bde4d3340abcf903/generator_names-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d022aec791b2a2dc4b300809809aff3afd525a8c281e6da58384a5c9d5c35024",
"md5": "4b64f60b59271adbb860bc1e3588caf1",
"sha256": "8e71be9570afbb3526b8aed03ac920ca9d7754f639f852a0f068d1502d9b876e"
},
"downloads": -1,
"filename": "generator_names-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "4b64f60b59271adbb860bc1e3588caf1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 18445,
"upload_time": "2025-02-07T16:32:32",
"upload_time_iso_8601": "2025-02-07T16:32:32.262197Z",
"url": "https://files.pythonhosted.org/packages/d0/22/aec791b2a2dc4b300809809aff3afd525a8c281e6da58384a5c9d5c35024/generator_names-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-07 16:32:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "generator-names",
"github_not_found": true,
"lcname": "generator-names"
}