{"id":127097,"date":"2022-08-08T19:59:26","date_gmt":"2022-08-08T19:59:26","guid":{"rendered":"https:\/\/blog.finxter.com\/?p=555866"},"modified":"2022-08-08T19:59:26","modified_gmt":"2022-08-08T19:59:26","slug":"3-simple-steps-to-convert-calendar-ics-to-csv-excel-in-python","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2022\/08\/08\/3-simple-steps-to-convert-calendar-ics-to-csv-excel-in-python\/","title":{"rendered":"3 Simple Steps to Convert calendar.ics to CSV\/Excel in Python"},"content":{"rendered":"\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-top\" data-payload=\"{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;555866&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}\">\n<div class=\"kksr-stars\">\n<div class=\"kksr-stars-inactive\">\n<div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\"> <span class=\"kksr-muted\">Rate this post<\/span> <\/div>\n<\/div>\n<h2 id=\"bf1b\">Step 1: Install csv-ical Module with PIP<\/h2>\n<p>Run the following command in your command line or PowerShell (Windows) or shell or terminal (macOS, Linux, Ubuntu) to install the <code><a href=\"https:\/\/github.com\/albertyw\/csv-ical\" data-type=\"URL\" data-id=\"https:\/\/github.com\/albertyw\/csv-ical\" target=\"_blank\" rel=\"noreferrer noopener\">csv-ical<\/a><\/code> library:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install csv-ical<\/pre>\n<p>In some instances, you need to modify this command a bit to make it work. If you need more assistance installing the library, check out my detailed guide.<\/p>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f30d.png\" alt=\"\ud83c\udf0d\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Full Guide<\/strong>: <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/installing-specific-package-versions-with-pip\/\" data-type=\"post\" data-id=\"320873\" target=\"_blank\">How to install a library\/module in Python?<\/a><\/p>\n<h2 id=\"2602\">Step 2: Prepare files<\/h2>\n<p id=\"751d\">Create a new Python code file with the extension <code>.py<\/code> or a Jupyter Notebook with the file extension <code>.ipynb<\/code>. This creates a Python script or Jupyter Notebook that can run the code in Step 3 to conver the <code>.ics<\/code>.<\/p>\n<p>Now, put the <code>.ics<\/code> file to be converted in the same folder as the newly-created Python script. <\/p>\n<p id=\"751d\">Use Jupyter Notebook to create a new <code>.ipynb<\/code> file<\/p>\n<h2 id=\"de7d\">Step 3: Convert<\/h2>\n<p>This step consists of running the code doing these three things:<\/p>\n<ul>\n<li>Create and initialize a <code>Convert<\/code> object<\/li>\n<li>Read the <code>.ics<\/code> file<\/li>\n<li>Create the CSV object and save it at the specified location<\/li>\n<\/ul>\n<p>Here&#8217;s the full code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from csv_ical import Convert # Create and initialize a Convert object\nconvert = Convert()\nconvert.CSV_FILE_LOCATION = 'my_file.csv'\nconvert.SAVE_LOCATION = 'my_file.ics' # Read the .ics file\nconvert.read_ical(convert.SAVE_LOCATION) # Create the CSV object and save it at the specified location\nconvert.make_csv()\nconvert.save_csv(convert.CSV_FILE_LOCATION)<\/pre>\n<\/p>\n<p>Thanks for going through the whole tutorial! &lt;3<\/p>\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Rate this post Step 1: Install csv-ical Module with PIP Run the following command in your command line or PowerShell (Windows) or shell or terminal (macOS, Linux, Ubuntu) to install the csv-ical library: pip install csv-ical In some instances, you need to modify this command a bit to make it work. If you need more [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[73,468,528],"class_list":["post-127097","post","type-post","status-publish","format-standard","hentry","category-python-tut","tag-programming","tag-python","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/127097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=127097"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/127097\/revisions"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=127097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=127097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=127097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}