{
  "id": 45028,
  "title": "How extract files with python",
  "url": "/competitions/dogs-vs-cats/discussion/45028",
  "author_name": "",
  "post_date": "2017-12-05T15:35:24.726981500Z",
  "votes": null,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hi everyone,\nis it possible with python extract files from directly kaggle web site?\nSo for example, I have this code:\nimport cv2\nimport numpy as np\nimport os\nfrom random import shuffle\nfrom tqdm import tqdm\nTRAIN_DIR = '<a href=\"https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip\">https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip</a>'</p>\n\n<p>and I would extract files from test1.zip to continue analyzing images of cats and dogs.\nCan anyone help me, please?</p>",
  "messages": [
    {
      "id": "253742",
      "postDate": "12/05/2017 15:35:24",
      "content": "<p>Hi everyone,\nis it possible with python extract files from directly kaggle web site?\nSo for example, I have this code:\nimport cv2\nimport numpy as np\nimport os\nfrom random import shuffle\nfrom tqdm import tqdm\nTRAIN_DIR = '<a href=\"https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip\">https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip</a>'</p>\n\n<p>and I would extract files from test1.zip to continue analyzing images of cats and dogs.\nCan anyone help me, please?</p>",
      "rawMarkdown": "Hi everyone,\nis it possible with python extract files from directly kaggle web site?\nSo for example, I have this code:\nimport cv2\nimport numpy as np\nimport os\nfrom random import shuffle\nfrom tqdm import tqdm\nTRAIN_DIR = 'https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip'\n\nand I would extract files from test1.zip to continue analyzing images of cats and dogs.\nCan anyone help me, please?",
      "votes": null
    },
    {
      "id": "284670",
      "postDate": "02/17/2018 22:04:36",
      "content": "<pre><code>   import os\n   import tarfile\n   def  custome_extract(filname, force=False):\n             tar = tarfile.open(filename)\n             tar.extractall(data_root)\n             tar.close()\n</code></pre>",
      "rawMarkdown": "import os\n       import tarfile\n       def  custome_extract(filname, force=False):\n                 tar = tarfile.open(filename)\n                 tar.extractall(data_root)\n                 tar.close()",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 284670,
      "author_name": "testpython",
      "author_url": "",
      "post_date": "02/17/2018 22:04:36",
      "content": "<pre><code>   import os\n   import tarfile\n   def  custome_extract(filname, force=False):\n             tar = tarfile.open(filename)\n             tar.extractall(data_root)\n             tar.close()\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "253742": "Hi everyone,\nis it possible with python extract files from directly kaggle web site?\nSo for example, I have this code:\nimport cv2\nimport numpy as np\nimport os\nfrom random import shuffle\nfrom tqdm import tqdm\nTRAIN_DIR = 'https://www.kaggle.com/c/dogs-vs-cats/download/test1.zip'\n\nand I would extract files from test1.zip to continue analyzing images of cats and dogs.\nCan anyone help me, please?",
    "284670": "import os\n       import tarfile\n       def  custome_extract(filname, force=False):\n                 tar = tarfile.open(filename)\n                 tar.extractall(data_root)\n                 tar.close()"
  },
  "source": "meta"
}