{"slug": "stop-hard-coding-holidays-4-free-calendar-datasets-for-developers", "title": "Stop hard-coding holidays: 4 free calendar datasets for developers", "summary": "ToolWix released four free calendar datasets as plain CSV and JSON under a CC BY 4.0 license, covering business days and payroll schedules for 2026-2030, DST clock changes across IANA zones, a day-by-day Nepali Bikram Sambat calendar from 2000-2090 BS, and seven world calendars side by side. The datasets are hosted on GitHub and Hugging Face, carry Zenodo DOIs for version pinning, and include a 'verified' flag distinguishing government-checked years from rule-based ones. The company notes the data ends in 2030 and that code should raise errors for out-of-range dates rather than treating them as ordinary days.", "body_md": "Date bugs rarely show up on the day you write the code. They show up on a holiday, on a clock-change weekend, or when someone needs a calendar your library does not have.\n\nWe publish four calendar datasets as plain CSV and JSON, generated from the same code as the date tools on [ToolWix](https://toolwix.com/) (disclosure: that is our site). They are CC BY 4.0, so commercial use is fine with credit.\n\n| Dataset | Covers | Links | \n|---|---|---|\n| Business days and payroll | 2026-2030; US, UK (3 regions), Canada, Australia | [GitHub](https://github.com/toolwix/business-days-dataset) ,[Hugging Face](https://huggingface.co/datasets/toolwix/business-days) | \n| DST clock changes | 2026-2030; every IANA zone that changes | [GitHub](https://github.com/toolwix/dst-transitions-dataset) ,[Hugging Face](https://huggingface.co/datasets/toolwix/dst-transitions) | \n| Nepali (Bikram Sambat) calendar | 2000-2090 BS, day by day | [GitHub](https://github.com/toolwix/nepali-calendar-dataset) ,[Hugging Face](https://huggingface.co/datasets/toolwix/nepali-calendar) | \n| World calendars | 2026-2030; seven calendars side by side | [GitHub](https://github.com/toolwix/world-calendars-dataset) ,[Hugging Face](https://huggingface.co/datasets/toolwix/world-calendars) | \n\nThe examples below use pandas and read straight from GitHub.\n\n``` python\nfrom datetime import date, timedelta\nimport pandas as pd\n\nBASE = \"https://raw.githubusercontent.com/toolwix\"\nholidays = pd.read_csv(f\"{BASE}/business-days-dataset/main/public-holidays.csv\")\nus = set(holidays.loc[holidays.region == \"us\", \"date\"])\n\ndef add_business_days(start, n):\n    day = start\n    while n > 0:\n        day += timedelta(days=1)\n        if day.weekday() < 5 and day.isoformat() not in us:\n            n -= 1\n    return day\n\nprint(add_business_days(date(2026, 12, 23), 3))  # 2026-12-29\n```\n\nOnly national holidays are included, and the data ends in 2030. In real code, raise an error for dates outside the range instead of treating them as ordinary days.\n\n```\npaydays = pd.read_csv(f\"{BASE}/business-days-dataset/main/paydays.csv\")\nmoved = paydays[(paydays.region == \"us\") & (paydays.schedule == \"weekly\") & paydays.moved]\nprint(moved[[\"scheduled_date\", \"pay_date\", \"holiday\"]].head().to_string(index=False))\n```\n\nThe rule here is \"pay on the previous business day\". That is a common convention, not a law.\n\n```\ndst = pd.read_csv(f\"{BASE}/dst-transitions-dataset/main/dst-transitions.csv\")\nrows = dst[dst.zone.isin([\"America/New_York\", \"Europe/London\"]) & (dst.year == 2027)]\nprint(rows[[\"zone\", \"transition_utc\", \"direction\"]].to_string(index=False))\n```\n\nIn 2027 the US moves forward on 14 March and the UK on 28 March. They move back on 31 October (UK) and 7 November (US). A recurring 9:00 New York meeting lands at a different London time in between.\n\nBikram Sambat month lengths do not follow a formula, so a lookup table is the practical way.\n\n``` js\nconst url = \"https://raw.githubusercontent.com/toolwix/nepali-calendar-dataset/main/nepali-calendar-daily.csv\";\nconst text = await (await fetch(url)).text();\n\nconst toBS = new Map(\n  text.trim().split(/\\r?\\n/).slice(1).map((line) => {\n    const [ad, , bs] = line.split(\",\");\n    return [ad, bs];\n  })\n);\n\nconsole.log(toBS.get(\"2026-04-14\")); // 2083-01-01\n```\n\nFor production, bundle a copy of the file rather than fetching it from GitHub at run time.\n\n``` python\nfrom datasets import load_dataset\n\nmonths = load_dataset(\"toolwix/business-days\", \"by_month\", split=\"train\")\n```\n\n`verified` column says whether a region and year were checked against the official government calendar. `false` means rule-based, so one-off holidays may be missing.\nPin a version if your results must be reproducible. Each dataset has a DOI on Zenodo: [business days](https://doi.org/10.5281/zenodo.24710395), [DST](https://doi.org/10.5281/zenodo.24710405), [Nepali](https://doi.org/10.5281/zenodo.24710413), [world calendars](https://doi.org/10.5281/zenodo.24710417).\n\nIf you find a wrong date, tell us through the [contact page](https://toolwix.com/contact/). What calendar data do you keep rebuilding in your own projects?", "url": "https://wpnews.pro/news/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers", "canonical_source": "https://dev.to/toolwix/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers-153j", "published_at": "2026-12-01 10:09:34+00:00", "updated_at": "2026-12-01 10:13:20.223808+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["ToolWix", "GitHub", "Hugging Face", "Zenodo"], "also_reported_by": [], "takeaway": "ToolWix's CC BY 4.0 calendar datasets cover business days, DST transitions, Bikram Sambat and world calendars through 2030, but the 'verified' flag marks rule-based years where one-off holidays may be missing, so bundle and pin a version for reproducible results.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers", "markdown": "https://wpnews.pro/news/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers.md", "text": "https://wpnews.pro/news/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers.txt", "jsonld": "https://wpnews.pro/news/stop-hard-coding-holidays-4-free-calendar-datasets-for-developers.jsonld"}}