{"id":25171420,"url":"https://github.com/basemax/persian-holidays-api","last_synced_at":"2026-02-03T11:35:00.676Z","repository":{"id":270058320,"uuid":"908243463","full_name":"BaseMax/persian-holidays-api","owner":"BaseMax","description":"An API for fetching Persian (Shamsi), Gregorian, and Hijri holidays. The project scrapes holiday data from the time.ir website, processes the data, and outputs it as JSON files. This API allows developers to retrieve holiday data for any given year and month, with the dates converted into both Persian and English digits.","archived":false,"fork":false,"pushed_at":"2024-12-25T15:56:42.000Z","size":245,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T11:57:31.296Z","etag":null,"topics":["api","api-json","holiday","holiday-api","holiday-calculation","holidays","holidays-api","holidays-calendar","json"],"latest_commit_sha":null,"homepage":"https://basemax.github.io/persian-holidays-api/holidays.json","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-25T14:57:53.000Z","updated_at":"2024-12-30T14:38:12.000Z","dependencies_parsed_at":"2024-12-28T05:09:16.082Z","dependency_job_id":"12df482b-7a65-44e1-af3c-cf66534d7ba4","html_url":"https://github.com/BaseMax/persian-holidays-api","commit_stats":null,"previous_names":["basemax/persian-holidays-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/persian-holidays-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fpersian-holidays-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fpersian-holidays-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fpersian-holidays-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fpersian-holidays-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/persian-holidays-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fpersian-holidays-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29044428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-json","holiday","holiday-api","holiday-calculation","holidays","holidays-api","holidays-calendar","json"],"created_at":"2025-02-09T09:20:13.489Z","updated_at":"2026-02-03T11:35:00.658Z","avatar_url":"https://github.com/BaseMax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Persian Holidays API\n\nAn API for fetching Persian (Shamsi), Gregorian, and Hijri holidays. The project scrapes holiday data from the `time.ir` website, processes the data, and outputs it as JSON files. This API allows developers to retrieve holiday data for any given year and month, with the dates converted into both Persian and English digits.\n\n### Demo: https://basemax.github.io/persian-holidays-api/holidays.json\n\n## Features\n\n- Fetches holidays for a given year and month.\n- Converts dates into Shamsi, Gregorian, or Hijri formats.\n- Handles both Persian and Arabic digits, converting them into English digits.\n- Outputs holiday data as structured JSON files.\n\n## Requirements\n\nTo run this project, you'll need the following Python packages:\n\n- `requests`\n- `beautifulsoup4`\n- `re` (for regex operations)\n\nYou can install the required dependencies using the `requirements.txt` file:\n\n```bash\npip install -r requirements.txt\n```\n\n### How It Works\n\nThe script scrapes the holiday data from the website time.ir. It retrieves the list of holidays for a given year and month, then processes the data by:\n\n- Identifying whether each event is a holiday.\n- Extracting the event name.\n- Converting the event date into Persian (Shamsi), Gregorian, or Hijri format.\n- Converting Persian and Arabic digits to English digits.\n- Saving the holiday data in JSON format.\n\n### Example of JSON Output\n\nHere is an example of what the JSON output looks like:\n\n```json\n[\n    {\n        \"is_holiday\": true,\n        \"event_name\": \"جشن نوروز/جشن سال نو\",\n        \"date\": {\n            \"type\": \"shamsi\",\n            \"date\": [\n                \"1\",\n                \"فروردین\"\n            ]\n        }\n    },\n    {\n        \"is_holiday\": false,\n        \"event_name\": \"روز جهانی شادی\",\n        \"date\": {\n            \"type\": \"gregorian\",\n            \"date\": [\n                \"20\",\n                \"March\"\n            ]\n        }\n    },\n    {\n        \"is_holiday\": true,\n        \"event_name\": \"عیدنوروز\",\n        \"date\": {\n            \"type\": \"shamsi\",\n            \"date\": [\n                \"2\",\n                \"فروردین\"\n            ]\n        }\n    }\n]\n```\n\n### JSON Schema\n\nThe structure of the JSON file is as follows:\n\n- `is_holiday`: A boolean indicating whether the event is a holiday.\n- `event_name: The name of the event in Persian.\n- `date:\n  - `type`: The type of the date (either \"shamsi\", \"gregorian\", or \"hijri\").\n  - `date`: A list containing the day and month of the event. For Shamsi dates, the month is in Persian, while for Gregorian and Hijri dates, the month is in English.\n\n### Example Usage\n\nTo fetch holidays for a specific year and month:\n\n```python\nfrom persianholiday import get_for_a_month\n\n# Specify the year and month\nyear = 1403  # Persian year\nmonth = 1    # January\n\nholidays = get_for_a_month(year, month)\nprint(holidays)\n```\n\nThis will fetch the holidays for the specified month and year and output the holidays in the structure defined above.\n\n### File Structure\n\n```bash\nC:\\Files\\Projects\\persian-holidays-api\n├── .git\n├── .gitignore\n├── LICENSE\n├── README.md\n├── holidays-1.json\n├── holidays-2.json\n├── holidays-3.json\n├── holidays-4.json\n├── holidays-5.json\n├── holidays-6.json\n├── holidays-7.json\n├── holidays-8.json\n├── holidays-9.json\n├── holidays-10.json\n├── holidays-11.json\n├── holidays-12.json\n├── holidays.json\n├── requirements.txt\n├── test.py\n├── update.py\n└── persianholiday.py\n```\n\n### License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n### Contributing\n\nFeel free to fork the repository and submit pull requests for improvements. If you encounter any issues, please report them via the Issues section.\n\nCopyright 2024, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fpersian-holidays-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fpersian-holidays-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fpersian-holidays-api/lists"}