Official Python SDK for Prithvi — a fast, in-memory key-value database built from scratch in Java.
This SDK allows Python developers to easily connect and interact with a running Prithvi server over TCP.
Link : Prithvi-Python SDK - Pypi
- Easy connection to Prithvi server over TCP
- Support for all major commands:
SET,GET,DEL,EXISTS,KEYS- List ops:
LPUSH,RPUSH,LPOP,RPOP,GETLIST - Set ops:
SADD,SREM,SMEMBERS - Persistence:
SAVE,LOAD,FLUSH - Auth:
AUTH,TOKEN
- Auto-reconnect with retry logic
- Token storage and reuse
- Tiny and dependency-free
pip install prithvi-py-sdkfrom prithvi_client import PrithviClient
client = PrithviClient("127.0.0.1", 1902)
client.connect()
print(client.auth("sidharth")) # Authenticate and store token
print(client.token()) # Send stored token for verification
print(client.set("mykey", "myvalue")) # Store key
print(client.get("mykey")) # Retrieve key
print(client.lpush("mylist", "1")) # Push to list
print(client.get_list("mylist")) # Get list
client.close() # Close connectionclient.auth("your-username") # Receives and stores JWT-style token
client.token() # Verifies with stored token| Type | Methods |
|---|---|
| Keys | set, get, del, exists, keys |
| Lists | lpush, rpush, lpop, rpop, get_list |
| Sets | sadd, srem, smembers |
| Auth | auth, token, get_stored_token |
| System | save, load, flush, quit, help, close |
- Python 3.7+
- A running Prithvi Server on port
1902
Pull requests are welcome. For major changes, open an issue first to discuss what you want to change.
Prithvi is a custom-built, lightweight, Redis-like in-memory key-value store with TTL, LRU cache, multithreading, authentication, and persistence.
🔗 GitHub: github.com/psidh/prithvi