Skip to main content

A package designed to facilitate easy interaction with TeamUp API.

Project description

Teamup

A package designed to facilitate easy interaction with TeamUp API.

Quickstart

Installation 🛠️

From PyPI py_teamup is available on PyPI. To install with pip, just run

pip install py_teamup

Setup 🔨

Review the .env.example file for the required/optional environment variables.

  • The email and password are not actually used currently.
  • Filling in all others are required beside TEAMUP_DEFAULT_CALENDAR_ID which is optional.
    • Working with one calendar and multiple sub_calendars seems more likely. Which is why I have it set statically in TEAMUP_DEFAULT_CALDENDAR_ID. Can get this value here from your own calendar: calendar_id

Get token and api key from teamup: https://teamup.com/api-keys/request

Usage - Commands/Features

This covers the main use cases for the library.

from teamup_connect import TeamUP

teamup = TeamUP()

# # Get calendar - returns dict full of calendar info.
calendar_info = teamup.get_calendar(calendar_key_or_id=DEFAULT_CALENDAR_ID)

# Get list of subcalendars - returns dict of subcalendars and their info.
sub_calendars = teamup.get_subcalendars(calendar_key_or_id=DEFAULT_CALENDAR_ID)
sub_calendar_ids = [calendar["id"] for calendar in sub_calendars]

# Or get a subcalendar by its name
sub_calendar_id = teamup.get_subcalendar_id_from_name(
    calendar_key_or_id=DEFAULT_CALENDAR_ID, calendar_name="Daily Routine"
)

# With a sub_calendar_id, we can now create an event for that calendar.
# Note: the teamup class has a CalendarEvent data class that is required
    # to create an event (for ease of use and validation).
event_to_create = teamup.CalendarEvent(subcalendar_ids=[sub_calendar_id], title="Test Event")

created_event = teamup.create_calendar_event(
    calendar_key_or_id=DEFAULT_CALENDAR_ID, calendar_event=event_to_create
)
created_event_id = created_event["id"]

# Delete the event created
event_undo_id = teamup.delete_calendar_event(
    calendar_key_or_id=DEFAULT_CALENDAR_ID, event_id=created_event_id
)

# Get all events for the subcalendar - This example uses the optional parameter with a date range
optional_params = {
    "startDate": "2024-07-18",
    "endDate": "2024-08-10",
}
events = teamup.get_calendar_events(calendar_key_or_id=DEFAULT_CALENDAR_ID, query=optional_params)

Development 🔧

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teamup_connect-0.2.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

teamup_connect-0.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file teamup_connect-0.2.0.tar.gz.

File metadata

  • Download URL: teamup_connect-0.2.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for teamup_connect-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b24b5029f7f2bd0611da0a1570d8825efa785b56a42b7e44bbb32dad6a9caaa7
MD5 33dda626eb1fd95ce2f2412a732571e6
BLAKE2b-256 db50c76c7fa20f566e9d69170c8268dac3b4d912f450671a38e6a7fc92cd841e

See more details on using hashes here.

File details

Details for the file teamup_connect-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for teamup_connect-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c552804c7dcd501005b175885f8fdf1f6db40b713a214aa16bf9effe6c9cecd
MD5 4113d49079b703cc7e6efd4ba7e8de8f
BLAKE2b-256 b77a68be4516c8e64da64073111a18d3458752fbc699a20184dfdd85f7e5ee58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page