diff --git a/Algolia/Algolia_List indices.ipynb b/Algolia/Algolia_List indices.ipynb index b0ac5f48f7..d86493c110 100644 --- a/Algolia/Algolia_List indices.ipynb +++ b/Algolia/Algolia_List indices.ipynb @@ -53,7 +53,7 @@ "tags": [] }, "source": [ - "**Last update:** 2023-06-15 (Created: 2023-06-15)" + "**Last update:** 2023-11-21 (Created: 2023-06-15)" ] }, { @@ -78,7 +78,8 @@ "source": [ "**References:**\n", "- [Algolia API Reference](https://www.algolia.com/doc/api-reference/api-methods/list-indices/)\n", - "- [Algolia Python Client](https://github.com/algolia/algoliasearch-client-python)" + "- [Algolia Python Client](https://github.com/algolia/algoliasearch-client-python)\n", + "- [Get your credentials](https://dashboard.algolia.com/account/api-keys)" ] }, { @@ -129,9 +130,9 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "- `app_id`: Algolia application ID. [Get your credentials](https://dashboard.algolia.com/account/api-keyss)\n", - "- `api_key`: Algolia API key. [Get your credentials](https://dashboard.algolia.com/account/api-keys)" + "### Setup variables\n", + "- `app_id`: Algolia application ID.\n", + "- `api_key`: Algolia API key." ] }, { @@ -284,4 +285,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Algolia/Algolia_Setup_connection.ipynb b/Algolia/Algolia_Setup_connection.ipynb new file mode 100644 index 0000000000..e53dfdd728 --- /dev/null +++ b/Algolia/Algolia_Setup_connection.ipynb @@ -0,0 +1,285 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "02b78a46-e367-48fb-9468-d560000cc994", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Buffer.png\"" + ] + }, + { + "cell_type": "markdown", + "id": "a5b2c509-2c29-49e8-af91-4f3f1e386da3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# Algolia - Setup connection\n", + "

Give Feedback | Bug report" + ] + }, + { + "cell_type": "markdown", + "id": "d77fe283-4edd-42d3-a909-8e207d4b842f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #algolia #naas #secret #connection #setup" + ] + }, + { + "cell_type": "markdown", + "id": "b90f2d91-c886-4e36-8265-b09d06bb1c7f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "6bbf7807-dda4-4b8a-b016-fe258a0fa33f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-11-21 (Created: 2023-11-21)" + ] + }, + { + "cell_type": "markdown", + "id": "214749fe-7f0b-4755-b7ea-1d200c234cc6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook help you setup your connection with Algolia and add required credentials to Naas secret. You will be able to establish a seamless connection to Algolia without the need to repeatedly redefine your credentials in variables by using `naas.secret.get()` in your notebook." + ] + }, + { + "cell_type": "markdown", + "id": "a1329bea-ad80-4981-874c-8776b11f89a8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n", + "- [Get your Algolia credentials](https://dashboard.algolia.com/account/api-keys)\n", + "- [Naas Secret Documentation](https://site.naas.ai/docs/developers/jobs/secret)" + ] + }, + { + "cell_type": "markdown", + "id": "cff349c8-2816-4ae4-9229-027c068eeb51", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "80266a9e-fe54-4f3e-aeb2-01483bbc53f9", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc038b10-2679-42bc-909e-09a298339df4", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "import naas" + ] + }, + { + "cell_type": "markdown", + "id": "30127040-e487-4115-8317-5084823b3a6f", + "metadata": { + "papermill": {}, + "tags": [ + "variables" + ] + }, + "source": [ + "### Setup variables\n", + "**Mandatory**\n", + "- `app_id`: Algolia application ID. This value will be stored under the secret 'ALGOLIA_APP_ID'.\n", + "- `api_key`: Algolia API key. This value will be stored under the secret 'ALGOLIA_API_KEY'.\n", + "\n", + "**Optional**\n", + "- `secrets`: Dict to add secrets to naas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d86b8fb-2576-426d-a305-50043c24c23e", + "metadata": { + "papermill": {}, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# Mandatory\n", + "app_id = None\n", + "api_key = None\n", + "\n", + "# Optional\n", + "secrets = {\n", + " \"ALGOLIA_APP_ID\": app_id,\n", + " \"ALGOLIA_API_KEY\": api_key,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1b0ae044-cac2-479f-b1fc-a3318696adf5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "3aadae7f-fbe5-4f97-a6a9-6efe9dd1a42f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Add secret" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e235794a-6907-4f0e-ab2b-5aa6668a8d3b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "for secret in secrets:\n", + " new_value = secrets.get(secret)\n", + " if new_value:\n", + " naas.secret.add(secret, secrets.get(secret))" + ] + }, + { + "cell_type": "markdown", + "id": "7c97931b-4ce8-46f9-a70c-45393c5669ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "760ec150-d79a-4208-adfe-d0336d443dc8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4005faa2-a781-4805-9c08-74951e900d12", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "df = naas.secret.list()\n", + "df = df[df[\"name\"].isin(secrets.keys())]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb18d4d-cd69-49b5-92ea-4b638885e652", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [] + } + ], + "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" + }, + "naas": { + "notebook_id": "c12c4cbf80c5db89bcacf8d73f0979d06a128e8f691832abe5dc63823b9263e2", + "notebook_path": "Buffer/Buffer_Setup_connection.ipynb" + }, + "papermill": { + "default_parameters": {}, + "environment_variables": {}, + "parameters": {}, + "version": "2.4.0" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Bitly/Bitly_Retrieve_Bitlink.ipynb b/Bitly/Bitly_Retrieve_Bitlink.ipynb index 4729a8d6b0..4ad9b763f0 100644 --- a/Bitly/Bitly_Retrieve_Bitlink.ipynb +++ b/Bitly/Bitly_Retrieve_Bitlink.ipynb @@ -53,7 +53,7 @@ "tags": [] }, "source": [ - "**Last update:** 2023-04-12 (Created: 2023-02-23)" + "**Last update:** 2023-11-21 (Created: 2023-02-23)" ] }, { @@ -75,9 +75,10 @@ "tags": [] }, "source": [ - "References:\n", + "**References:**\n", "- [Bitly API Documentation](https://dev.bitly.com/v4_documentation.html)\n", - "- [Bitly API Quickstart](https://dev.bitly.com/v4/#section/Quick-Start)" + "- [Bitly API Quickstart](https://dev.bitly.com/v4/#section/Quick-Start)\n", + "- [Generate a Bitly Access Token](https://support.bitly.com/hc/en-us/articles/230647907-How-do-I-generate-an-OAuth-access-token-for-the-Bitly-API-)" ] }, { @@ -104,9 +105,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "912afa92-2391-44be-be30-d3d52262ed5a", "metadata": { + "execution": { + "iopub.status.idle": "2023-11-21T10:48:42.893947Z", + "shell.execute_reply": "2023-11-21T10:48:42.890744Z", + "shell.execute_reply.started": "2023-11-21T10:48:31.213161Z" + }, "papermill": {}, "tags": [] }, @@ -126,16 +132,23 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "- **token**: [Generate a Bitly Access Token](https://support.bitly.com/hc/en-us/articles/230647907-How-do-I-generate-an-OAuth-access-token-for-the-Bitly-API-)\n", - "- **bitlink**: A Bitlink made of the domain and hash " + "### Setup variables\n", + "- `token`: Bitly Access Token\n", + "- `bitlink`: A Bitlink made of the domain and hash " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "45dfd5f9-de84-4d78-be84-58639a9e45d9", "metadata": { + "execution": { + "iopub.execute_input": "2023-11-21T10:48:42.922501Z", + "iopub.status.busy": "2023-11-21T10:48:42.920283Z", + "iopub.status.idle": "2023-11-21T10:48:43.085054Z", + "shell.execute_reply": "2023-11-21T10:48:43.084464Z", + "shell.execute_reply.started": "2023-11-21T10:48:42.922444Z" + }, "papermill": {}, "tags": [] }, @@ -272,4 +285,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Bitly/Bitly_Setup_connection.ipynb b/Bitly/Bitly_Setup_connection.ipynb new file mode 100644 index 0000000000..849bd29147 --- /dev/null +++ b/Bitly/Bitly_Setup_connection.ipynb @@ -0,0 +1,282 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ae001b8b-0e92-4260-af3f-6da446fa84a6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Bitly.png\"" + ] + }, + { + "cell_type": "markdown", + "id": "a5b2c509-2c29-49e8-af91-4f3f1e386da3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# Bitly - Setup connection\n", + "

Give Feedback | Bug report" + ] + }, + { + "cell_type": "markdown", + "id": "d77fe283-4edd-42d3-a909-8e207d4b842f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #bitly #naas #secret #connection #setup" + ] + }, + { + "cell_type": "markdown", + "id": "b90f2d91-c886-4e36-8265-b09d06bb1c7f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "6bbf7807-dda4-4b8a-b016-fe258a0fa33f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-11-21 (Created: 2023-11-21)" + ] + }, + { + "cell_type": "markdown", + "id": "214749fe-7f0b-4755-b7ea-1d200c234cc6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook help you setup your connection with Bitly and add required credentials to Naas secret. You will be able to establish a seamless connection to Bitly without the need to repeatedly redefine your credentials in variables by using `naas.secret.get()` in your notebook." + ] + }, + { + "cell_type": "markdown", + "id": "a1329bea-ad80-4981-874c-8776b11f89a8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n", + "- [Generate a Bitly Access Token](https://dev.bitly.com/get_started/#step-1-generate-an-access-token)\n", + "- [Naas Secret Documentation](https://site.naas.ai/docs/developers/jobs/secret)" + ] + }, + { + "cell_type": "markdown", + "id": "cff349c8-2816-4ae4-9229-027c068eeb51", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "80266a9e-fe54-4f3e-aeb2-01483bbc53f9", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc038b10-2679-42bc-909e-09a298339df4", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "import naas" + ] + }, + { + "cell_type": "markdown", + "id": "30127040-e487-4115-8317-5084823b3a6f", + "metadata": { + "papermill": {}, + "tags": [ + "variables" + ] + }, + "source": [ + "### Setup variables\n", + "**Mandatory**\n", + "- `bitly_token`: Bitly Access Token. This value will be stored under the secret 'BITLY_TOKEN'.\n", + "\n", + "**Optional**\n", + "- `secrets`: Dict to add secrets to naas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d86b8fb-2576-426d-a305-50043c24c23e", + "metadata": { + "papermill": {}, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# Mandatory\n", + "bitly_token = None\n", + "\n", + "# Optional\n", + "secrets = {\n", + " \"BITLY_TOKEN\": bitly_token,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1b0ae044-cac2-479f-b1fc-a3318696adf5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "3aadae7f-fbe5-4f97-a6a9-6efe9dd1a42f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Add secret" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e235794a-6907-4f0e-ab2b-5aa6668a8d3b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "for secret in secrets:\n", + " new_value = secrets.get(secret)\n", + " if new_value:\n", + " naas.secret.add(secret, secrets.get(secret))" + ] + }, + { + "cell_type": "markdown", + "id": "7c97931b-4ce8-46f9-a70c-45393c5669ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "760ec150-d79a-4208-adfe-d0336d443dc8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4005faa2-a781-4805-9c08-74951e900d12", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "df = naas.secret.list()\n", + "df = df[df[\"name\"].isin(secrets.keys())]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb18d4d-cd69-49b5-92ea-4b638885e652", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [] + } + ], + "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" + }, + "naas": { + "notebook_id": "c12c4cbf80c5db89bcacf8d73f0979d06a128e8f691832abe5dc63823b9263e2", + "notebook_path": "Buffer/Buffer_Setup_connection.ipynb" + }, + "papermill": { + "default_parameters": {}, + "environment_variables": {}, + "parameters": {}, + "version": "2.4.0" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Clockify/Clockify_Get_time_entries_for_a_user_on_workspace.ipynb b/Clockify/Clockify_Get_time_entries_for_a_user_on_workspace.ipynb index 82c5b10114..beaab52e58 100644 --- a/Clockify/Clockify_Get_time_entries_for_a_user_on_workspace.ipynb +++ b/Clockify/Clockify_Get_time_entries_for_a_user_on_workspace.ipynb @@ -92,7 +92,8 @@ "source": [ "**References:**\n", "- [Clockify API Documentation](https://docs.clockify.me/#tag/Time-entry/operation/getTimeEntries)\n", - "- [Clockify API Client](https://github.com/toggl/clockify-api-python)" + "- [Clockify API Client](https://github.com/toggl/clockify-api-python)\n", + "- [Get your Clockify API key](https://clockify.me/user/settings)" ] }, { @@ -140,8 +141,8 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "- `api_key`: [Get your API key](https://clockify.me/user/settings)\n", + "### Setup variables\n", + "- `api_key`: Clockify API key\n", "- `workspace_id`: ID of the workspace\n", "- `user_id`: ID of the user to get time entries from" ] @@ -363,4 +364,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Clockify/Clockify_Setup_connection.ipynb b/Clockify/Clockify_Setup_connection.ipynb new file mode 100644 index 0000000000..71455166f5 --- /dev/null +++ b/Clockify/Clockify_Setup_connection.ipynb @@ -0,0 +1,282 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a208ea33-c62e-4471-b75d-92558d9b797e", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Clockify.png\"" + ] + }, + { + "cell_type": "markdown", + "id": "a5b2c509-2c29-49e8-af91-4f3f1e386da3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# Clockify - Setup connection\n", + "

Give Feedback | Bug report" + ] + }, + { + "cell_type": "markdown", + "id": "d77fe283-4edd-42d3-a909-8e207d4b842f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #clockify #naas #secret #connection #setup" + ] + }, + { + "cell_type": "markdown", + "id": "b90f2d91-c886-4e36-8265-b09d06bb1c7f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "6bbf7807-dda4-4b8a-b016-fe258a0fa33f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-11-21 (Created: 2023-11-21)" + ] + }, + { + "cell_type": "markdown", + "id": "214749fe-7f0b-4755-b7ea-1d200c234cc6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook help you setup your connection with Clockify and add required credentials to Naas secret. You will be able to establish a seamless connection to Clockify without the need to repeatedly redefine your credentials in variables by using `naas.secret.get()` in your notebook." + ] + }, + { + "cell_type": "markdown", + "id": "a1329bea-ad80-4981-874c-8776b11f89a8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n", + "- [Get your Clockify API key](https://clockify.me/user/settings)\n", + "- [Naas Secret Documentation](https://site.naas.ai/docs/developers/jobs/secret)" + ] + }, + { + "cell_type": "markdown", + "id": "cff349c8-2816-4ae4-9229-027c068eeb51", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "80266a9e-fe54-4f3e-aeb2-01483bbc53f9", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc038b10-2679-42bc-909e-09a298339df4", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "import naas" + ] + }, + { + "cell_type": "markdown", + "id": "30127040-e487-4115-8317-5084823b3a6f", + "metadata": { + "papermill": {}, + "tags": [ + "variables" + ] + }, + "source": [ + "### Setup variables\n", + "**Mandatory**\n", + "- `api_key`: Clockify API key. This value will be stored under the secret 'CLOCKIFY_API_KEY'.\n", + "\n", + "**Optional**\n", + "- `secrets`: Dict to add secrets to naas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d86b8fb-2576-426d-a305-50043c24c23e", + "metadata": { + "papermill": {}, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# Mandatory\n", + "api_key = None\n", + "\n", + "# Optional\n", + "secrets = {\n", + " \"CLOCKIFY_API_KEY\": api_key,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1b0ae044-cac2-479f-b1fc-a3318696adf5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "3aadae7f-fbe5-4f97-a6a9-6efe9dd1a42f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Add secret" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e235794a-6907-4f0e-ab2b-5aa6668a8d3b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "for secret in secrets:\n", + " new_value = secrets.get(secret)\n", + " if new_value:\n", + " naas.secret.add(secret, secrets.get(secret))" + ] + }, + { + "cell_type": "markdown", + "id": "7c97931b-4ce8-46f9-a70c-45393c5669ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "760ec150-d79a-4208-adfe-d0336d443dc8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4005faa2-a781-4805-9c08-74951e900d12", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "df = naas.secret.list()\n", + "df = df[df[\"name\"].isin(secrets.keys())]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb18d4d-cd69-49b5-92ea-4b638885e652", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [] + } + ], + "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" + }, + "naas": { + "notebook_id": "c12c4cbf80c5db89bcacf8d73f0979d06a128e8f691832abe5dc63823b9263e2", + "notebook_path": "Buffer/Buffer_Setup_connection.ipynb" + }, + "papermill": { + "default_parameters": {}, + "environment_variables": {}, + "parameters": {}, + "version": "2.4.0" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Harvest/Harvest_List_all_time_entries.ipynb b/Harvest/Harvest_List_all_time_entries.ipynb index 7d49af4fe2..d0786c8450 100644 --- a/Harvest/Harvest_List_all_time_entries.ipynb +++ b/Harvest/Harvest_List_all_time_entries.ipynb @@ -53,7 +53,7 @@ "tags": [] }, "source": [ - "**Last update:** 2023-06-13 (Created: 2023-06-13)" + "**Last update:** 2023-11-21 (Created: 2023-06-13)" ] }, { @@ -77,7 +77,8 @@ "source": [ "**References:**\n", "- [Harvest API v2 - Time Entries](https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/)\n", - "- [Harvest API v2 - Authentication](https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/)" + "- [Harvest API v2 - Authentication](https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/)\n", + "- [Harvest - Create your personnal access tokens](https://id.getharvest.com/oauth2/access_tokens/new)" ] }, { @@ -125,8 +126,7 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "[Create your personnal access tokens](https://id.getharvest.com/oauth2/access_tokens/new)\n", + "### Setup variables\n", "- `account_id`: Account ID from Harvest\n", "- `access_token`: Access token from Harvest\n", "- `limit`: entries limit, to get all entries enter -1" @@ -346,4 +346,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Harvest/Harvest_List_all_users.ipynb b/Harvest/Harvest_List_all_users.ipynb index eacab8ef86..204c7bb826 100644 --- a/Harvest/Harvest_List_all_users.ipynb +++ b/Harvest/Harvest_List_all_users.ipynb @@ -53,7 +53,7 @@ "tags": [] }, "source": [ - "**Last update:** 2023-08-03 (Created: 2023-08-03)" + "**Last update:** 2023-11-21 (Created: 2023-08-03)" ] }, { @@ -77,7 +77,8 @@ "source": [ "**References:**\n", "- [Harvest API v2 - Users](https://help.getharvest.com/api-v2/users-api/users/users/)\n", - "- [Harvest API v2 - Authentication](https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/)" + "- [Harvest API v2 - Authentication](https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/)\n", + "- [Harvest - Create your personnal access tokens](https://id.getharvest.com/oauth2/access_tokens/new)" ] }, { @@ -125,9 +126,7 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "\n", - "[Create your personnal access tokens](https://id.getharvest.com/oauth2/access_tokens/new)\n", + "### Setup variables\n", "- `account_id`: Account ID from Harvest\n", "- `access_token`: Access token from Harvest\n", "- `limit`: users limit, to get all users enter -1" @@ -341,4 +340,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Harvest/Harvest_Setup_connection.ipynb b/Harvest/Harvest_Setup_connection.ipynb new file mode 100644 index 0000000000..711310ea31 --- /dev/null +++ b/Harvest/Harvest_Setup_connection.ipynb @@ -0,0 +1,285 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "50f5542d-014f-4ea3-b75d-0d60013a046a", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Harvest.png\"" + ] + }, + { + "cell_type": "markdown", + "id": "a5b2c509-2c29-49e8-af91-4f3f1e386da3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# Harvest - Setup connection\n", + "

Give Feedback | Bug report" + ] + }, + { + "cell_type": "markdown", + "id": "d77fe283-4edd-42d3-a909-8e207d4b842f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #harvest #naas #secret #connection #setup" + ] + }, + { + "cell_type": "markdown", + "id": "b90f2d91-c886-4e36-8265-b09d06bb1c7f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "6bbf7807-dda4-4b8a-b016-fe258a0fa33f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-11-21 (Created: 2023-11-21)" + ] + }, + { + "cell_type": "markdown", + "id": "214749fe-7f0b-4755-b7ea-1d200c234cc6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook help you setup your connection with Harvest and add required credentials to Naas secret. You will be able to establish a seamless connection to Harvest without the need to repeatedly redefine your credentials in variables by using `naas.secret.get()` in your notebook." + ] + }, + { + "cell_type": "markdown", + "id": "a1329bea-ad80-4981-874c-8776b11f89a8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n", + "- [Harvest - Create your personnal access tokens](https://id.getharvest.com/oauth2/access_tokens/new)\n", + "- [Naas Secret Documentation](https://site.naas.ai/docs/developers/jobs/secret)" + ] + }, + { + "cell_type": "markdown", + "id": "cff349c8-2816-4ae4-9229-027c068eeb51", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "80266a9e-fe54-4f3e-aeb2-01483bbc53f9", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc038b10-2679-42bc-909e-09a298339df4", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "import naas" + ] + }, + { + "cell_type": "markdown", + "id": "30127040-e487-4115-8317-5084823b3a6f", + "metadata": { + "papermill": {}, + "tags": [ + "variables" + ] + }, + "source": [ + "### Setup variables\n", + "**Mandatory**\n", + "- `account_id`: Account ID from Harvest. This value will be stored under the secret 'HARVEST_ACCOUNT_ID'.\n", + "- `access_token`: Access token from Harvest. This value will be stored under the secret 'HARVEST_ACCESS_TOKEN'.\n", + "\n", + "**Optional**\n", + "- `secrets`: Dict to add secrets to naas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d86b8fb-2576-426d-a305-50043c24c23e", + "metadata": { + "papermill": {}, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# Mandatory\n", + "account_id = None\n", + "access_token = None\n", + "\n", + "# Optional\n", + "secrets = {\n", + " \"HARVEST_ACCOUNT_ID\": account_id,\n", + " \"HARVEST_ACCESS_TOKEN\": access_token,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1b0ae044-cac2-479f-b1fc-a3318696adf5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "3aadae7f-fbe5-4f97-a6a9-6efe9dd1a42f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Add secret" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e235794a-6907-4f0e-ab2b-5aa6668a8d3b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "for secret in secrets:\n", + " new_value = secrets.get(secret)\n", + " if new_value:\n", + " naas.secret.add(secret, secrets.get(secret))" + ] + }, + { + "cell_type": "markdown", + "id": "7c97931b-4ce8-46f9-a70c-45393c5669ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "760ec150-d79a-4208-adfe-d0336d443dc8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4005faa2-a781-4805-9c08-74951e900d12", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "df = naas.secret.list()\n", + "df = df[df[\"name\"].isin(secrets.keys())]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb18d4d-cd69-49b5-92ea-4b638885e652", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [] + } + ], + "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" + }, + "naas": { + "notebook_id": "c12c4cbf80c5db89bcacf8d73f0979d06a128e8f691832abe5dc63823b9263e2", + "notebook_path": "Buffer/Buffer_Setup_connection.ipynb" + }, + "papermill": { + "default_parameters": {}, + "environment_variables": {}, + "parameters": {}, + "version": "2.4.0" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Trello/Trello_Get_Cards_on_a_Board.ipynb b/Trello/Trello_Get_Cards_on_a_Board.ipynb index b3bd33e0a9..2f2e842ba9 100644 --- a/Trello/Trello_Get_Cards_on_a_Board.ipynb +++ b/Trello/Trello_Get_Cards_on_a_Board.ipynb @@ -77,7 +77,8 @@ "source": [ "**References:**\n", "- [Trello API Documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-get)\n", - "- [Trello API Authentication](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication)" + "- [Trello API Authentication](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication)\n", + "- [Get your Trello API key](https://github.com/Benjifilly/My_notebooks/wiki/How-to-obtain-an-API-key-for-Trello)" ] }, { @@ -124,8 +125,8 @@ "tags": [] }, "source": [ - "### Setup Variables\n", - "- `api_key`: Your Trello API key. [Get your API key here](https://github.com/Benjifilly/My_notebooks/wiki/How-to-obtain-an-API-key-for-Trello)\n", + "### Setup variables\n", + "- `api_key`: Your Trello API key.\n", "- `force_update`: Parameters to enforce the token update\n", "- `board_id`: The ID of the board you want to get the cards from" ] @@ -353,4 +354,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/Trello/Trello_Setup_connection.ipynb b/Trello/Trello_Setup_connection.ipynb new file mode 100644 index 0000000000..86e80998ca --- /dev/null +++ b/Trello/Trello_Setup_connection.ipynb @@ -0,0 +1,282 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "35e4aae9-2471-40b5-8488-b5c74c54f3c5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Trello.png\"" + ] + }, + { + "cell_type": "markdown", + "id": "a5b2c509-2c29-49e8-af91-4f3f1e386da3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# Trello - Setup connection\n", + "

Give Feedback | Bug report" + ] + }, + { + "cell_type": "markdown", + "id": "d77fe283-4edd-42d3-a909-8e207d4b842f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #trello #naas #secret #connection #setup" + ] + }, + { + "cell_type": "markdown", + "id": "b90f2d91-c886-4e36-8265-b09d06bb1c7f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "6bbf7807-dda4-4b8a-b016-fe258a0fa33f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-11-21 (Created: 2023-11-21)" + ] + }, + { + "cell_type": "markdown", + "id": "214749fe-7f0b-4755-b7ea-1d200c234cc6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook help you setup your connection with Trello and add required credentials to Naas secret. You will be able to establish a seamless connection to Trello without the need to repeatedly redefine your credentials in variables by using `naas.secret.get()` in your notebook." + ] + }, + { + "cell_type": "markdown", + "id": "a1329bea-ad80-4981-874c-8776b11f89a8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n", + "- [Get your Trello API key](https://github.com/Benjifilly/My_notebooks/wiki/How-to-obtain-an-API-key-for-Trello)\n", + "- [Naas Secret Documentation](https://site.naas.ai/docs/developers/jobs/secret)" + ] + }, + { + "cell_type": "markdown", + "id": "cff349c8-2816-4ae4-9229-027c068eeb51", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "80266a9e-fe54-4f3e-aeb2-01483bbc53f9", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc038b10-2679-42bc-909e-09a298339df4", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "import naas" + ] + }, + { + "cell_type": "markdown", + "id": "30127040-e487-4115-8317-5084823b3a6f", + "metadata": { + "papermill": {}, + "tags": [ + "variables" + ] + }, + "source": [ + "### Setup variables\n", + "**Mandatory**\n", + "- `api_key`: Your Trello API key. This value will be stored under the secret 'TRELLO_API_KEY'.\n", + "\n", + "**Optional**\n", + "- `secrets`: Dict to add secrets to naas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d86b8fb-2576-426d-a305-50043c24c23e", + "metadata": { + "papermill": {}, + "tags": [ + "parameters" + ] + }, + "outputs": [], + "source": [ + "# Mandatory\n", + "api_key = None\n", + "\n", + "# Optional\n", + "secrets = {\n", + " \"TRELLO_API_KEY\": api_key,\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1b0ae044-cac2-479f-b1fc-a3318696adf5", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "3aadae7f-fbe5-4f97-a6a9-6efe9dd1a42f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Add secret" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e235794a-6907-4f0e-ab2b-5aa6668a8d3b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "for secret in secrets:\n", + " new_value = secrets.get(secret)\n", + " if new_value:\n", + " naas.secret.add(secret, secrets.get(secret))" + ] + }, + { + "cell_type": "markdown", + "id": "7c97931b-4ce8-46f9-a70c-45393c5669ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "760ec150-d79a-4208-adfe-d0336d443dc8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4005faa2-a781-4805-9c08-74951e900d12", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [ + "df = naas.secret.list()\n", + "df = df[df[\"name\"].isin(secrets.keys())]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3cb18d4d-cd69-49b5-92ea-4b638885e652", + "metadata": { + "papermill": {}, + "tags": [] + }, + "outputs": [], + "source": [] + } + ], + "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" + }, + "naas": { + "notebook_id": "c12c4cbf80c5db89bcacf8d73f0979d06a128e8f691832abe5dc63823b9263e2", + "notebook_path": "Buffer/Buffer_Setup_connection.ipynb" + }, + "papermill": { + "default_parameters": {}, + "environment_variables": {}, + "parameters": {}, + "version": "2.4.0" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}