{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-11-05T00:47:48.131663100Z",
     "start_time": "2023-11-05T00:47:35.527891600Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting kaggle\r\n",
      "  Downloading kaggle-1.5.16.tar.gz (83 kB)\r\n",
      "\u001B[2K     \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m83.6/83.6 kB\u001B[0m \u001B[31m444.7 kB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m0:01\u001B[0m00:01\u001B[0m\r\n",
      "\u001B[?25h  Preparing metadata (setup.py) ... \u001B[?25ldone\r\n",
      "\u001B[?25hRequirement already satisfied: six>=1.10 in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (1.16.0)\r\n",
      "Requirement already satisfied: certifi in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (2023.7.22)\r\n",
      "Requirement already satisfied: python-dateutil in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (2.8.2)\r\n",
      "Requirement already satisfied: requests in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (2.31.0)\r\n",
      "Collecting tqdm (from kaggle)\r\n",
      "  Downloading tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)\r\n",
      "\u001B[2K     \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m57.6/57.6 kB\u001B[0m \u001B[31m332.3 kB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m \u001B[36m0:00:01\u001B[0m\r\n",
      "\u001B[?25hCollecting python-slugify (from kaggle)\r\n",
      "  Downloading python_slugify-8.0.1-py2.py3-none-any.whl (9.7 kB)\r\n",
      "Requirement already satisfied: urllib3 in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (2.0.7)\r\n",
      "Requirement already satisfied: bleach in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from kaggle) (6.1.0)\r\n",
      "Requirement already satisfied: webencodings in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from bleach->kaggle) (0.5.1)\r\n",
      "Collecting text-unidecode>=1.3 (from python-slugify->kaggle)\r\n",
      "  Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)\r\n",
      "\u001B[2K     \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m78.2/78.2 kB\u001B[0m \u001B[31m944.9 kB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0ma \u001B[36m0:00:01\u001B[0m\r\n",
      "\u001B[?25hRequirement already satisfied: charset-normalizer<4,>=2 in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from requests->kaggle) (3.3.1)\r\n",
      "Requirement already satisfied: idna<4,>=2.5 in /home/kryo/miniconda3/envs/vlsp2023-tts-api/lib/python3.10/site-packages (from requests->kaggle) (3.4)\r\n",
      "Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)\r\n",
      "\u001B[2K   \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m78.3/78.3 kB\u001B[0m \u001B[31m748.5 kB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m \u001B[36m0:00:01\u001B[0m\r\n",
      "\u001B[?25hBuilding wheels for collected packages: kaggle\r\n",
      "  Building wheel for kaggle (setup.py) ... \u001B[?25ldone\r\n",
      "\u001B[?25h  Created wheel for kaggle: filename=kaggle-1.5.16-py3-none-any.whl size=110683 sha256=fbd426d35c51820adb030ee423c20d997221fd1cdb7093a4b6af3afa94d170f3\r\n",
      "  Stored in directory: /home/kryo/.cache/pip/wheels/43/4b/fb/736478af5e8004810081a06259f9aa2f7c3329fc5d03c2c412\r\n",
      "Successfully built kaggle\r\n",
      "Installing collected packages: text-unidecode, tqdm, python-slugify, kaggle\r\n",
      "Successfully installed kaggle-1.5.16 python-slugify-8.0.1 text-unidecode-1.3 tqdm-4.66.1\r\n"
     ]
    }
   ],
   "source": [
    "!pip install kaggle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "55f5e4a1d2ec2ecc"
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001B[31mERROR: Could not find a version that satisfies the requirement kaggle_api_extended (from versions: none)\u001B[0m\u001B[31m\r\n",
      "\u001B[0m\u001B[31mERROR: No matching distribution found for kaggle_api_extended\u001B[0m\u001B[31m\r\n",
      "\u001B[0m"
     ]
    }
   ],
   "source": [],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-05T00:51:45.918622100Z",
     "start_time": "2023-11-05T00:51:45.022051100Z"
    }
   },
   "id": "28cea8fd0c172fff"
  },
  {
   "cell_type": "markdown",
   "source": [
    "## merge files"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "fd44ed9dee4275cf"
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Files merged successfully!\n"
     ]
    }
   ],
   "source": [
    "import shutil\n",
    "from pathlib import Path\n",
    "try:\n",
    "    with open(Path('merged_file.py'), 'wb') as destination_file:\n",
    "        with open(Path('google_sheet.py'), 'rb') as file1:\n",
    "            shutil.copyfileobj(file1, destination_file)\n",
    "        with open(Path('logger.py'), 'rb') as file2:\n",
    "            shutil.copyfileobj(file2, destination_file)\n",
    "        with open(Path('kaggle_service.py'), 'rb') as file3:\n",
    "            shutil.copyfileobj(file3, destination_file)\n",
    "        with open(Path('main.py'), 'rb') as file4:\n",
    "            shutil.copyfileobj(file4, destination_file)\n",
    "    print(\"Files merged successfully!\")\n",
    "except :\n",
    "    raise Exception(\"Cannot merge files!\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-05T02:15:34.843461500Z",
     "start_time": "2023-11-05T02:15:34.781001200Z"
    }
   },
   "id": "2568f49413e2057c"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}