Hackers and Slackers

Python

56 Posts
The language, the legend, the liberator.

Structuring your Flask App Like an Adult

Leverage Blueprints, Flask-Assets, and the Application Factory.

When we first started developing in Flask, most of us took the 5 lines of code in the quick-start guide and ran with it. Compared to every other web framework, getting a "Hello world" to flash on screen without being

Flask Author imageTodd Birchard Author imagetodd Oct 15
Read

Extract Nested Data From Complex JSON

The Pythonic way of working with JSON objects

We're all data people here, so you already know the scenario: it happens perhaps once a day, perhaps 5, or even more. There's an API you're working with, and it's great. It contains all the information you're looking for, but

Python Author imageTodd Birchard Author imagetodd Oct 10
Read

Reading and Writing to CSVs in Python

Playing with tabular data the native Python way.

Tables. Cells. Two-dimensional data. We here at Hackers & Slackers know how to talk dirty, but there's one word we'll be missing from our vocabulary today: Pandas.Before the remaining audience closes their browser windows in fury, hear me out.

Python Author imageTodd Birchard Author imagetodd Sep 27
Read

Flask Routing & Sessions: A Subtle Symphony

With great flexibility comes great responsibility

It isn't often you find somebody sad or miserable enough to detail the inner workings of web framework features, such as sessions or routing. This is understandably so; we use frameworks because presumably hate dealing with these things from scratch.

Flask Author imageTodd Birchard Author imagetodd Sep 19
Read

So You've Fucked up your Python Path

A timeless hazing ritual for new Python devs, and how to fix it

I remember back to when I first learned Python. It was a strange decision for a happily employed post-graduate to make, especially for a time when many were screaming for the death of the language with Guido's (outrageous?) grand reveal

Python Author imageTodd Birchard Author imagetodd Sep 12
Read

Code Snippet Corner: Tuning Machine Learning Hyperparameters with Binary Search

Tune the n_estimators parameter in for a Random Forests classifier in scikit-learn in Python

Ah, hyperparameter tuning.  Time & compute-intensive.  Frequently containing weird non-linearities in how changing a parameter changes the score and/or the time it takes to train the model.

RandomizedSearchCV goes noticeably faster than a full GridSearchCV but it still takes

Code Snippet Corner Author imageMatthew Alhonte Author imagematt Sep 03
Read

Create a Custom JIRA Service Desk Portal in Python

When SaaS doesn't cut it, beat it down and take everything its got

When it comes to SaaS products in the realm of Service desks, JIRA Service Desk is at the very least, just as powerful as the next solution (Zendesk comes to mind). This naturally begs the question: Why is JIRA Service

Atlassian Author imageTodd Birchard Author imagetodd Aug 31
Read