Google Calendar Simple API Slots
Google Calendar Simple API Slots or gcsa-slots is an extension for Google Calendar Simple API library with slots (dates and times available for scheduling).
Installation
pip install gcsa-slots
See Getting started page for more details and installation options.
Example usage
List slots from free ranges (dates and times without events, available for scheduling)
from gcsa_slots.google_calendar import GoogleCalendar
calendar = GoogleCalendar("your_email@gmail.com")
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)
from gcsa_slots.google_calendar import GoogleCalendar
calendar = GoogleCalendar("your_email@gmail.com")
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
from gcsa_slots.google_calendar import GoogleCalendar
calendar = GoogleCalendar("your_email@gmail.com")
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),
events_per_slot=3,
calendar_id=calendar_id,
):
print(slot)
Create event in first available slot
from gcsa_slots.google_calendar import GoogleCalendar
calendar = GoogleCalendar("your_email@gmail.com")
slots = calendar.get_slots(90, slot_summary="Free")
slot = next(slots)
slot.summary = "This is a test!"
calendar.add_event(slot)
Metadata
Release files for gcsa-slots 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gcsa-slots-0.1.1.tar.gz | 4.7 kB | Without provenance | Details for gcsa-slots-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gcsa_slots-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for gcsa_slots-0.1.1-py3-none-any.whl |
Total release size: 9.4 kB
Release files / gcsa-slots-0.1.1.tar.gz
| Download URL | gcsa-slots-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c0101b90c61ba181ddc09fe0fe78f08833bae7adab798e3b6e0be343f769407
|
|
BLAKE2b-256 checksum How to use checksums |
c6ebfcfa77ba0044811d1268081d6b2c52a4c6de10cd82550f51c98959e8efea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.6 requests/2.28.2 setuptools/44.0.0 requests-toolbelt/0.10.1 tqdm/4.65.0 CPython/3.8.10
|
Release files / gcsa_slots-0.1.1-py3-none-any.whl
| Download URL | gcsa_slots-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08b57c7584249615a237dd2e39768b9825a0a5db633c86ed162fdded081b7863
|
|
BLAKE2b-256 checksum How to use checksums |
86b42ac87bf49c11b8306a29f50670adcce4d257aa45b4242d77b754007fb32a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.6 requests/2.28.2 setuptools/44.0.0 requests-toolbelt/0.10.1 tqdm/4.65.0 CPython/3.8.10
|
Security for gcsa-slots 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.