This script allows you to easily import Japanese holidays into your Notion calendar.
As of the current date (2023/04/11), there is no built-in function in Notion to import Japanese holidays.
Using this feature will import Japanese holidays as shown below.
Entries that start with the Japanese flag indicate a holiday.
Before using this script, make sure you have the following prerequisites installed:
- Node.js
- Clone or download the repository.
- Install dependencies by running
npm install
. - Create a new Notion integration by following the instructions on the official Notion API documentation.
- Copy your integration token and the URL of your Notion calendar page to
.envsample
, and rename the file to.env
. - Run
node import-japanese-holidays.js
to import Japanese holidays into your Notion calendar.
This script uses the Holidays JP API as the data source for Japanese holidays. The API provides Japanese holidays from the previous year to the next year.
Consider the following optimizations to improve the script:
- Check for duplicate data
Currently, the script does not check for duplicate holiday data. As a result, if you import the holidays today, holidays for both this year and next year will be imported. Similarly, if you import the holidays next year, holidays for both next year and the year after will be imported, which may result in duplicate entries. To prevent this, consider adding a check to ensure that each holiday is imported only once.
- User-friendly version
This script requires Node.js to be installed on your computer. If you're not familiar with Node.js, you may find it difficult to use this script. To make it more accessible, you could consider creating a user-friendly version that does not require Node.js.
- Holidays JP API for providing Japanese holidays data.