generator-dates


Namegenerator-dates JSON
Version 0.2.5 PyPI version JSON
download
home_pagehttps://github.com/Triram-2/generator_dates
SummaryA Python package to generate random dates in different formats and languages.
upload_time2025-02-07 13:15:45
maintainerNone
docs_urlNone
authorMisha
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            """
# Generator Dates

Generator Dates is a Python library for generating random dates in various formats and languages.  
Supports English (`en`) and Russian (`ru`) languages.

## Features

- Random date generation with a customizable format
- Support for full and abbreviated month names
- Selection of day, month, and year ranges
- Saving history of generated dates
- Output support as `datetime` and `date` objects
- Handling of invalid ranges

## Installation

Install via `pip`:

```sh
pip install generator_dates
```

Or manually:

```sh
git clone https://github.com/yourusername/generator_dates.git
cd generator_dates
pip install .
```

## Usage

```python
from generator_dates import GeneratorDates

generator = GeneratorDates(format="{d} {month} {y}", lang="ru", save_history=True)
random_date = generator.generate_date(range_day=(1, 30), range_month=(1, 12), range_year=(1900, 2023))
print(random_date)  # Example: 12 марта 1987

# View history of generated dates
print(generator.history)
```

## Settings

- **`format`** – date format string:
  - `{d}` – day of the month
  - `{m}` – month number
  - `{y}` – year
  - `{mon}` – abbreviated month name
  - `{month}` – full month name
  - `'datetime'` – returns a `datetime` object
  - `'date'` – returns a `date` object
- **`lang`** – language (`en` or `ru`)
- **`save_history`** – whether to save the history of generated dates (default is `True`)

## Exceptions

- `LanguageError` – if an unsupported language is provided.
- `ValueError` – if invalid ranges for day, month, or year are given.

## License

This project is licensed under the MIT License.
"""

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Triram-2/generator_dates",
    "name": "generator-dates",
    "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/59/0b/0cb5bc7f9d6376238324d1fe576bb2227b68b472792a3cdba55c10351ad1/generator_dates-0.2.5.tar.gz",
    "platform": null,
    "description": "\"\"\"\n# Generator Dates\n\nGenerator Dates is a Python library for generating random dates in various formats and languages.  \nSupports English (`en`) and Russian (`ru`) languages.\n\n## Features\n\n- Random date generation with a customizable format\n- Support for full and abbreviated month names\n- Selection of day, month, and year ranges\n- Saving history of generated dates\n- Output support as `datetime` and `date` objects\n- Handling of invalid ranges\n\n## Installation\n\nInstall via `pip`:\n\n```sh\npip install generator_dates\n```\n\nOr manually:\n\n```sh\ngit clone https://github.com/yourusername/generator_dates.git\ncd generator_dates\npip install .\n```\n\n## Usage\n\n```python\nfrom generator_dates import GeneratorDates\n\ngenerator = GeneratorDates(format=\"{d} {month} {y}\", lang=\"ru\", save_history=True)\nrandom_date = generator.generate_date(range_day=(1, 30), range_month=(1, 12), range_year=(1900, 2023))\nprint(random_date)  # Example: 12 \u043c\u0430\u0440\u0442\u0430 1987\n\n# View history of generated dates\nprint(generator.history)\n```\n\n## Settings\n\n- **`format`** \u2013 date format string:\n  - `{d}` \u2013 day of the month\n  - `{m}` \u2013 month number\n  - `{y}` \u2013 year\n  - `{mon}` \u2013 abbreviated month name\n  - `{month}` \u2013 full month name\n  - `'datetime'` \u2013 returns a `datetime` object\n  - `'date'` \u2013 returns a `date` object\n- **`lang`** \u2013 language (`en` or `ru`)\n- **`save_history`** \u2013 whether to save the history of generated dates (default is `True`)\n\n## Exceptions\n\n- `LanguageError` \u2013 if an unsupported language is provided.\n- `ValueError` \u2013 if invalid ranges for day, month, or year are given.\n\n## License\n\nThis project is licensed under the MIT License.\n\"\"\"\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package to generate random dates in different formats and languages.",
    "version": "0.2.5",
    "project_urls": {
        "Homepage": "https://github.com/Triram-2/generator_dates"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "459882bc3f5c094e1e8f749a597242b5c5c525948a1cef14a8501260a4cbda9c",
                "md5": "d623a7178d01c7836302a73a9a7fb26b",
                "sha256": "89ffa55e3c41c462635e4ced257f3596dea2c9dff3c7b715256db39d859f6eb8"
            },
            "downloads": -1,
            "filename": "generator_dates-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d623a7178d01c7836302a73a9a7fb26b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5266,
            "upload_time": "2025-02-07T13:15:43",
            "upload_time_iso_8601": "2025-02-07T13:15:43.560989Z",
            "url": "https://files.pythonhosted.org/packages/45/98/82bc3f5c094e1e8f749a597242b5c5c525948a1cef14a8501260a4cbda9c/generator_dates-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "590b0cb5bc7f9d6376238324d1fe576bb2227b68b472792a3cdba55c10351ad1",
                "md5": "6718731cb8fd0895f8c4a57785b0752c",
                "sha256": "d049db53fadbade0a4b61602efab924c8c9124cc17dc2a0880a0bb67c0201881"
            },
            "downloads": -1,
            "filename": "generator_dates-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "6718731cb8fd0895f8c4a57785b0752c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4823,
            "upload_time": "2025-02-07T13:15:45",
            "upload_time_iso_8601": "2025-02-07T13:15:45.010749Z",
            "url": "https://files.pythonhosted.org/packages/59/0b/0cb5bc7f9d6376238324d1fe576bb2227b68b472792a3cdba55c10351ad1/generator_dates-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-07 13:15:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Triram-2",
    "github_project": "generator_dates",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "generator-dates"
}
        
Elapsed time: 2.75782s