|
5 | 5 | <link href="https://learnbyexample.github.io/atom.xml" rel="self" type="application/atom+xml"/> |
6 | 6 | <link href="https://learnbyexample.github.io"/> |
7 | 7 | <generator uri="https://www.getzola.org/">Zola</generator> |
8 | | - <updated>2022-01-08T00:00:00+00:00</updated> |
| 8 | + <updated>2022-01-11T00:00:00+00:00</updated> |
9 | 9 | <id>https://learnbyexample.github.io/atom.xml</id> |
| 10 | + <entry xml:lang="en"> |
| 11 | + <title>Automating Excel with Python - book review</title> |
| 12 | + <published>2022-01-11T00:00:00+00:00</published> |
| 13 | + <updated>2022-01-11T00:00:00+00:00</updated> |
| 14 | + <link href="https://learnbyexample.github.io/automating-excel-with-python-review/" type="text/html"/> |
| 15 | + <id>https://learnbyexample.github.io/automating-excel-with-python-review/</id> |
| 16 | + <content type="html"><p>In this post, I review <strong>Automating Excel with Python</strong> by Michael Driscoll. From the introduction chapter of this book:</p> |
| 17 | +<blockquote> |
| 18 | +<p>The purpose of this book is to help you learn how to use Python to work with Excel. You will be using a package called OpenPyXL to create, read, and edit Excel documents with Python. While the focus of this book will be on OpenPyXL, you will also learn about other Python packages that you can use to interact with Excel using the Python programming language.</p> |
| 19 | +</blockquote> |
| 20 | +<span id="continue-reading"></span><h2 id="book-details">Book details<a class="zola-anchor" href="#book-details" aria-label="Anchor link for: book-details">🔗</a></h2> |
| 21 | +<p align="center"><img src="/images/automating_excel/automating_excel_with_python.jpg" alt="Automating Excel with Python book cover" /></p> |
| 22 | +<p align="center">Book cover</p> |
| 23 | +<ul> |
| 24 | +<li><a href="https://www.amazon.com/dp/B09M5551W2">Amazon</a> — Paperback, Kindle</li> |
| 25 | +<li><a href="https://driscollis.gumroad.com/l/openpyxl">Gumroad</a> — PDF, EPUB, Mobi</li> |
| 26 | +<li><a href="https://leanpub.com/openpyxl">Leanpub</a> — PDF, EPUB, Mobi</li> |
| 27 | +<li><a href="https://github.com/driscollis/automating_excel_with_python">GitHub</a> — code examples and sample spreadsheets used in the book</li> |
| 28 | +<li><a href="https://www.goodreads.com/book/show/59974445-automating-excel-with-python">Goodreads</a> — book reviews</li> |
| 29 | +</ul> |
| 30 | +<h2 id="review">Review<a class="zola-anchor" href="#review" aria-label="Anchor link for: review">🔗</a></h2> |
| 31 | +<p>My very first job assignment (at a semiconductor company) required me to use spreadsheets for tabulating results of various experiments, adding charts, etc. I used to manually copy-paste the results generated from a Perl script. There were multiple sheets and my work was complicated enough to require multiple months of refinement, feature modifications, etc. Not sure if a library like OpenPyXL existed back then, but I think I should've at least asked/searched ways to automate the spreadsheet process.</p> |
| 32 | +<p>Going through this book felt like someone wrote a book just for that project, albeit 13 years late. Here's a rough list of features that would've helped me:</p> |
| 33 | +<ul> |
| 34 | +<li>Creating <code>xlsx</code> files with multiple sheets</li> |
| 35 | +<li>Adding data</li> |
| 36 | +<li>Formatting cells based on a known equation</li> |
| 37 | +<li>Creating charts</li> |
| 38 | +</ul> |
| 39 | +<p>Instructions and examples were clear and easy to follow. Snapshots were also shown for all the examples, so you can check if you've followed along as expected. While the book is best suited if you have MS Excel, most of the examples worked for me on LibreOffice Calc. Only the charts had major differences — some types weren't supported and x/y axis label/data were problematic as shown below:</p> |
| 40 | +<p align="center"><img src="/images/automating_excel/bar_chart_excel.png" alt="Bar Chart in Excel" width="600px" height="400px"/></p> |
| 41 | +<p align="center">Bar Chart in Excel (snapshot from the book)</p> |
| 42 | +<p align="center"><img src="/images/automating_excel/bar_chart_calc.png" alt="Bar Chart in Calc" width="600px" height="400px"/></p> |
| 43 | +<p align="center">Bar Chart in LibreOffice Calc (what I got on my machine)</p> |
| 44 | +<br> |
| 45 | +<p>Apart from the <code>openpyxl</code> module, the author also briefly covered how you can use <code>pandas</code>, <code>xlsxwriter</code> and <code>gspread</code> (for working with Google sheets). Some features were presented at the end as Appendix chapters.</p> |
| 46 | +<h2 id="table-of-contents">Table of Contents<a class="zola-anchor" href="#table-of-contents" aria-label="Anchor link for: table-of-contents">🔗</a></h2> |
| 47 | +<ul> |
| 48 | +<li>Introduction</li> |
| 49 | +<li>Chapter 1 - Setting Up Your Machine</li> |
| 50 | +<li>Chapter 2 - Reading Spreadsheets with OpenPyXL</li> |
| 51 | +<li>Chapter 3 - Creating a Spreadsheet with OpenPyXL</li> |
| 52 | +<li>Chapter 4 - Styling Cells</li> |
| 53 | +<li>Chapter 5 - Conditional Formatting</li> |
| 54 | +<li>Chapter 6 - Creating Charts</li> |
| 55 | +<li>Chapter 7 - Chart Types</li> |
| 56 | +<li>Chapter 8 - Converting CSV to Excel</li> |
| 57 | +<li>Chapter 9 - Using Pandas with Excel</li> |
| 58 | +<li>Chapter 10 - Python and Google Sheets</li> |
| 59 | +<li>Chapter 11 - XlsxWriter</li> |
| 60 | +<li>Appendix A - Cell Comments</li> |
| 61 | +<li>Appendix B - Print Settings Basics</li> |
| 62 | +<li>Appendix C - Formulas</li> |
| 63 | +</ul> |
| 64 | +<h2 id="feedback-and-reviews">Feedback and Reviews<a class="zola-anchor" href="#feedback-and-reviews" aria-label="Anchor link for: feedback-and-reviews">🔗</a></h2> |
| 65 | +<p>All in all, I would highly recommend this book for those wanting to use Python for automating spreadsheets. I'd request you to post reviews after going through the book (they help us indie authors a lot). And please do contact the author to let him know your feedback or if you have any clarifications.</p> |
| 66 | +<p>Happy learning :)</p> |
| 67 | +</content> |
| 68 | + </entry> |
10 | 69 | <entry xml:lang="en"> |
11 | 70 | <title>Vim prank: alias vim='vim -y'</title> |
12 | 71 | <published>2022-01-07T00:00:00+00:00</published> |
@@ -3437,20 +3496,20 @@ mission success |
3437 | 3496 | <updated>2019-05-13T00:00:00+00:00</updated> |
3438 | 3497 | <link href="https://learnbyexample.github.io/python-gui-book-review/" type="text/html"/> |
3439 | 3498 | <id>https://learnbyexample.github.io/python-gui-book-review/</id> |
3440 | | - <content type="html"><p><img src="/images/python_gui/GUI_example.jpg" alt="GUI example" /></p> |
| 3499 | + <content type="html"><p align="center"><img src="/images/python_gui/GUI_example.jpg" alt="GUI example" /></p> |
3441 | 3500 | <p><em>Photo Credit: <a href="https://www.pexels.com/photo/apple-computer-desk-devices-326501/">Tranmautritam</a> on <a href="https://www.pexels.com/">Pexels</a></em></p> |
3442 | | -<span id="continue-reading"></span> |
| 3501 | +<span id="continue-reading"></span><br> |
3443 | 3502 | <p>I've always wanted to create nice looking, useful GUI applications over the years. And I've given up most of the time as the programming seemed too difficult for me and GUI requires at least some level of design skills. I only managed to grit through one Android app for over a year as it was a dream game from school days and I had loads of free time having quit my job. At the end of it though, I had a spaghetti mess of several 1000+ lines programs and a strong aversion to Java and object oriented programming. Part of the reason is that I didn't try to learn in a formal way, just started from a tutorial closest to the game I wanted to do.</p> |
3444 | 3503 | <p>Several years later, here I am, trying my hand with GUI again. I have several small to medium scale apps in mind to implement and hopefully I'll avoid previous mistakes, especially feature creep. When I saw <a href="https://twitter.com/driscollis/status/1109106540160733184">this tweet from Mike Driscoll</a>, I took up the offer. I got a free book in exchange for reviewing <a href="https://www.blog.pythonlibrary.org/2019/05/08/creating-gui-applications-with-wxpython-now-available/">Creating GUI Applications with wxPython</a>. The book is currently on sale till May 15. Having to review has served as an extra incentive to read the book regularly, and so far I'm quite satisfied to have done so.</p> |
3445 | | -<p><img src="/images/python_gui/wxPython_book_cover.png" alt="book cover" /></p> |
| 3504 | +<p align="center"><img src="/images/python_gui/wxPython_book_cover.png" alt="book cover" /></p> |
3446 | 3505 | <p>I hadn't heard of <a href="https://wxpython.org">wxPython</a> before this book. When it comes to GUI in Python, I knew about <code>tkinter</code> which comes by default with standard libary, <a href="https://kivy.org">Kivy</a>, <a href="https://www.pygame.org">Pygame</a> and <a href="https://pypi.org/project/PyQt5/">PyQt5</a>. This book starts with an introduction to <code>wxPython</code> and then dives into project-based approach. I've finished half the chapters so far, covering four project concepts:</p> |
3447 | 3506 | <ul> |
3448 | 3507 | <li>Image viewer</li> |
3449 | 3508 | <li>Database viewer and editor</li> |
3450 | 3509 | <li>Calculator</li> |
3451 | 3510 | <li>Archiver</li> |
3452 | 3511 | </ul> |
3453 | | -<p><img src="/images/python_gui/calculator.png" alt="calculator" /></p> |
| 3512 | +<p align="center"><img src="/images/python_gui/calculator.png" alt="calculator" /></p> |
3454 | 3513 | <p>Rest of the chapters cover these topics:</p> |
3455 | 3514 | <ul> |
3456 | 3515 | <li>MP3 tag editor</li> |
|
0 commit comments