Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Trello - Create new cards from new Google Calendar events #2319

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 252 additions & 0 deletions Trello/Trello_Create_new_cards_from_new_Google_Calendar_events.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "3cbe7363-a6a1-4f31-b7e9-fe1e2ca13d56",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>"
]
},
{
"cell_type": "markdown",
"id": "f56108ac-dc65-4c7e-92c7-0963b78e0756",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"# Trello - Create new cards from new Google Calendar events"
]
},
{
"cell_type": "markdown",
"id": "6925f280-015f-4eac-80e4-e1ba901ac346",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Tags:** #trello #googlecalendar #automation #python #api #integration"
]
},
{
"cell_type": "markdown",
"id": "bb9753d8-1e34-428d-94b2-dab4f0659b7a",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Author:** [Benjamin Filly](https://www.linkedin.com/in/benjamin-filly-05427727a/)"
]
},
{
"cell_type": "markdown",
"id": "d6fd7b7a-d10a-4131-bdab-a8f030435f2b",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Last update:** 2023-10-16 (Created: 2023-10-16)"
]
},
{
"cell_type": "markdown",
"id": "07d4c109-4e21-4420-b82b-27774054d230",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**Description:** This notebook automates the creation of new Trello cards from new Google Calendar events. It is usefull for organizations that need to keep track of their events and tasks in one place."
]
},
{
"cell_type": "markdown",
"id": "85aa8b0c-76ca-472b-b9e4-33401a9a87c2",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"**References:**\n- [Trello API Documentation](https://developers.trello.com/reference)\n- [Google Calendar API Documentation](https://developers.google.com/calendar/v3/reference)"
]
},
{
"cell_type": "markdown",
"id": "3cc05459-f8b0-45fc-ac62-5a0e52e190cb",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Input"
]
},
{
"cell_type": "markdown",
"id": "c17243f1-1469-48d1-abbc-aad9eaf0bcce",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Import libraries"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b9bb41c5-3a9e-4ad1-a2b3-426636bcb578",
"metadata": {
"papermill": {},
"tags": []
},
"source": "import trello\nimport google_calendar",
"outputs": []
},
{
"cell_type": "markdown",
"id": "1f8527df-c62e-4402-ac50-1bdd7570bb87",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Setup variables\n- **Trello API key**: [Follow this procedure](https://developers.trello.com/get-started/start-building#getting-an-api-key) to get your Trello API key\n- **Trello token**: [Follow this procedure](https://developers.trello.com/get-started/start-building#getting-a-token-from-a-user) to get your Trello token\n- **Google Calendar API key**: [Follow this procedure](https://developers.google.com/calendar/quickstart/python) to get your Google Calendar API key"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9c8d5a53-e771-4cf2-9e2b-187cbfbfd471",
"metadata": {
"papermill": {},
"tags": []
},
"source": "trello_api_key = \"YOUR_TRELLO_API_KEY\"\ntrello_token = \"YOUR_TRELLO_TOKEN\"\ngoogle_calendar_api_key = \"YOUR_GOOGLE_CALENDAR_API_KEY\"",
"outputs": []
},
{
"cell_type": "markdown",
"id": "6f2d665c-7637-4ace-ab52-ff94b0d0ffd3",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Model"
]
},
{
"cell_type": "markdown",
"id": "3cb3db03-aa4c-4d15-96c5-5b94e8a424ea",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Create new Trello cards from new Google Calendar events"
]
},
{
"cell_type": "markdown",
"id": "c5cf42bc-9c90-47ab-b163-f132a2e04203",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"This function creates new Trello cards from new Google Calendar events."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d9fcb782-9316-4e88-83a4-e8bb23818985",
"metadata": {
"papermill": {},
"tags": []
},
"source": "def create_trello_cards_from_google_calendar_events(\n trello_api_key, trello_token, google_calendar_api_key\n):\n # Connect to Trello\n trello_client = trello.TrelloClient(api_key=trello_api_key, token=trello_token)\n # Connect to Google Calendar\n google_calendar_client = google_calendar.GoogleCalendarClient(\n api_key=google_calendar_api_key\n )\n # Get new Google Calendar events\n new_events = google_calendar_client.get_new_events()\n # Create new Trello cards from new Google Calendar events\n for event in new_events:\n trello_client.create_card(event)",
"outputs": []
},
{
"cell_type": "markdown",
"id": "76554367-cfc2-4117-8029-82dad2394892",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "b51c3881-2d9e-45d6-9dec-9d462698d775",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Display result"
]
},
{
"cell_type": "markdown",
"id": "09cdc4ba-74b9-4c70-a080-4ea52124a40e",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"This function displays the result of the creation of new Trello cards from new Google Calendar events."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fe28a3d9-d5a5-49dc-ae51-247a2e57aebe",
"metadata": {
"papermill": {},
"tags": []
},
"source": "# Display result\nfor event in new_events:\n print(f\"New Trello card created from Google Calendar event {event.name}\")",
"outputs": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}