Tracing Functions in Python


Sometimes I want to debug the inputs and outputs of function calls to visualize flow or to follow execution passively.

Rather than adding logging statements and littering them around the code, a single decorator can be crafted to show the life cycle of a function:

def trace_args(f):
    def wrapper …
more ...

Pushing to pypi


  1. Make in your project

    from setuptools import setup
          description='thing do-er',
          author='Your Name',
          classifiers=['Environment :: Console',
                       'Intended Audience :: Developers',
                       'License :: OSI Approved :: MIT License',
                       'Programming Language :: Python :: 3.4',
                       'Operating System :: POSIX :: Linux',
                       'Topic …
more ...

Setting up kippo on Raspberry Pi

Downloading Kippo

  1. Download tarball from Google code.
note:the project has since moved to github

2. In my case most of the traffic was attempting a sftp connection. The version of kippo that I acquired from …

more ...

Digital Ocean API Wrapper

I found myself wanting to take snapshots of my digital ocean droplets. I wrote a quick python script that wraps the api and allows me to snapshot my droplet on a regular basis.

#! /usr/bin/env python

import requests
import time


def fetch(path, opts={}):
    opts['api_key'] = API_KEY …
more ...