Skip to content

Instantly share code, notes, and snippets.

@bwesterb
Created August 12, 2012 14:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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/bas.westerbaan@gmail.com.sparrowdb/'+
'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