
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
google-calendar-analytics
Advanced tools
This Python program allows you to perform analytics on your Google Calendar events. With this program, you can visualize the total duration of your events, compare the length of events across different time periods, and gain insights into which events take up the most time.
To use the Google Calendar Analytics program, first install the dependencies by running the following command:
pip install google-calendar-analytics
You can then import the AnalyzerFacade class and use it to analyze your data:
import asyncio
from datetime import datetime
from google.oauth2.credentials import Credentials
from google_calendar_analytics import AnalyzerFacade
# (You can get it from Google OAuth2 in you web app or from link above)
creds = {
"token": "ya29.a0AVvZVsoH4qZcrGK25VwsXspJv-r9K-",
"refresh_token": "1//0hwlhrtalKgeRCgYIARAAGBESNwF-",
"token_uri": "https://oauth2.googleapis.com/token",
"client_id": "395np.apps.googleusercontent.com",
"client_secret": "GOCSPXFqoucE03VRVz",
"scopes": ["https://www.googleapis.com/auth/calendar"],
"expiry": "2023-02-18T15:30:15.674219Z"
}
creds = Credentials.from_authorized_user_info(creds)
Once you have created the credentials, you can create an instance of the AnalyzerFacade class and use it to analyze your data:
# Choose time range for analysis
start_time = datetime(2023, 3, 1)
end_time = datetime(2023, 3, 18)
async def main():
async with AnalyzerFacade(creds=creds) as analyzer:
plot = await analyzer.analyze_one(start_time, end_time, event_name="Programming", plot_type="Line")
plot.show()
if __name__ == "__main__":
asyncio.run(main())
What's about multiple plots?
async def main():
async with AnalyzerFacade(creds=creds) as analyzer:
coroutines = []
coroutines.append(analyzer.analyze_one(start_time, end_time, event_name="Programming", plot_type="Line")
coroutines.append(analyzer.analyze_one(start_time, end_time, event_name="Reading", plot_type="Line"))
coroutines.append(analyzer.analyze_many(start_time, end_time, plot_type="Pie"))
coroutines.append(analyzer.analyze_many(start_time, end_time, plot_type="Bar"))
result = await asyncio.gather(*coroutines)
for plot in result:
plot.show()
If you would like to contribute to this project, please feel free to submit a pull request. Some areas where contributions are particularly welcome include:
Pie plot | Bar plot |
---|---|
![]() | ![]() |
Line plot | Multy line plot |
---|---|
![]() | ![]() |
FAQs
A Python library for analyzing Google Calendar data.
We found that google-calendar-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.