An Ode to Code

Making time to code can be done every day. Carve out those little moments where you can automate tedious tasks or study up on that hot new Python library that takes your quality to another level. Take time to reorganize and refactor in your favorite text editor. Break your script, then break it again. Break […]

Fix Spelling and Grammar with language_tool_python and textblob

Below are two practical Python libraries for text processing. This function uses textblob’s spelling correction along with language_tool_python, which applies grammatical corrections via the Language Tool API. I added these text processing transformations into my concept text generation app. These are free, public APIs up to around 20 requests per second. You can send both […]

Experiencing Flow While Coding

Yesterday, I experienced a flow state where I became manically obsessed with perfecting a script I was working on. I think it’s beautiful code, about 100 lines long without docstrings. It solves a real need and it felt great to write it. Some scripts feel terrible to write and you know they’re bad. However, this […]

ftfy, The Wonky Text Fixing Python Library

Every Python programmer has undoubtedly come across some crazy characters. The ftfy library “Fixes Text For You” and acts like a swiss army knife when you’ve got questionable characters breaking your script. In my case, an HTTP request was failing because of weird cryptic letters hiding in the data when it was only supposed to […]

Memory Monitoring Python Libraries + Tools

If you write Python code, there’s probably been a time or two when you saw the dreaded “MemoryError”. This happens after one of your Python scripts stops because your computer has no spare RAM to execute it. I recently experienced this frustration whilst trying to write hundreds of thousands of csv files. However, this time […]

8 Promising Python Static Site Generators

A static site generator creates static HTML and markdown files to serve as a website. They’re commonly used to host blogs but not exclusively. I recently researched my options to roll a static site in Python. I’m assessing a few of them as a potential future self-hosted blogging solution for this WordPress blog. Or maybe […]

So You Want to Learn Python?

Here are a few Python concepts for beginners to explore if you are starting out with the language. In this post, I’ll highlight my favorite “must-learn” tools to master that come with your Python installation. Understanding them will make you a more capable Python programmer and problem solver. 1. Built-in Functions. They are awesome! You […]

Pick Stocks Intelligently with ffn

How do you calculate stock valuation metrics like Sharpe ratio? Recently I’ve been reading about common stock valuation metrics and wondered how I can apply them to my stock portfolio. I started reading about different metrics, sketching formulas and entertained writing a script to calculate these metrics. But Python has no shortage of finance-related libraries. […]