# ItalianHolidays
A simple Python helper class to determine Italian holidays with the possibility to set custom holidays. Easter holidays' calculation will work for dates between 1900-2199.
[![PyPI status](https://img.shields.io/pypi/status/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)
[![PyPI version shields.io](https://img.shields.io/pypi/v/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/italian-holidays)](https://pypi.python.org/pypi/italian-holidays/)
[![GitHub license](https://img.shields.io/github/license/giuseppebruno/italian-holidays.svg)](https://github.com/giuseppebruno/italian-holidays/blob/master/LICENSE)
## Install
### Using Pip
```bash
pip install italian-holidays
```
## Usage
```python
from italian_holidays import italian_holidays
from datetime import datetime
custom_holidays = ["01-03", "01-05"] # date format: month-day | in this example: 3 January, 5 January
# But accepts also array of datetime object
custom_holidays = [datetime(2021, 1, 3), datetime(2021, 1, 5)]
holidays = italian_holidays(custom_holidays) # or simply italian_holidays() if you have no custom holidays to set
# Passing string
is_holiday = holidays.is_holiday("2024-01-03")
print(is_holiday) # True
# Passing datetime object
day = datetime(2031, 4, 14)
is_holiday = holidays.is_holiday(day)
print(is_holiday) # True
# Getting holiday's name (return None if date is not an italian holiday, return 'Custom holiday' if is one of the given dates)
holiday_name = holidays.holiday_name("2020-11-01")
print(holiday_name) # All Saints' Day
```
## Licence
Source code can be found on [github](https://github.com/giuseppebruno/italian-holidays), licenced under [MIT](http://opensource.org/licenses/mit-license.php).
Developed by [Giuseppe Bruno](https://gbrunodev.it)
Raw data
{
"_id": null,
"home_page": "https://github.com/giuseppebruno/italian-holidays",
"name": "italian-holidays",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "italian, holidays",
"author": "Giuseppe Bruno",
"author_email": "Giuseppe Bruno <info@gbrunodev.it>",
"download_url": "https://files.pythonhosted.org/packages/fc/ca/106fde4631965209e75a57af09707d7c90c3f4ded96fcb48eca1a50067f5/italian_holidays-0.0.5.tar.gz",
"platform": null,
"description": "# ItalianHolidays\n\nA simple Python helper class to determine Italian holidays with the possibility to set custom holidays. Easter holidays' calculation will work for dates between 1900-2199.\n\n[![PyPI status](https://img.shields.io/pypi/status/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/italian-holidays.svg)](https://pypi.python.org/pypi/italian-holidays/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/italian-holidays)](https://pypi.python.org/pypi/italian-holidays/)\n[![GitHub license](https://img.shields.io/github/license/giuseppebruno/italian-holidays.svg)](https://github.com/giuseppebruno/italian-holidays/blob/master/LICENSE)\n\n## Install\n\n### Using Pip\n\n```bash\npip install italian-holidays\n```\n\n## Usage\n\n```python\nfrom italian_holidays import italian_holidays\nfrom datetime import datetime\n\ncustom_holidays = [\"01-03\", \"01-05\"] # date format: month-day | in this example: 3 January, 5 January\n\n# But accepts also array of datetime object\ncustom_holidays = [datetime(2021, 1, 3), datetime(2021, 1, 5)]\n\nholidays = italian_holidays(custom_holidays) # or simply italian_holidays() if you have no custom holidays to set\n\n# Passing string\nis_holiday = holidays.is_holiday(\"2024-01-03\")\nprint(is_holiday) # True\n\n# Passing datetime object\nday = datetime(2031, 4, 14)\nis_holiday = holidays.is_holiday(day)\nprint(is_holiday) # True\n\n# Getting holiday's name (return None if date is not an italian holiday, return 'Custom holiday' if is one of the given dates)\nholiday_name = holidays.holiday_name(\"2020-11-01\")\nprint(holiday_name) # All Saints' Day\n```\n\n## Licence\n\nSource code can be found on [github](https://github.com/giuseppebruno/italian-holidays), licenced under [MIT](http://opensource.org/licenses/mit-license.php).\n\nDeveloped by [Giuseppe Bruno](https://gbrunodev.it)\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A simple Python helper class to determine Italian holidays with the possibility to set custom holidays.",
"version": "0.0.5",
"project_urls": {
"Homepage": "https://github.com/giuseppebruno/italian-holidays"
},
"split_keywords": [
"italian",
" holidays"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21ff219a1bf6e28a711dede99ad9fc69308eb2e0ac95ba5e4f00f423696bb991",
"md5": "0f9298f612950fc389cf76c61918b238",
"sha256": "d8f4e282b122aa217042596167885328b97b9f31a33ed78ffd398a7e4af9aabb"
},
"downloads": -1,
"filename": "italian_holidays-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0f9298f612950fc389cf76c61918b238",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 4393,
"upload_time": "2024-11-26T18:10:24",
"upload_time_iso_8601": "2024-11-26T18:10:24.214439Z",
"url": "https://files.pythonhosted.org/packages/21/ff/219a1bf6e28a711dede99ad9fc69308eb2e0ac95ba5e4f00f423696bb991/italian_holidays-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fcca106fde4631965209e75a57af09707d7c90c3f4ded96fcb48eca1a50067f5",
"md5": "453265783c877c0e741b6124b93c8c4b",
"sha256": "7cd77cb65820c6b1dcc6e91e980bf42a4073242213c4e8bb294ff1a63872bc9c"
},
"downloads": -1,
"filename": "italian_holidays-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "453265783c877c0e741b6124b93c8c4b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 4229,
"upload_time": "2024-11-26T18:10:27",
"upload_time_iso_8601": "2024-11-26T18:10:27.043935Z",
"url": "https://files.pythonhosted.org/packages/fc/ca/106fde4631965209e75a57af09707d7c90c3f4ded96fcb48eca1a50067f5/italian_holidays-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-26 18:10:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "giuseppebruno",
"github_project": "italian-holidays",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "italian-holidays"
}