Posts tagged 'Python'

Introduction to Python pathlib

One of the first things many beginner Python tutorials teach is how to read or write files using patterns like with open('file.txt') as f: f.read() And then walk directories with libraries such as os: import os g = os.walk('.') next(g) Which will go recursively through results …

Scraping with BeautifulSoup

BeautifulSoup is a handy library for web scraping that’s mature, easy to use and feature complete. It can be regarded as jQuery’s equivalent in the Python world. In this post we’re going to scrape the front page of wooptoo.com and output a clean, JSON version of …

Marshmallow schema basics

In this post we’re going to cover the basics of working with Marshmallow. Marshmallow is a Python library which enables us to easily sanitize and validate content according to a schema. Schemas are useful when we want to sift through user provided data en-masse as opposed to dealing with …