Skip to main content

The official Python client for HydroDB

Project description

🐍 hydrods

The Official Python Client for HydroDB

Zero dependencies. Pure TCP. Blazing fast.


PyPI Python License


🤔 What is this?

hydrods is a lightweight Python SDK to connect to HydroDB — a high-performance NoSQL database engine built from scratch in C++17.

  • No redis-py needed — talks directly over raw TCP sockets
  • RESP protocol parser — automatically converts responses into Python types (str, int, dict)
  • Thread-safe — works great with threading, concurrent.futures, or connection pools

🚀 Installation

pip install hydrods

💻 Quick Start

from hydrods import HydroDB

# Connect to your HydroDB server
db = HydroDB(host='127.0.0.1', port=7379)

# ✏️ SET — store a value
db.set('user:101', 'Anurag Panwar')

# 📖 GET — retrieve it
name = db.get('user:101')
print(name)  # → "Anurag Panwar"

# 🗑️ DELETE — remove it
db.delete('user:101')

# 📊 RANGE — query a lexicographic range
db.set('sensor:001', 'temp: 22.5')
db.set('sensor:002', 'temp: 23.1')
db.set('sensor:003', 'temp: 21.8')

results = db.range('sensor:000', 'sensor:999')
for key, value in results.items():
    print(f"  {key}{value}")

# 📄 RANGE with pagination
page = db.range('sensor:000', 'sensor:999', limit=10, offset=0)

# 🔌 Close when done
db.close()

📖 API Reference

Method Returns Description
HydroDB(host, port) Connect to HydroDB server (default: 127.0.0.1:7379)
set(key, value) bool Store a key-value pair
get(key) str | None Retrieve value by key, None if not found
delete(key) bool Delete a key, returns True if deleted
range(start, end) dict Get all key-value pairs in lexicographic range
range(start, end, limit, offset) dict Paginated range query
close() Close the TCP connection

⚡ Why hydrods?

Feature hydrods redis-py
External dependencies ❌ None ✅ hiredis, etc.
Direct TCP sockets ❌ (abstracted)
RESP parsing ✅ Built-in ✅ Built-in
Range queries (ordered) ✅ Native HRANGE ⚠️ Needs ZRANGEBYLEX
Pagination support LIMIT offset count ⚠️ Varies by command
Thread-safe usage

🔗 Links


📜 License

MIT License — Anurag Panwar

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

hydrods-2.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

hydrods-2.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file hydrods-2.1.1.tar.gz.

File metadata

  • Download URL: hydrods-2.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hydrods-2.1.1.tar.gz
Algorithm Hash digest
SHA256 c2066daa4b0243f0080e3213c1c6e0886e06807d4dd8fd6b3295c8d1ad870462
MD5 cd88b8c6fe88e8dc63868e88d33f3e91
BLAKE2b-256 bfec5ed25078395f261711a67ff2f2624f43b1e39e5464d6b91926e3b4667f52

See more details on using hashes here.

File details

Details for the file hydrods-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: hydrods-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hydrods-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5724a542fda581c134bcc56b21dec459206cf085ae68a57a9e2a7a02b857c64
MD5 2d05b3dc42d24fc434d16131ae39dc7a
BLAKE2b-256 131812579d43b7f344d96608a29916b5b0440481096d15b6699506b9040b53ac

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