Back to Llama Index

Google Calendar Loader

llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/calendar/README.md

0.14.221.2 KB
Original Source

Google Calendar Loader

pip install llama-index-readers-google

This loader reads your upcoming Google Calendar events and parses the relevant info into Documents.

As a prerequisite, you will need to register with Google and generate a credentials.json file in the directory where you run this loader. See here for instructions.

Usage

Here's an example usage of the GoogleCalendar. It will retrieve up to 100 future events, unless an optional number_of_results argument is passed. It will also retrieve only future events, unless an optional start_date argument is passed.

python
from llama_index.readers.google import GoogleCalendarReader

loader = GoogleCalendarReader()
documents = loader.load_data()

Example

This loader is designed to be used as a way to load data into LlamaIndex.

LlamaIndex

python
from llama_index.readers.google import GoogleCalendarReader
from llama_index.core import VectorStoreIndex

loader = GoogleCalendarReader()
documents = loader.load_data()

index = VectorStoreIndex.from_documents(documents)
index.query("When am I meeting Gordon?")