Category Archives: python

Flask RESTful API JSON

JSON is a common format for sending data to and from a RESTful API. In this post we’ll see how we can allow a simple Flask API to receive a JSON input. This post extends my previous post which made a simple Flask RESTful API and uses the Flask ‘get_json()’ method to accept JSON input.… Read More »

Use Tox With Anaconda

Tox is a tool for building and running a matrix of test environments. This is useful when, for example, you need to support several different versions of python. You don’t want to have to manually run tests againsts each of your supported versions. This post shows you how you can use tox with anaconda. If,… Read More »

Python – Unpacking Iterables

Python iterables are lists, tuples, dictionaries and other similar objects – in other words things that can be iterated over. Python provides a way to ‘unpack’ these iterables which can be a useful shortcut in some situations. This post looks at unpacking iterables, and how it can also be used to make functions functions take… Read More »

Python Convert KML to GeoJSON

GeoJSON and KML are formats for storing spatial information. KML files are commonly found with Google Earth type applications, so it can be useful to convert KML to GeoJSON.  The python library kml2geojson can be used to convert KML to GeoJSON. kml2geojson works as either a tool from the command line, or can be used… Read More »

Python Text To Speech

Text to speech is a tool available in most operating systems, and helps people with reading and sight difficulties, or can be used as part of a ‘Jarvis‘ helper on your computer. Python has a few options for dealing with text to speech, generally in the form of wrappers for speech engines. This post goes… Read More »