Skip to main content

Async get/set helpers for string values under hashed Redis keys (with TTL).

Project description

PyPI version License: MIT Downloads LinkedIn

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

pip install hashkv

Usage

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

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

hashkv-2025.8.241553.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

hashkv-2025.8.241553-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file hashkv-2025.8.241553.tar.gz.

File metadata

  • Download URL: hashkv-2025.8.241553.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.11

File hashes

Hashes for hashkv-2025.8.241553.tar.gz
Algorithm Hash digest
SHA256 e1526afac836b6f8b4d8cb13bbf23d500dac822b4957205e6a2c539384c5c324
MD5 bba27003e9abda1c4895a006e556051d
BLAKE2b-256 9e43d6e4247b845d68e87956f7c972e56ce78c494ddcea8f8adec2b6083edabf

See more details on using hashes here.

File details

Details for the file hashkv-2025.8.241553-py3-none-any.whl.

File metadata

  • Download URL: hashkv-2025.8.241553-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.11

File hashes

Hashes for hashkv-2025.8.241553-py3-none-any.whl
Algorithm Hash digest
SHA256 1726dd59c1e83a5ccb8777511603e429a522b09128c9568e63ba85c2d699739a
MD5 2dd81034724a3519e2f78d1ad42c30be
BLAKE2b-256 054cdcd1224417f16f86be71acdd2a0bdd24fda4ea83d69e0501dcd398b8ff19

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