Metadata-Version: 2.4
Name: hashkv
Version: 2025.8.241553
Summary: Async get/set helpers for string values under hashed Redis keys (with TTL).
Home-page: https://github.com/chigwell/hashkv
Author: Eugene Evstafev
Author-email: chigwel@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Database
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: redis>=5.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

[![PyPI version](https://badge.fury.io/py/hashkv.svg)](https://badge.fury.io/py/hashkv)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/hashkv)](https://pepy.tech/project/hashkv)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)

# hashkv

Async helpers to **get/set string values** for hashed Redis keys with TTL.

Key format: `"{prefix}:{hash_hex}"`. You pass a precomputed hash string.

## Install
```bash
pip install hashkv
````

## Usage

```python
import asyncio
from hashkv import get_hash_value, set_hash_value

async def main():
    url = "redis://localhost:6379/0"
    prefix = "some_prefix"
    hash_hex = "cf2d9b0f..."  # your hash

    await set_hash_value(hash_hex, value="ok", ttl_seconds=600, redis_url=url, key_prefix=prefix)
    cur = await get_hash_value(hash_hex, redis_url=url, key_prefix=prefix)
    print(cur)  # "ok"

if __name__ == "__main__":
    asyncio.run(main())
```

MIT © Eugene Evstafev
