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:
- Working with one calendar and multiple sub_calendars seems more likely. Which is why I have it set statically in
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.3.0.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file teamup_connect-0.3.0.tar.gz
.
File metadata
- Download URL: teamup_connect-0.3.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19ce0013e9cde3f541dc2a9652ae9ce91d9e4740737b94d45567026a0109e18c |
|
MD5 | 41f48a4f3a7dd086997ce39300525841 |
|
BLAKE2b-256 | 92463dba043a87914aa45ea0d575aba57da1d48ed40f849e832ef2e9e4de5c14 |
File details
Details for the file teamup_connect-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: teamup_connect-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b89b220c7fe3decc811c6d66b5d01264f38f198bbe6f96913170ac09bffbc41 |
|
MD5 | 0ac920be0ea6cdc4c73db8f02c35bd04 |
|
BLAKE2b-256 | cf724cf7ba69c130ccbc713fdf31c7fb84ec04dd3cd36e60f29bcde4696968cc |