Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonaylor89/chronos
My Timesheet API cloud function
https://github.com/jonaylor89/chronos
google-api google-calendar-api google-cloud google-cloud-functions python serverless
Last synced: 2 months ago
JSON representation
My Timesheet API cloud function
- Host: GitHub
- URL: https://github.com/jonaylor89/chronos
- Owner: jonaylor89
- License: mit
- Created: 2020-01-16T04:47:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-06T19:54:04.000Z (3 months ago)
- Last Synced: 2024-11-06T20:39:26.123Z (3 months ago)
- Topics: google-api, google-calendar-api, google-cloud, google-cloud-functions, python, serverless
- Language: Python
- Homepage:
- Size: 222 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chronos
### Overview
A gcloud function to pull google calendar data and present it as an easily accessible API. The function expects a calendar event as input
and responds with an array of how many hours each day are scheduled for that event this week.### Deployment
To deploy this gcloud function on your own account, first enable cloud functions and the google calendar API on the project you
plan to deploy to. Then from your console, make sure default auth is set up with:```
gcloud auth application-default login
```Next, share your google calendar with the service account email for the cloud function
(something like [email protected] in your IAM roles page) and lastly change the CALENDAR\_ID variable in `main.py`
to your email and you should be set up. To deploy everything you should be able to run:```
$ ./deploy.sh
```or if cloudbuild is enabled on the project and is set up with git integration for your gcloud project then just push
---------------------------
### Send Request
```
# Example checking how many hours each day you have "Work" scheduledcurl -s -X POST $YOUR_FUNCTION_URL -H "Content-Type:application/json" -d '{"name":"Work"}'
# => [0, 0, 0, 0, 0, 0, 0]
```### Response:
```
[
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
]
```Free software: MIT license