Articles by Steven Loria

Building a Dashboard for a Python Package

I made a simple dashboard for visualizing marshmallow PyPI downloads.

marshmallow dashboard

Why

While maintaining marshmallow, I found myself running one-off queries against PyPI's BigQuery dataset to answer some recurring questions:

  • How many marshmallow users are using Python 2 vs Python 3?
  • Can we drop support for a minor Python version without …

Dynamic Schemas in marshmallow

marshmallow 3 will have a Schema.from_dict method that generates a Schema class from a dictionary of fields.

from marshmallow import Schema, fields

GistSchema = Schema.from_dict(
    {
        "id": fields.Str(dump_only=True),
        "content": fields.Str(required=True),
    }
)

Here's a rundown of a few use cases this API enables.

Schemas generated at …

Introducing local-repl: Supercharged Node.js REPLs

Today I released local-repl 4, a CLI for running project-specific Node.js REPLs.

The basic idea

local-repl saves you from typing out imports every time you open a new Node.js REPL. You specify the modules and objects that you want to automatically import in either package.json or .replrc …

Responsive Typography Using Modern CSS

Choosing type sizes for a website can be daunting. Heading and paragraph sizes have drastic consequences over the layout and legibility of a page. Thankfully, we have modular scales to guide us.

A modular scale is a sequence of numbers that relate to one another in a meaningful way. Tim …

Recent Releases

Some notes on some recent releases:

TextBlob 0.11.0

Changelog

This mainly fixes compatibility with NLTK 3.1 and above. Older versions of NLTK are no longer supported. As an added bonus, the averaged perceptron tagger described in this post is now the default part-of-speech tagger in both NLTK …

marshmallow 2.0 Released

One alpha, five betas, and two release candidates after marshmallow's last 1.x release, marshmallow 2.0 is published to the PyPI.

What is marshmallow?

Marshmallow is a Python library for

  1. Validating input data against a schema,
  2. Deserializing data to application objects (e.g., ORM objects), and
  3. Serializing application objects …

Three Command-line Tools for Productive Python Development

Below are three tools that I started using recently that I have since found indispensable when developing with Python.

I. Bootstrap your project with cookiecutter

I am a big fan of project templates. They enable you to reuse best practices and patterns whenever you start a new project.

Audrey Roy's …

The M's, V's, and C's: Keep 'em light and fluffy

The MVC design pattern gives us general guidelines on where components of an application should go. Web frameworks attempt to enforce MVC by giving us cookiecutter classes and interfaces for each of the three layers.

But as an application gets larger, it becomes more difficult to decide where certain components …