Skip to content

Instantly share code, notes, and snippets.

@bwesterb
Created August 12, 2012 14:35
Show Gist options
  • Save bwesterb/3332093 to your computer and use it in GitHub Desktop.
Save bwesterb/3332093 to your computer and use it in GitHub Desktop.
Analyze Sparrow's Tokyo Cabinet
import tc
import os.path
import pprint
db = tc.HDB()
db.open(os.path.expanduser(
'~/Library/Containers/com.sparrowmailapp.sparrow/Data/Library/'+
'Application Support/Sparrow/[email protected]/'+
'data.db/data.tch'), tc.HDBOREADER )
tmp = {}
for x in db:
if x.split('.')[0] not in tmp:
tmp[x.split('.')[0]] = [0,0]
tmp[x.split('.')[0]][0] += 1
tmp[x.split('.')[0]][1] += len(db[x])
pprint.pprint(tmp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment