Easy data cache management
Project description
Simple cache management to make your life easy.
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
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file arsene-0.1.6.tar.gz
.
File metadata
- Download URL: arsene-0.1.6.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1df1aa9ac00f60696c62afbcaf55c5019eb94465fd5da3098d58c92454d8343d |
|
MD5 | 320563b04bc71a38d7b49ac7f9b0139c |
|
BLAKE2b-256 | 024e94d6bd27ebb2146e6384ebdc065d17f4506b8052be85235d177f91d25c29 |
File details
Details for the file arsene-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: arsene-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35cd9fa7cf1f7d8483e037dd8d7f356347ddb715f79baf3ff94b61c944f127a |
|
MD5 | 84089a7c960a23709d523450fb3031d0 |
|
BLAKE2b-256 | 92a9c334410b2c0ee6c2dcb9e12c27d8596552f1204bed279f1f5b8b42e5572e |