Skip to main content

AutoCalendar :calendar:

AutoCalendar is a Python scheduling automation system based on the Google Calendar API ideal for scheduling research participants.

Running autocalendar.py adds events into Google Calendar by extracting the relevant information from an excel sheet containing participants' details, such as date, time, and location.

Check out AutoRemind too!

Code Structure

  • Schedule Participants: autoallocate()

    • Parses a doodle poll spreadsheet and automatically allocates participants to an available slot (Useful if participants are told to choose as many available slots as they can)
  • Access Google API: setup_oauth()

  • Extract event details and create event:

    • preprocess_file(): preprocesses the input excel sheet (containing participants' scheduled slots)
    • extract_info(): extracts date, time and location based on header column names in the participants file. Argument filter_column can also be activated to select only some participants to be added into google calendar.
    • create_event(): prepares event details ready for execution. Argument calendar_id (defaults to 'primary') can also be modified according to which active google calendar to use by simply specifying the name of the calendar.
    • add_event(): executes adding of event into calendar.

How to Use

1) Try it yourself: Automatic Scheduling of Participants

Download your doodle poll into an excel spreadsheet, like so:

Screenshot1

import autocalendar as autocalendar

autocalendar.autoallocate('scheduled.xlsx')
All participants successfully allocated.

A 'scheduled.xlsx' file containing participants' final allocated slots is exported with one line of code. Feedback is provided on whether participants are successfully allocated or not, and the name of any participant who is not allocated will be printed.

2) Try it yourself: Adding Events

You will first need to start with a xlsx file containing information on participants' scheduled slots. For example:

Screenshot

import autocalendar as autocalendar

# Set up Oauth to access Google API
service = autocalendar.setup_oath(token_path='../../token.pkl',
                                  client_path='../../client_secret.json')

# Read and tidy excel sheet
participants = autocalendar.preprocess_file('../../../Participants Scheduling/Master_Participant_List.xlsx', header_row=2)

# Extract info
dates, start_points, end_points, locations, to_add = autocalendar.extract_info(participants, date_col='Date_Session1', time_col='Timeslot_Session1', location_col='Location_Session1', filter_column='Calendar_Event', select='No')

# Execute
autocalendar.add_event(service, dates, start_points, end_points, locations, to_add,
                       event_name='MRI study Session 1', description='', timezone='Asia/Singapore',
                       creator_email='mristudy@gmail.com', calendar_id='NTU Calendar',
                       silent=False, name_col='Participant Name', date_col='Date_Session1',
                       location_col='Location_Session1', time_col='Timeslot_Session1')

If silent in add_event() is set to False, you will also get printed output on each participant's appointment that is added into Google Calendar!

Adding calendar event for Subject1 at 11-8-2020, 11.00am-11.30am, B1-26 
Adding calendar event for Subject2 at 11-8-2020, 10.30am-11.00am, B1-26 
Adding calendar event for Subject3 at 11-8-2020, 4.00pm-4.30pm, B1-26 
Adding calendar event for Subject4 at 13-8-2020, 9.30am-10.00am, B1-26 
Adding calendar event for Subject5 at 12-8-2020, 11.30am-12.00pm, B1-26 
Adding calendar event for Subject6 at 12-8-2020, 12.00pm-12.30pm, B1-26 

Future Direction

Metadata

Release files for autocalendar 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autocalendar 0.1.0
File Size Uploaded
autocalendar-0.1.0.tar.gz 8.9 kB Details

Release files / autocalendar-0.1.0.tar.gz

Download URL autocalendar-0.1.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7c9f1ffb8c01b00cbd66d39404ea8498c03a29a54a0146b7be37befdd391a498
BLAKE2b-256 checksum
How to use checksums
1e82a1f6a748ebbfc934f1a9f017b831ece39b2075b58b0a952d578e6bcc3b0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page