Skip to main content

Redis-backed tagged data store

Project description

Taxon is a tagged data store with persistence to a Redis backend. It allows you to organize and query Redis data sets with tags.

Features

  • Fully queryable. Supports expressions using And, Or, and Not operations as well as direct tag lookup.

  • Persistent. Data is stored in Redis.

  • Integrated. Taxon wraps Redis objects, and proxies Redis commands to Taxon through it.

Getting Started

First install the taxon package with pip:

$ pip install -U redis-taxon

Then you can instantiate Taxon stores in your code that wrap Redis objects from redis-py.

import redis
import taxon

t = taxon.Taxon(redis.Redis())

To tag data, use the tag method on a taxon.Taxon object.

t.tag('feature', ['issue-312', 'issue-199', 'issue-321'])
t.tag('experimental', ['issue-199'])

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')

Querying

Taxon 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 Taxon
from taxon.query import And, Or, Not

# get issue tracker items with no action required
t = 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'))

MIT License

Copyright (c) 2012 Justin Poliey <justin@getglue.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redis-taxon-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redis_taxon-0.2.0-py2.7.egg (8.6 kB view details)

Uploaded Egg

File details

Details for the file redis-taxon-0.2.0.tar.gz.

File metadata

  • Download URL: redis-taxon-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redis-taxon-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8fa970765b786dce3693da716f47a0e6d36103eb83ab7375561faf0a5ce30701
MD5 ae75c3ac2d014f1249fcaad31467e70d
BLAKE2b-256 396006ab78a9d5d41595122fba76dc780e97bc503f9a4f165f426f928386b329

See more details on using hashes here.

File details

Details for the file redis_taxon-0.2.0-py2.7.egg.

File metadata

File hashes

Hashes for redis_taxon-0.2.0-py2.7.egg
Algorithm Hash digest
SHA256 4f3869a95a452b84841231ca8dc2832b0033393453a031119f4f565c618940a6
MD5 e091fe527abe7de06447bc0b22434758
BLAKE2b-256 4994d69576da3f52078d561a5b74229cd36c435df5adcbc941040928e783ba2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page