Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guokr/redis-namespace
namespaced subset of your redis keyspace
https://github.com/guokr/redis-namespace
redis redis-namespace
Last synced: 21 days ago
JSON representation
namespaced subset of your redis keyspace
- Host: GitHub
- URL: https://github.com/guokr/redis-namespace
- Owner: guokr
- License: mit
- Created: 2018-11-13T08:55:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-03T20:20:55.000Z (6 months ago)
- Last Synced: 2024-12-06T04:51:31.497Z (about 1 month ago)
- Topics: redis, redis-namespace
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 22
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## redis-namespace
[![Build Status][travis-image]][travis-url] [![PyPi Version][pypi-image]][pypi-url]
[redis-namespace](https://github.com/resque/redis-namespace) for python
Redis namespace provides an interface to a namespaced subset of your [redis](https://redis.io) keyspace (e.g., keys with a common beginning), and requires the [redis-py](https://github.com/andymccurdy/redis-py).
```python
import redis
from redis_namespace import StrictRedisredis_connection = redis.StrictRedis()
namespaced_redis = StrictRedis(namespace='ns:')
namespaced_redis.set('foo', 'bar') # redis_connection.set('ns:foo', 'bar')namespaced_redis.get('foo')
redis_connection.get('ns:foo')namespaced_redis.delete('foo')
namespaced_redis.get('foo')
redis_connection.get('ns:foo')
```### Installation
`pip install redis-namespace`
**Warning: The redis-py's version must match redis-namespace's**
Supported list
| redis-py | redis-namespace |
| --- | --- |
| 3.0.1 | 3.0.1.1 |
| 2.10.6 | 2.10.6.1 |
| 2.10.5 | 2.10.5.2 |
| 2.10.3 | 2.10.3.1 |[travis-url]: https://travis-ci.org/guokr/redis-namespace
[travis-image]: https://travis-ci.org/guokr/redis-namespace.svg[pypi-url]: https://pypi.python.org/pypi/redis-namespace/
[pypi-image]: https://img.shields.io/pypi/v/redis-namespace.svg?style=flat-square