Be gentle, this is my first real script in Python. It can probably take a bit of cleaning up and it still outputs a bunch of feedback for debugging.

This script takes a repo_url, a checkout location and a list of branches to work with.
It checks if there have been changes to a branch in the last 14 days, if not it creates a tag in trunk and deletes the branch then recreates it. It even goes so far as to switch the location of the checkout location to the newly created branch.