Skip to content

Instantly share code, notes, and snippets.

@jbenet
Created April 6, 2012 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbenet/2319348 to your computer and use it in GitHub Desktop.
Save jbenet/2319348 to your computer and use it in GitHub Desktop.
>>> from datastore import *
>>> d = DictDatastore()
>>> d.put(Key('/abcd/type:pdf'), 'pdf')
>>> d.put(Key('/abcd/type:html'), 'html')
>>> d.put(Key('/abcd/metadata'), 'metadata')
>>> list(d.query(Query(Key('/abcd/type'))))
['html', 'pdf']
>>> list(d.query(Query(Key('/abcd'))))
['metadata']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment