Skip to content

Instantly share code, notes, and snippets.

@jjjake
jjjake / parallel_md_get.py
Created September 25, 2012 22:31 — forked from mikemccabe/parallel_md_get.py
Parallel archive.org metadata fetching using python and gevent
# This demonstrates doing multiple metadata fetches in parallel.
# It seems to be fast enough that the json decoding cost becomes
# a significant proportion of the execution time.
# It requires gevent; see http://www.gevent.org/intro.html#installation
# To make this do something useful, modify do_work().
import gevent
@jjjake
jjjake / tree.md
Created September 24, 2012 15:43 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jjjake
jjjake / check_for_acoustid.py
Created September 22, 2012 00:37 — forked from mikemccabe/gist:3712588
check if an item has an acoustid or music brainz release: ./check_for_acoustid.py {item}
#!/usr/bin/env python
""" Check if an item on archive.org has an acoustid.
Usage:
./check_for_acoustid.py {item}
Usage with GNU Parallel:
cat itemlist.txt | parallel --max-procs=8 --group './check_for_acoustid.py {}'