Google Calendar Command Line Interface
Project description
Google Calendar Command Line Interface
gcalcli uses the Google Calendar API version 3.
Requirements
Python (2.7, 3+)
A love for the command line!
Optional packages
vobject Python module Used for ics/vcal importing.
parsedatetime Python module Used for fuzzy dates/times like “now”, “today”, “eod tomorrow”, etc.
Installation
Check your OS distribution for packages.
Debian/Ubuntu
apt-get install gcalcli
Install using Nix
nix-env -i gcalcli
Install from PyPI
pip install gcalcli
Install from source
git clone https://github.com/insanum/gcalcli.git
cd gcalcli
python setup.py install
Install optional packages
pip install vobject parsedatetime
Features
OAuth2 authention with your Google account
list your calendars
show an agenda using a specified start/end date and time
ascii text graphical calendar display with variable width
search for past and/or future events
“quick add” new events to a specified calendar
“add” a new event to a specified calendar (interactively or automatically)
“delete” event(s) from a calendar(s) (interactively or automatically)
“edit” event(s) interactively
import events from ICS/vCal files to a specified calendar
support for URL shortening via goo.gl
easy integration with your favorite mail client (attachment handler)
run as a cron job and execute a command for reminders
work against specific calendars (by calendar name w/ regex)
flag file support for specifying option defaults
colored output and unicode character support
super fun hacking with shell scripts, cron, screen, tmux, conky, etc
Screenshots
HowTo
Usage
gcalcli provides a series of subcommands with the following functionality:
list list available calendars edit edit calendar events agenda get an agenda for a time period calw get a week-based agenda in calendar format calm get a month agenda in calendar format quick quick-add an event to a calendar add add a detailed event to the calendar import import an ics/vcal file to a calendar remind execute command if event occurs within <mins> time
See the manual (man (1) gcalcli), or run with --help/-h for detailed usage.
Login Information
Go to the Google developer console
Make a new project for gcalcli
On the sidebar under APIs & Auth, click APIs
Enable the Calendar API
On the sidebar click Credentials
Create a new Client ID. Set the type to Installed Application and the subtype to Other. You will be asked to fill in some consent form information, but what you put here isn’t important. It’s just what will show up when gcalcli opens up the OAuth website. Anything optional can safely be left blank.
Go back to the credentials page and grab your ID and Secret.
If desired, add the client_id and client_secret to your .gcalclirc:
--client_id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client_secret=xxxxxxxxxxxxxxxxx
Remove your existing OAuth information (typically ~/.gcalcli_oauth).
- Run gcalcli with any desired argument, making sure the new client_id andclient_secret are passed on the command line or placed in your .gcalclirc. TheOAuth authorization page should be opened automatically in your defaultbrowser.
HTTP Proxy Support
http_proxy https_proxy proxy-username or proxy_username proxy-password or proxy_password
Note that these environment variables must be lowercase.
Flag File
Example:
--military --duration=55 --details=calendar --details=location --details=length -w 10
Configuration Folders
Importing VCS/VCAL/ICS Files from Exchange (or other)
#!/bin/bash
TERMINAL=evilvte
CONFIG=~/.gcalclirc
$TERMINAL -e bash -c "echo 'Importing invite...' ; \
gcalcli --detail-url=short \
--calendar='Eric Davis' \
import -v \"$1\" ; \
read -p 'press enter to exit: '"
Event Popup Reminders
Cron:
% crontab -l
*/10 * * * * /usr/bin/gcalcli remind
#!/bin/bash
[[ -x /usr/bin/dunst ]] && /usr/bin/dunst -config ~/.dunstrc &
if [ -x /usr/bin/gcalcli ]; then
while true; do
/usr/bin/gcalcli --calendar="davis" remind
sleep 300
done &
fi
exec herbstluftwm # :-)
Agenda On Your Root Desktop
${execpi 300 gcalcli --conky agenda}
To also get a graphical calendar that shows the next three weeks add:
${execpi 300 gcalcli --conky calw 3}
${font DejaVu Sans Mono:size=9}${execpi 300 export PYTHONIOENCODING=utf8 && gcalcli --conky --lineart=unicode calw 3}
Agenda Integration With tmux
set-option -g status-interval 60 set-option -g status-left "#[fg=blue,bright]#(gcalcli agenda | head -2 | tail -1)#[default]"
Agenda Integration With screen
% crontab -e
Then add the following line:
*/5 * * * * gcalcli --nocolor --nostarted agenda "`date`" > /tmp/gcalcli_agenda.txt
#!/bin/bash head -2 /tmp/gcalcli_agenda.txt | tail -1
backtick 1 60 60 screen_agenda hardstatus "[ %1` ]"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gcalcli-4.0.1.tar.gz
.
File metadata
- Download URL: gcalcli-4.0.1.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e77798716d0c29556acaf4785b6bc67b5bf52677fe1deff1e8d1f0acf67ac4e |
|
MD5 | b5471db0885862b0396892e933d88cff |
|
BLAKE2b-256 | 8cc42caaccb8beb32a948945dd2e290bc50d33ee0354ac8ff75e931c776aa8a8 |
Provenance
File details
Details for the file gcalcli-4.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: gcalcli-4.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28542b98282940876f7aa816938bd276fd3c3e4f878f73f9aeeccc7e39a2dc4a |
|
MD5 | d0898b1a58a533559851a1552edc47e1 |
|
BLAKE2b-256 | 28f91af6417a5de94663fc2441a5415e48cf56515d287d280e31f6175a59297d |