Giter Club home page Giter Club logo

google_calendar's Introduction

Introduction

This repository contains scripts to download information about regional holidays or sports event data from Google Calendar API in a csv format.

Requirements

Python 3.7 or later with following packages:

  • pandas
  • pathlib
  • google-api-python-client
  • google-auth-httplib2
  • google-auth-oauthlib

Run the following command to install the library using pip:

pip3 install -U pandas pathlib google-api-python-client google-auth-httplib2 google-auth-oauthlib

Setup

Please checkout Python Quickstart Guide to enable Calendar API for your Google account, generate and download credentials. You will also need to subscribe to the calendar of interest to make it available for downloading. Go to https://calendar.google.com/calendar/r/settings/browsecalendars and select the checkbox against the calendar of interest to subscribe.

Usage

To download Indian holidays for last, current and next year, use below command:

python holidays.py India

Holidays for other region can be downloaded by entering respective region name as argument in the command line. To find the list of accepted region names, checkout Regional holidays section at https://calendar.google.com/calendar/r/settings/browsecalendars

To download data for sports event, run the script sports.py with calendar name as the command line argument:

python sports.py "India ICC Cricket"

Calendar names for the subscribed calendars can be found under Other calendars section in the left pane of Google Calendar page

Please refer to the Calendar API Documentation for more details.

Extension

You can add/change the fields stored for each event by modifying the parser method. For example, to change the fields stored for regional holidays, modify the method _holiday_parser in holidays.py script. You will also need to update the column names of the dataframe in fetch_holidays method.

Contact

Issues should be raised directly in the repository. For additional questions or comments please email me at [email protected]

google_calendar's People

Contributors

yadunathg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.