redis-taxon

Redis-backed tagged data store
Download

redis-taxon Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Justin Poliey
  • Publisher web site:
  • https://github.com/jdp/

redis-taxon Tags


redis-taxon Description

redis-taxon is a tagged data store with persistence to a Redis backend. It allows you to organize and query Redis data sets with tags.Getting StartedFirst install the taxon package with pip:pip install -U redis-taxonThen you can instantiate Taxon stores in your code that wrap Redis objects from redis-py.import redisimport taxont = taxon.Taxon(redis.Redis())To tag data, use the tag method on a taxon.Taxon object.t.tag('feature', )t.tag('experimental', )To get the items associated with the tag, you can provide the Store.query method with the name of the tag. The return value is a tuple of the key in which the result is stored, and the set of items in the result.key, items = t.query('feature')QueryingTaxon allows the dataset to be queried with arbitrary expressions and supports And, Or, and Not operations. The query syntax is a small DSL implemented directly in Python.from taxon import Taxonfrom taxon.query import And, Or, Not# get issue tracker items with no action requiredt = Taxon(my_redis_object)_, items = t.query(Or('invalid', 'closed', 'wontfix'))Query expressions can also be arbitrarily complex.# get issue tracker items marked feature or bugfix, but not experimental_, items = t.query(And(Or('feature', 'bugfix'), Not('experimental')))There is an alternate query syntax available using the Tag member from taxon.query which uses operators instead of classes. The operators are & for And, | for Or, and ~ for Not. The above query in operator syntax looks like this:from taxon.query import Tag_, items = t.query((Tag('feature') | Tag('bugfix')) & ~Tag('experimental'))Product's homepage


redis-taxon Related Software