{"id":21820624,"url":"https://github.com/sue445/google_holiday_calendar","last_synced_at":"2025-04-07T11:06:52.641Z","repository":{"id":14400795,"uuid":"17111455","full_name":"sue445/google_holiday_calendar","owner":"sue445","description":"Get holidays via Google Calendar.","archived":false,"fork":false,"pushed_at":"2025-01-17T12:24:02.000Z","size":398,"stargazers_count":22,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T09:08:08.737Z","etag":null,"topics":["gem","google-calendar"],"latest_commit_sha":null,"homepage":"https://sue445.github.io/google_holiday_calendar/","language":"Ruby","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/sue445.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2014-02-23T16:18:11.000Z","updated_at":"2025-01-17T12:24:04.000Z","dependencies_parsed_at":"2023-12-11T13:48:19.302Z","dependency_job_id":"0dbe6f58-f64e-4fcf-a2d4-4c2eeb5337e0","html_url":"https://github.com/sue445/google_holiday_calendar","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fgoogle_holiday_calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fgoogle_holiday_calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fgoogle_holiday_calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fgoogle_holiday_calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sue445","download_url":"https://codeload.github.com/sue445/google_holiday_calendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640462,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gem","google-calendar"],"created_at":"2024-11-27T16:38:03.577Z","updated_at":"2025-04-07T11:06:52.620Z","avatar_url":"https://github.com/sue445.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoogleHolidayCalendar\n\n[![Gem Version](https://badge.fury.io/rb/google_holiday_calendar.png)](http://badge.fury.io/rb/google_holiday_calendar)\n[![test](https://github.com/sue445/google_holiday_calendar/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/google_holiday_calendar/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/sue445/google_holiday_calendar/badge.png)](https://coveralls.io/r/sue445/google_holiday_calendar)\n[![Code Climate](https://codeclimate.com/github/sue445/google_holiday_calendar.png)](https://codeclimate.com/github/sue445/google_holiday_calendar)\n\nGet holidays via Google Calendar.\n\n## Requirements\n* ruby 2.0.0+\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'google_holiday_calendar'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install google_holiday_calendar\n\n## Getting API key\n### 1. Create GCP project\nhttps://console.cloud.google.com/projectcreate\n\n![create-project](img/create-project.png)\n\n### 2. Go to credentials\n![dashboard](img/dashboard.png)\n\n### 3. Create credential with API key\n![create-credential](img/create-credential.png)\n\n### 4. Enable restrictions (Optional)\nClick RESTRICT KEY\n\n![api-key-created](img/api-key-created.png)\n\ne.g. \"IP addresses\" in Application restrictions\n\n![application-restrictions](img/application-restrictions.png)\n\n### 5. Enable calendar API\nGo to Library\n\n![dashboard-library](img/dashboard-library.png)\n\nSearch with \"Calendar\" and enable \"Google Calendar API\".\n\n![search-apis](img/search-apis.png)\n\n![enable-google-calendar-api](img/enable-google-calendar-api.png)\n\n## Usage (via ruby)\n\n```ruby\nrequire \"google_holiday_calendar\"\n\nusa_calendar = GoogleHolidayCalendar::Calendar.new(country: \"usa\", lang: \"en\", api_key: \"YOUR_API_KEY\")\n\nusa_calendar.holidays(start_date: \"2014-01-01\", end_date: \"2014-03-01\", limit: 5)\n# =\u003e {Wed, 01 Jan 2014=\u003e\"New Year's Day\", Mon, 20 Jan 2014=\u003e\"Martin Luther King Day\", Fri, 14 Feb 2014=\u003e\"Valentine's Day\", Mon, 17 Feb 2014=\u003e\"Presidents' Day (Washington's Birthday)\"}\n\njapan_calendar = GoogleHolidayCalendar::Calendar.new(country: \"japanese\", lang: \"ja\", api_key: \"YOUR_API_KEY\")\n\njapan_calendar.holidays(start_date: \"2014-01-01\", end_date: \"2014-03-01\", limit: 5)\n# =\u003e {Wed, 01 Jan 2014=\u003e\"元日\", Thu, 02 Jan 2014=\u003e\"銀行休業日\", Fri, 03 Jan 2014=\u003e\"銀行休業日\", Mon, 13 Jan 2014=\u003e\"成人の日\", Tue, 11 Feb 2014=\u003e\"建国記念の日\"}\n\njapan_calendar.holiday?(\"2014-01-01\")\n# =\u003e true\n\njapan_calendar.holiday?(\"2014-02-01\")\n# =\u003e false\n```\n\n## Usage (via bash)\n\n```sh\n# get holidays (today - 1 month after)\n$ date +\"%Y-%m-%d\"\n2014-02-24\n\n$ GOOGLE_API_KEY=xxxx google_holiday_calendar\n2014-03-09: Daylight Saving Time starts\n```\n\n```sh\n# get holidays (2014/01/01 - 2014/07/01)\n$ GOOGLE_API_KEY=xxxx google_holiday_calendar --start-date=2014-01-01 --end-date=2014-07-01\n2014-01-01: New Year's Day\n2014-01-20: Martin Luther King Day\n2014-02-14: Valentine's Day\n2014-02-17: Presidents' Day (Washington's Birthday)\n2014-03-09: Daylight Saving Time starts\n2014-04-13: Thomas Jefferson's Birthday\n2014-04-20: Easter Sunday\n2014-05-11: Mothers' Day\n2014-05-26: Memorial Day\n2014-06-15: Fathers' Day\n```\n\n```sh\n# get holidays (with limit)\n$ GOOGLE_API_KEY=xxxx google_holiday_calendar --start-date=2014-01-01 --end-date=2014-07-01 --limit=3\n2014-02-14: Valentine's Day\n2014-02-17: Presidents' Day (Washington's Birthday)\n2014-04-13: Thomas Jefferson's Birthday\n```\n\n```sh\n# get holidays (specify country and language)\n$ GOOGLE_API_KEY=xxxx google_holiday_calendar --start-date=2014-01-01 --end-date=2014-07-01 --country=japanese --lang=ja\n2014-01-01: 元日\n2014-01-02: 銀行休業日\n2014-01-03: 銀行休業日\n2014-01-13: 成人の日\n2014-02-11: 建国記念の日\n2014-03-21: 春分の日\n2014-04-29: 昭和の日\n2014-05-03: 憲法記念日\n2014-05-04: みどりの日\n2014-05-06: みどりの日 振替休日\n```\n\n## More reference\nhttps://sue445.github.io/google_holiday_calendar/\n\n## Contributing\n\n1. Fork it ( http://github.com/sue445/google_holiday_calendar/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsue445%2Fgoogle_holiday_calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsue445%2Fgoogle_holiday_calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsue445%2Fgoogle_holiday_calendar/lists"}