Skip to main content

Easy data cache management

Project description

Arsene

Simple cache management to make your life easy.

Test MIT pypy


Requirements

  • Python 3.6+

Installation

pip install arsene

Quick Start

For the tutorial, you must install redis as dependency

pip install arsene[redis]

The simplest Arsene setup looks like this:

from datetime import datetime
from arsene import Arsene, RedisModel

redis = RedisModel(host='localhost')

arsene = Arsene(redis_connection=redis)


@arsene.cache(key='my_secret_key', expire=2)
def get_user():
    return {
        'username': 'jak',
        'last_session': datetime(year=1999, month=2, day=3)
    }


# return and writes response to the cache
get_user()

# reads response to the cache
get_user()
# Response: {'username': 'jak', 'last_session': datetime.datetime(1999, 2, 3, 0, 0)}

# reads response to the cache
arsene.get(key='my_secret_key')

# delete key to the cache
arsene.delete(key='my_secret_key')
arsene.get(key='my_secret_key')
# Response: None

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

arsene-0.1.6.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

arsene-0.1.6-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page