This week’s article is about packaging your Python code. Sounds daunting? Actually it is pretty simple.
Bob Belderbos
Bob studied business economics, but got fired up about programming early in his career. He taught himself web design / coding and started living his biggest passion: automate the boring stuff, making other people's lives easier. Since then he has coded projects accruing millions in cost savings and built a coding platform that has taught Python to thousands of people worldwide. He deeply cares about helping other people succeed. His biggest win will be your next win!
Building a Karma Bot with Python and the Slack API
By Bob Belderbos on 25 June 2017
We love Slack! But what if we can make it even cooler? Imagine: you are geeking out with your fellow developers on Slack and you want to give them credit. Or you can write “stupidsubject–” and it automagically shows “stupidsubject’s karma decreased to -2”. Enter Karma Bot. This is nothing new but building one myself was a great learning exercise and a fun tool we use on our Slack now.
Parsing Twitter Geo Data and Mocking API Calls by Example
By Bob Belderbos on 17 June 2017
“Is this Bob or Julian?!” … yeah tweeting from our shared @pybites Twitter account can be confusing! So I made a little script to parse the location of our tweets. Then I extended it to make it testable. I wrote a decorator to cache a couple of API outputs to be used with the unittest.mock patch decorator I learned about. A simple script turned into a good learning exercise.
Next Time I Will Use Pandas to Parse Html Tables
By Bob Belderbos on 8 June 2017
Last week I did some html table parsing with BeautifulSoup and regex. It turns out there is an easier way to do this: Pandas.
OOP Beyond the Basics: Using Properties for Encapsulation, Computation and Refactoring
By Bob Belderbos on 31 May 2017
In this article I share my learning of the property decorator coding a simple Account class. I think it’s an unmissable tool in your (Python) OOP toolkit.
PyCon 2017 – Digest, Impressions, Reflection
By Bob Belderbos on 24 May 2017
PyCon 2017 was such a great conference, I made so many good connections, got to see many good things the community is working on. It was very inspiring. In this article a digest.
Building a Simple Birthday App with Flask-SQLAlchemy
By Bob Belderbos on 11 May 2017
In this article I teach you how to get started with Flask-SQLAlchemy. I will set up a model, create the DB, retrieve birthdays from FB and import them into the DB. Lastly I will query the birthdays by date range.
How to Write a Simple Slack Bot to Monitor Your Brand on Twitter
By Bob Belderbos on 25 April 2017
In this article I show you how to monitor Twitter and post alerts to a Slack channel. We built a nice tool to monitor whenever our domain gets mentioned on Twitter. The slacker and twython modules made this pretty easy. We also use configparser and logging.
Simple Flask app to compare the weather of 2 cities
By Bob Belderbos on 20 April 2017
In this post I show you how to build a simple Flask app to compare the weather of 2 cities using the OpenWeatherMap API. Maybe this aids you in solving this week’s challenge.
How to Write a Decorator with an Optional Argument?
By Bob Belderbos on 11 April 2017
When playing with decorators (this week’s challenge) I got stuck: how do you write a decorator that takes an optional argument? Python cookbook 3rd ed edition to the rescue. In this post how I failed my way to the right solution.