Automate the Boring Stuff with Python (2015)
automatetheboringstuff.com
automatetheboringstuff.com
I had no prior experience with programming, and at the time I only wanted to learn how to write enough code to help me with my job. This book was perfect for that goal.
It took me a couple of weeks to get through it all and write the program I needed to write, but when it worked, I was amazed. I remember going to grab coffee to celebrate and on my walk I started thinking about other job tasks I could automate. Most of public accounting deals with comparing PDF reports and Excel data, so I genuinely believed I could write programs to automate the majority of tasks at my job.
I started to learn on my own with some common online resources. I would get so excited to come home from work so I could dive further into my studies, and the more I learned, the more opportunities I saw: what if there was a way for a computer to perform all the analysis and statistical processing for an audit? What if a program could monitor financial transactions and automatically complete taxes for clients?
Flash forward a few months and I went all-in on software development. Quit my job as a public accountant, finished a boot camp, and started working as a developer.
It was the best decision of my life and this book was the catalyst. I’m so grateful that Al wrote this, and I highly recommend it for people whose jobs have a lot of boring stuff —- especially public accountants :).
Figure out how to put your industry knowledge to work and you'll reap massive rewards. At most early-stage startups, programming & industry knowledge is generally split between two or more people, which slows things down tremendously.
If you're both of those people, you can build something that you know people will want, and likely faster, because you were the customer, and you will know exactly what will—and won't—matter. If that's not a startup superpower, I don't know what is.
The main problem is that selling to accounting firms is difficult because procurement usually goes through partners. At the firms I worked for, our procurement process required buy-in from a majority of the partners and the product would require serious security features that are beyond my current abilities, so those two facts deterred me from pursuing that route.
The real future is integrating audit software with financial bookkeeping. This is one area where I think blockchain/smart contracts actually could be utilized to ensure audit quality. Auditors essentially look at a small portion of the transactions made by a company during a year, so software could monitor it in parallel. You’d still need an audit team to review the findings and ensure the software was working properly, but the cost would be a fraction of what it takes to audit a company by hand today.
Thank you for asking — it’s been a while since I’ve been able to geek out like this! One day I’d like to build those tools, but in the meantime I’m working on a personal finance product. It’s almost done, so hopefully you’ll see it when I submit it to HN to get dragged across the coals.
I totally agree with your premise, although in practice I’ve found that the phrase “review the findings and ensure the software was working properly” snuggles in a lot of complexity. It implies that working properly is well-defined and formally verifiable, when it usually isn’t.
I’ve had very frank meetings where I’ve explained that, ultimately, log statements can be totally fictional, and we can technically pay out amounts that diverge from the amounts in a report. The amount of trust you have in the developer and your dependencies are the weakest links in the chain, and, if you’re honest in explaining to that level of detail, most compliance minded people come away uneasy. But this is how every company operates?
There’s definitely a need for verifiable money transfer infrastructure, but I think most companies that roll their own payment infrastructure would rather pretend that the problem is a boogeyman.
Looking back, my code was absolutely atrocious and I was on a team of 1 (just me) but this book and that 4 month co-op is essentially what got me to transition from applying to network admin roles after graduation to applying and getting a platform engineering focused role and focus on software development. It's what I've been doing ever since!
I want to be able to do statistical analysis, queries, and just "be better" at breaking down a problem into easily solvable steps.
I'm using this book as a "learn the basics" stepping stone, and Project Euler as a list of solvable problems which will let me practice solving problems. After that I'll move into some personal projects I have in mind.
Does anyone have additional book or resource recommendations beyond that? I know packages like NumPy and/or SciPy will be useful down the line.
* Codecademy feels overpriced at $40/month or $250/year (no refunds for using a partial year).
* Google Python class was free but about 10 years old. With the Python 2->3 debacle, I was unsure if fundamentals had changed and hesitant to sink my time into it.
* Lynda runs $25 or $40/month but would offer python as well as many other resources.
* Udemy - has a number of courses including one by Al, the author of this book. Looked like it'd be a good value, but I'm not sure how much more value the videos add than the book.
i highly recommend the courses how to code: simple data and how to code: complex data to supplement your learning to address the quoted goal. don’t be put off by the teaching language or the simplicity at the start. it gets more complicated as you go. the courses teach systematic program design and are based upon the book how to design programs.
everybody and their dog knows python. you will not separate yourself by just knowing python. so in the long term, you need other skills beyond “just programming”. and much of the industry is moving to functional-first multiparadigm langauges and more and more concurrent/asynchronous programming. python is a terrible choice for both of those and there is no clear evolution for python in those directions. it is a very outdated language in my opinion, its usage and amount of libraries available for it aside.
by all means, learn python, since there are a lot of resources and jobs that need it, but i highly recommend also learning a functional language. my recommendations would be f# (a .net language) and elixir. f# is a very ripe language for automation, probably even more so than python.
there are also python courses by MIT on edX you should check out. (actually, they are more computer science courses that use python, but there is an advanced one for using python for scientific applications.)
It's been a while, but I used to have "library cards" from libraries in all my nearby cities.
Thinking about it now, I think my Lynda access was through Iowa State.
https://runestone.academy/runestone/books/published/pythonds...
Programming is inherently creative and few books that I've read have room for creativity. I find it better to discover information than get it from a curriculum.
Have programmed c++ about a decade ago.. Nice to get back into it I have to say, there is an instant gratification from solving something in code, perhaps is the binary nature of something working or not, it's very black and white versus dealing with management issues, which is more like my day job, where your constantly in some grey area or dealing with noise, emails, endless directionless meetings.
Anyway highly recommend this book for non programmers, MU is also a very nice and clean IDE but prefer VS Code.
I'm very familiar with Ruby and for my automation tasks I tend to use it almost exclusively. Of these, is there anything that -
1. Ruby can't do
2. Or is more complex / complicated to do in Ruby
What Python does have specifically for automation in my eyes is that it is often the default language for most Raspberry Pi-related hardware libraries. So if you want to build home automation on accessible and easy hardware, the Pi is very welcoming to Python just in terms of making things easy, providing libraries.
It is also heavily supported for machine learning and computer vision which is related. Again, this is generally just a matter of library support.
I don't know the Ruby ecosystem well enough to say if it has equivalents to all the Python scraping, fuzzy matching and such libraries out there. But I expect it does. So that bit is probably a wash.
Hope that gives a perspective.
Didn't know about it being the default language for Raspberry Pi libraries.
Thanks. I've been planning to look at both learning some ML and doing some small Raspberry Pi projects. That's good motivation for diving into Python!
Side note: Ruby has more syntax to grok, which makes it harder to read (for me). On the other hand Python does have its own idiosyncrasies and subtle behaviors. However, Ruby also has some features (like multiline inline functions) that one may easily miss in Python, but they haven't been worth switching over for me.
There's a comparison between node and python's async/await syntaxes here https://medium.com/@interfacer/intro-to-async-concurrency-in...
For ruby I found this article which shows the gist of what we are trying to accomplish with async/await (we want to gather a bunch of promises and await all their results and have them run concurrently in an event loop so that when one is waiting for IO to complete, the other one takes over and runs) https://www.codeotaku.com/journal/2018-06/asynchronous-ruby/...
In case of Ruby, I've found these libraries (ruby gems) to be very useful.
1. Sidekiq - https://github.com/mperham/sidekiq
2. RocketJob - https://github.com/rocketjob/rocketjob
What I'm guessing you're saying is that this kind of behavior is available natively in Python, whereas in Ruby, it is achieved by some roundabout fashion.
async/await works at a function level in the same process. Asyncio in python is pretty much the async/await from node/js.
Sidekiq alternative in python would be closer to http://www.celeryproject.org/
Is it?
I'd imagine JavaScript usage/execution is probably way way higher.
For the second, the definition of 'scripting language' used to be 'doesn't use a compiler' but JS and everything else has a JIT now, so 'make something quick' is a modern equivalent.
let result = await CallbackPromise.from(some.callbackConventionFunction, param);
Then you get a unified form for the code-base.It’s weird lots of Ruby developers feel the need to shout “don’t forget ruby!” when nice things about Python are posted. Just take your pick, who cares.
Btw, I know, assume good faith, yada yada.
Some people obviously swear by it, and thus created Ruby on Rails.
Python does have some weird features as well, but I try to steer away from it, and keep my code simple and boring. My primary concern is how efficient the code is executed as it gets translated into machine code.
The cost/benefit ratio of switching to Ruby never quite seemed worth it. So I continue to stick with Python, for applications that are not time execution sensitive. For all others, there's Java, then C++, then C itself.
some of the best things we have are created by total amateurs. thats how this works.
i’m not 100% on the life histories of Matz and Guido but wasnt Guido kind of also an amateur too?
That is assuming you know how to work with data structures and algorithms the right way. A O(n^n) implementation runs slow in C as well.