Skip to content

23f2005217/gcalendar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcalendar

PyPI version Donate

A command-line tool to read your Google Calendar events in JSON format.

Installation

Ubuntu, Linux Mint and other Ubuntu Derivatives

sudo add-apt-repository ppa:slgobinath/gcalendar sudo apt update sudo apt install gcalendar

Arch

yay -S gcalendar

OR

packer -S gcalendar

Other Distributions

Install these dependencies:

python3-pip python3-setuptools python3-dateutil python3-oauth2client python3-googleapi

Install gcalendar:

pip3 install gcalendar

Install from Source

sudo apt install python3-pip python3-setuptools python3-dateutil python3-oauth2client python3-googleapi git git clone https://github.com/slgobinath/gcalendar.git cd gcalendar pip3 install -e .

Run from Source

sudo apt install python3-pip python3-setuptools python3-dateutil python3-oauth2client python3-googleapi git git clone https://github.com/slgobinath/gcalendar.git cd gcalendar python3 -m gcalendar

Help

usage: gcalendar [-h] [--list-calendars | --list-accounts | --status | --reset | --setup-cron INTERVAL | --remove-cron] [--calendar [CALENDAR [CALENDAR ...]]] [--no-of-days NO_OF_DAYS] [--account ACCOUNT] [--output {txt,json}] [--client-id CLIENT_ID] [--client-secret CLIENT_SECRET] [--notify NOTIFY] [--version] [--debug] Read your Google Calendar events from terminal. optional arguments: -h, --help show this help message and exit --list-calendars list all calendars from the Google account --list-accounts list the id of gcalendar accounts --status print the status of the gcalendar account --reset reset the account --setup-cron INTERVAL setup crontab to check every INTERVAL minutes --remove-cron remove gcalendar crontab entry --calendar [CALENDAR [CALENDAR ...]] calendars to list events from --no-of-days NO_OF_DAYS number of days to include --account ACCOUNT an alphanumeric name to uniquely identify the account --output {txt,json} output format --client-id CLIENT_ID the Google client id --client-secret CLIENT_SECRET the Google client secret --notify NOTIFY send notification before event (minutes) --version show program's version number and exit --debug run gcalendar in debug mode 

Authorization

Run gcalendar from the terminal. It will open the Google Calendar OAuth screen in your default browser. Allow gcalendar to view your calendars as shown in this video: gcalendar Authorization.

After successful authorization, gcalendar should print calendar events on your terminal.

Usage

List Calendars

gcalendar --list-calendar

List Events

# list next 7 days events gcalendar # list next 30 days events gcalendar --no-of-days 30 # list events from selected calendar gcalendar --calendar "Holidays in Canada"

Separate Accounts

# the default account gcalendar # different account named foo gcalendar --account foo # different account named bar gcalendar --account bar

Reset Accounts

# reset the default account gcalendar --reset # reset the account named foo gcalendar --account foo --reset # reset the account named bar gcalendar --account bar --reset

Desktop Notifications

# Get desktop notifications for events starting in the next 15 minutes gcalendar --notify 15 # Get desktop notifications for events starting in the next 30 minutes gcalendar --notify 30

Automated Notifications with Cron

gcalendar can automatically check for upcoming events and send notifications:

# Setup cron to check every 5 minutes and notify 15 minutes before events gcalendar --setup-cron 5 --notify 15 # Setup cron to check every 10 minutes and notify 30 minutes before events gcalendar --setup-cron 10 --notify 30 # Setup cron for a specific account and calendar gcalendar --setup-cron 5 --notify 15 --account work --calendar "Meeting Calendar" "Important Dates" # Remove gcalendar from crontab gcalendar --remove-cron

The cron job will run in the background and send desktop notifications when events are approaching.

Issues

Run gcalendar --debug and create an issue with the output.

Applications

Cinnamon Google Calendar desklet uses gcalendar to pull calendar events and show them on Cinnamon desktop.

License

GNU General Public License v3

About

Read-only Google Calendar utility for Linux

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%