{
  "id": 294304,
  "title": "Submit to Kaggle from your Jupyter Notebook",
  "url": "/competitions/cs5785-fall-2021-final/discussion/294304",
  "author_name": "",
  "post_date": "2021-12-09T18:09:01.081673100Z",
  "votes": 4,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I created a small function that allows you to automatically send the <code>submission.csv</code> file to Kaggle right from a notebook using the Kaggle API. Good luck on your quest to catch James!</p>\n<pre>import subprocess\n\ndef submit_to_kaggle(do_submit, message=\"\", show_ldrbrd=False):\n    if do_submit:\n        subprocess.call([\"kaggle\", \"competitions\", \"submit\", \\\n            \"cs5785-fall-2021-final\", \"-f\", \"submission.csv\",\\\n                 \"-m\", message])\n    subprocess.call([\"kaggle\", \"competitions\", \"submissions\", \\\n        \"cs5785-fall-2021-final\"])\n    if show_ldrbrd:\n        subprocess.call([\"kaggle\", \"competitions\", \"leaderboard\", \\\n            \"cs5785-fall-2021-final\", \"--show\"])\n\nsubmit_to_kaggle(True, message=\"trying to catch James...\", \\\n    show_ldrbrd=True)\n</pre>",
  "messages": [
    {
      "id": "1613221",
      "postDate": "12/09/2021 18:09:01",
      "content": "<p>I created a small function that allows you to automatically send the <code>submission.csv</code> file to Kaggle right from a notebook using the Kaggle API. Good luck on your quest to catch James!</p>\n<pre>import subprocess\n\ndef submit_to_kaggle(do_submit, message=\"\", show_ldrbrd=False):\n    if do_submit:\n        subprocess.call([\"kaggle\", \"competitions\", \"submit\", \\\n            \"cs5785-fall-2021-final\", \"-f\", \"submission.csv\",\\\n                 \"-m\", message])\n    subprocess.call([\"kaggle\", \"competitions\", \"submissions\", \\\n        \"cs5785-fall-2021-final\"])\n    if show_ldrbrd:\n        subprocess.call([\"kaggle\", \"competitions\", \"leaderboard\", \\\n            \"cs5785-fall-2021-final\", \"--show\"])\n\nsubmit_to_kaggle(True, message=\"trying to catch James...\", \\\n    show_ldrbrd=True)\n</pre>",
      "rawMarkdown": "I created a small function that allows you to automatically send the `submission.csv` file to Kaggle right from a notebook using the Kaggle API. Good luck on your quest to catch James!\n\n<pre>\nimport subprocess\n\ndef submit_to_kaggle(do_submit, message=\"\", show_ldrbrd=False):\n    if do_submit:\n        subprocess.call([\"kaggle\", \"competitions\", \"submit\", \\\n            \"cs5785-fall-2021-final\", \"-f\", \"submission.csv\",\\\n                 \"-m\", message])\n    subprocess.call([\"kaggle\", \"competitions\", \"submissions\", \\\n        \"cs5785-fall-2021-final\"])\n    if show_ldrbrd:\n        subprocess.call([\"kaggle\", \"competitions\", \"leaderboard\", \\\n            \"cs5785-fall-2021-final\", \"--show\"])\n\nsubmit_to_kaggle(True, message=\"trying to catch James...\", \\\n    show_ldrbrd=True)\n</pre>",
      "votes": null
    },
    {
      "id": "1614872",
      "postDate": "12/11/2021 14:28:14",
      "content": "<p>thanks for sharing!</p>",
      "rawMarkdown": "thanks for sharing!",
      "votes": null
    },
    {
      "id": "1616825",
      "postDate": "12/13/2021 16:49:53",
      "content": "<p>Awesome, thank you Nick! </p>",
      "rawMarkdown": "Awesome, thank you Nick!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1614872,
      "author_name": "siyichen12138",
      "author_url": "",
      "post_date": "12/11/2021 14:28:14",
      "content": "<p>thanks for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1616825,
      "author_name": "joyzhaozhouyi",
      "author_url": "",
      "post_date": "12/13/2021 16:49:53",
      "content": "<p>Awesome, thank you Nick! </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1613221": "I created a small function that allows you to automatically send the `submission.csv` file to Kaggle right from a notebook using the Kaggle API. Good luck on your quest to catch James!\n\n<pre>\nimport subprocess\n\ndef submit_to_kaggle(do_submit, message=\"\", show_ldrbrd=False):\n    if do_submit:\n        subprocess.call([\"kaggle\", \"competitions\", \"submit\", \\\n            \"cs5785-fall-2021-final\", \"-f\", \"submission.csv\",\\\n                 \"-m\", message])\n    subprocess.call([\"kaggle\", \"competitions\", \"submissions\", \\\n        \"cs5785-fall-2021-final\"])\n    if show_ldrbrd:\n        subprocess.call([\"kaggle\", \"competitions\", \"leaderboard\", \\\n            \"cs5785-fall-2021-final\", \"--show\"])\n\nsubmit_to_kaggle(True, message=\"trying to catch James...\", \\\n    show_ldrbrd=True)\n</pre>",
    "1614872": "thanks for sharing!",
    "1616825": "Awesome, thank you Nick!"
  },
  "source": "meta"
}