redistructures/README.md

49 lines
702 B
Markdown
Raw Permalink Normal View History

2020-08-17 12:16:49 +02:00
redistructures ?
====
### Description
2020-08-17 17:19:15 +02:00
Dictionary, List, Set, Queue, Counter implemented in python with redis data store under the hood
2020-08-17 12:16:49 +02:00
### Examples
All examples in `example/structures.py`
Dictionary example :
2020-08-17 12:16:49 +02:00
```python
from redistructures import Struct
d = Struct.dictionary('hey')
2020-08-17 12:16:49 +02:00
d['x'] = 'y'
d['w'] = 'v'
print(d['x'])
print('x' in d)
print('q' in d)
for k in d.keys():
print(k)
for v in d.values():
print(v)
for k, v in d.items():
print(k, v)
```
output
```
b'y'
True
False
b'dict:x'
b'dict:w'
b'y'
b'v'
b'dict:x' b'y'
b'dict:w' b'v'
```
After next run
```
d = Struct.dictionary('hey')
for k, v in d.items():
print(k, v)
```
output
```
b'dict:x' b'y'
b'dict:w' b'v'
```