Skip to main content

Class and decorator to use with Redis

Project description

Redis Decorator Generator

Description

This package is a simple wrapper around the standard redis.Redis package pip install redis.

The 'generate' function is meant to help speed up the integration process.

Examples

Example 1

Use the generator directly on a function.

    @generate(redis_url="redis://:foobared@localhost:6379/0")(ttl=60)
    def my_func(*args: Any, **kwargs: Any) -> Any:
        sarg = ":".join([str(arg) for arg in args])
        skwarg = ":".join([f"{key}={str(value)}" for key, value in kwargs.items()])
        return sarg + "::" + skwarg

Example 2

Generate the decorator so that it can be imported.

    cache = generate(redis_url="redis://:foobared@localhost:6379/0")

    @cache(ttl=60)
    def my_func(*args: Any, **kwargs: Any) -> Any:
        sarg = ":".join([str(arg) for arg in args])
        skwarg = ":".join([f"{key}={str(value)}" for key, value in kwargs.items()])
        return sarg + "::" + skwarg

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

redis_decorator_generator-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

redis_decorator_generator-0.0.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file redis_decorator_generator-0.0.3.tar.gz.

File metadata

File hashes

Hashes for redis_decorator_generator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b992560eca4916c8a3c8fa096b5de1b02c666f61dafda14f59e57ff435ecb759
MD5 8002c572ad74d41a52383822a9b0102b
BLAKE2b-256 b778f1843a422a871c29c94569fcf9dc19e8f023388df2f6b7b35a3b30f6415a

See more details on using hashes here.

Provenance

The following attestation bundles were made for redis_decorator_generator-0.0.3.tar.gz:

Publisher: deploy.yaml on bkmetzler/redis-decorator-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redis_decorator_generator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for redis_decorator_generator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4563b5a5e6afff792bebc6b0d5eee7557934843eaa710730a56b992b748e38
MD5 e53c00924bbd849966e05cd0d939ae58
BLAKE2b-256 e79c425305a10f55992fe4d32c824c9b56e512bc44b0ebf45b4df1301914bccd

See more details on using hashes here.

Provenance

The following attestation bundles were made for redis_decorator_generator-0.0.3-py3-none-any.whl:

Publisher: deploy.yaml on bkmetzler/redis-decorator-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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