Skip to content

hamsa-ai/pandis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandis

Pandis is a Python package that emulates Redis functionalities using pandas as the underlying data store.

Features

  • Strings: Simple key-value pairs.
  • Hashes: Key-value pairs where the value is a hash (dictionary-like).
  • Lists: Ordered collections.
  • Sets: Unordered collections of unique elements.
  • Sorted Sets: Sets ordered by a score.

Installation

pip install pandis

Usage

from pandis import PandisClient

client = PandisClient()

# Strings
client.set('key1', 'value1')
print(client.get('key1'))  # Output: value1

# Hashes
client.hset('hash1', 'field1', 'value1')
print(client.hget('hash1', 'field1'))  # Output: value1

# Lists
client.lpush('list1', 'a', 'b', 'c')
print(client.lpop('list1'))  # Output: c

# Sets
client.sadd('set1', 'a', 'b', 'c')
print(client.smembers('set1'))  # Output: ['a', 'b', 'c']

# Sorted Sets
client.zadd('zset1', {'a': 3, 'b': 1, 'c': 2})
print(client.zrange('zset1', 0, -1))  # Output: ['b', 'c', 'a']

Testing

python -m unittest discover tests

About

A Redis-like interface using pandas as the data store.

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages