-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c31a54d
commit 518ed50
Showing
6 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,26 +19,64 @@ Example usage | |
List slots from free ranges (dates and times without events, available for scheduling) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. raw:: html | ||
|
||
<h1 align="center"> | ||
<img src="https://github.com/leandcesar/google-calendar-simple-api-slots/blob/main/docs/images/example_1.png?raw=true" alt="List slots from free ranges"/> | ||
</h1> | ||
|
||
.. code-block:: python | ||
from gcsa_slots.google_calendar import GoogleCalendar | ||
calendar = GoogleCalendar("[email protected]") | ||
for slot in calendar.get_slots(): | ||
for slot in calendar.get_slots(60): # 60 minutes | ||
print(slot) | ||
# 2023-03-06 09:00:00-03:00 - 2023-03-06 10:00:00-03:00 | ||
# 2023-03-06 11:00:00-03:00 - 2023-03-06 12:00:00-03:00 | ||
# 2023-03-06 14:00:00-03:00 - 2023-03-06 15:00:00-03:00 | ||
# 2023-03-06 15:00:00-03:00 - 2023-03-06 16:00:00-03:00 | ||
# 2023-03-07 09:00:00-03:00 - 2023-03-07 10:00:00-03:00 | ||
# 2023-03-07 10:00:00-03:00 - 2023-03-07 11:00:00-03:00 | ||
# 2023-03-07 11:00:00-03:00 - 2023-03-07 12:00:00-03:00 | ||
# 2023-03-08 09:00:00-03:00 - 2023-03-08 10:00:00-03:00 | ||
# 2023-03-08 10:00:00-03:00 - 2023-03-08 11:00:00-03:00 | ||
# 2023-03-08 14:00:00-03:00 - 2023-03-08 15:00:00-03:00 | ||
# 2023-03-08 15:00:00-03:00 - 2023-03-08 16:00:00-03:00 | ||
# ... | ||
List slots from slot-event ranges (an event that determines availability for scheduling) | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. raw:: html | ||
|
||
<h1 align="center"> | ||
<img src="https://github.com/leandcesar/google-calendar-simple-api-slots/blob/main/docs/images/example_2.png?raw=true" alt="List slots from free ranges"/> | ||
</h1> | ||
|
||
.. code-block:: python | ||
from gcsa_slots.google_calendar import GoogleCalendar | ||
calendar = GoogleCalendar("[email protected]") | ||
for slot in calendar.get_slots(slot_summary="Free"): | ||
for slot in calendar.get_slots(60, slot_summary="Free"): # 60 minutes | ||
print(slot) | ||
# 2023-03-06 09:00:00-03:00 - 2023-03-06 10:00:00-03:00 | ||
# 2023-03-06 11:00:00-03:00 - 2023-03-06 12:00:00-03:00 | ||
# 2023-03-06 14:00:00-03:00 - 2023-03-06 15:00:00-03:00 | ||
# 2023-03-06 15:00:00-03:00 - 2023-03-06 16:00:00-03:00 | ||
# 2023-03-07 09:00:00-03:00 - 2023-03-07 10:00:00-03:00 | ||
# 2023-03-07 10:00:00-03:00 - 2023-03-07 11:00:00-03:00 | ||
# 2023-03-07 11:00:00-03:00 - 2023-03-07 12:00:00-03:00 | ||
# 2023-03-08 09:00:00-03:00 - 2023-03-08 10:00:00-03:00 | ||
# 2023-03-08 10:00:00-03:00 - 2023-03-08 11:00:00-03:00 | ||
# 2023-03-08 14:00:00-03:00 - 2023-03-08 15:00:00-03:00 | ||
# 2023-03-08 15:00:00-03:00 - 2023-03-08 16:00:00-03:00 | ||
# ... | ||
List slots specifying time range, slot interval, max events per slot and calendar ID | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -50,11 +88,11 @@ List slots specifying time range, slot interval, max events per slot and calenda | |
calendar = GoogleCalendar("[email protected]") | ||
calendar_id = "your calendar id" | ||
for slot in calendar.get_slots( | ||
45, | ||
slot_summary="fReE", | ||
case_sensitive=False, | ||
time_min=datetime(2023, 3, 6), | ||
time_max=datetime(2023, 3, 7), | ||
slot_duration=90, | ||
events_per_slot=3, | ||
calendar_id=calendar_id, | ||
): | ||
|
@@ -69,11 +107,17 @@ Create event in first available slot | |
from gcsa_slots.google_calendar import GoogleCalendar | ||
calendar = GoogleCalendar("[email protected]") | ||
slots = calendar.get_slots() | ||
slots = calendar.get_slots(90, slot_summary="Free") | ||
slot = next(slots) | ||
slot.summary = "This is a test!" | ||
calendar.add_event(slot) | ||
.. raw:: html | ||
|
||
<h1 align="center"> | ||
<img src="https://github.com/leandcesar/google-calendar-simple-api-slots/blob/main/docs/images/example_3.png?raw=true" alt="List slots from free ranges"/> | ||
</h1> | ||
|
||
|
||
.. _`Google Calendar Simple API`: https://github.com/kuzmoyev/google-calendar-simple-api | ||
.. _`Getting started page`: https://google-calendar-simple-api.readthedocs.io/en/latest/getting_started.html |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
author="Leandro César Cassimiro", | ||
author_email="[email protected]", | ||
url="https://github.com/leandcesar/google-calendar-simple-api-slots", | ||
version="0.1.0", | ||
version="0.1.1", | ||
license="MIT", | ||
python_requires=">=3.7", | ||
packages=find_packages(include=["gcsa_slots", "gcsa_slots.*"]), | ||
|