diff --git a/GitHub-Release-and-Secrets.ipynb b/GitHub-Release-and-Secrets.ipynb new file mode 100644 index 0000000..5a42efe --- /dev/null +++ b/GitHub-Release-and-Secrets.ipynb @@ -0,0 +1,270 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "fa74a82c3dc6db1a", + "metadata": {}, + "source": [ + "# GitHub for data releases " + ] + }, + { + "cell_type": "markdown", + "id": "38c6a6b67bd16e42", + "metadata": {}, + "source": [ + "# Introduction" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "b8b55c9e96c43bc3", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-07T11:57:54.752360Z", + "start_time": "2024-05-07T11:57:51.973091Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: python-dotenv in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (1.0.1)\r\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "%pip install python-dotenv" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "id": "b68da291930fbf4", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-07T16:43:17.166579Z", + "start_time": "2024-05-07T16:43:12.783177Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting PyGithub\r\n", + " Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB)\r\n", + "Collecting pynacl>=1.4.0 (from PyGithub)\r\n", + " Using cached PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB)\r\n", + "Requirement already satisfied: requests>=2.14.0 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from PyGithub) (2.31.0)\r\n", + "Collecting pyjwt>=2.4.0 (from pyjwt[crypto]>=2.4.0->PyGithub)\r\n", + " Downloading PyJWT-2.8.0-py3-none-any.whl.metadata (4.2 kB)\r\n", + "Requirement already satisfied: typing-extensions>=4.0.0 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from PyGithub) (4.10.0)\r\n", + "Requirement already satisfied: urllib3>=1.26.0 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from PyGithub) (2.2.1)\r\n", + "Requirement already satisfied: Deprecated in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from PyGithub) (1.2.14)\r\n", + "Requirement already satisfied: cryptography>=3.4.0 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from pyjwt[crypto]>=2.4.0->PyGithub) (42.0.5)\r\n", + "Requirement already satisfied: cffi>=1.4.1 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from pynacl>=1.4.0->PyGithub) (1.16.0)\r\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from requests>=2.14.0->PyGithub) (3.3.2)\r\n", + "Requirement already satisfied: idna<4,>=2.5 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from requests>=2.14.0->PyGithub) (3.6)\r\n", + "Requirement already satisfied: certifi>=2017.4.17 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from requests>=2.14.0->PyGithub) (2024.2.2)\r\n", + "Requirement already satisfied: wrapt<2,>=1.10 in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from Deprecated->PyGithub) (1.16.0)\r\n", + "Requirement already satisfied: pycparser in /home/marius/miniconda3/envs/llm_langchain/lib/python3.11/site-packages (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub) (2.21)\r\n", + "Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB)\r\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m354.4/354.4 kB\u001b[0m \u001b[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m\r\n", + "\u001b[?25hDownloading PyJWT-2.8.0-py3-none-any.whl (22 kB)\r\n", + "Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)\r\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m856.7/856.7 kB\u001b[0m \u001b[31m11.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\r\n", + "\u001b[?25hInstalling collected packages: pyjwt, pynacl, PyGithub\r\n", + "Successfully installed PyGithub-2.3.0 pyjwt-2.8.0 pynacl-1.5.0\r\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "%pip install PyGithub" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "68cdc5d497e208e3", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-11T16:18:46.000392Z", + "start_time": "2024-05-11T16:18:45.992401Z" + } + }, + "outputs": [], + "source": [ + "from dotenv import load_dotenv\n", + "import os\n", + "\n", + "load_dotenv(\"thesis_env_ro\", verbose=True) # take environment variables from the file\n", + "token = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "1069e0bfa4686f67", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-16T17:44:25.085423Z", + "start_time": "2024-05-16T17:44:21.570849Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "https://api.github.com/repos/norandom/log2ml/releases/assets/168114916\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5f0622d443bc48728f0e7ed72ebd7fab", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0.00/6.28M [00:00