Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kev

> 数据库
Open source

K.E.V. (Keys, Extras, and Values) is a Python ORM for key-value stores based on Valley. Currently supported backends are Redis, S3, and a S3/Redis hybrid backen

99 stars0 likes1 views
WebsiteGitHub

About

K.E.V. (Keys, Extras, and Values) is a Python ORM for key-value stores based on Valley. Currently supported backends are Redis, S3, and a S3/Redis hybrid backen

kev

K.E.V. (Keys, Extra Stuff, and Values) is a Python ORM for key-value stores and document databases based on Valley. Currently supported backends are Redis, S3 and a S3/Redis hybrid backend.

Python Versions

Kev should work on Python 3.5+ and higher

Install

bash
pip install kev

Example Project Using KEV

  • flask-capless-blog

Example Usage

Setup the Connection

Example: loading.py

…

Setup the Models

Example: models.py

…

Use the model

How to Save a Document

python
>>>from .models import TestDocument

>>>kevin = TestDocument(name='Kev',is_active=True,no_subscriptions=3,state='NC',gpa=3.25)

>>>kevin.save()

>>>kevin.name
'Kev'

>>>kevin.is_active
True

>>>kevin.pk
ec640abfd6

>>>kevin.id
ec640abfd6

>>>kevin._id
'ec640abfd6:id:s3redis:testdocument'

Query Documents

First Save Some More Docs
python

>>>george = TestDocument(name='George',is_active=True,no_subscriptions=3,gpa=3.25,state='VA')

>>>george.save()

>>>sally = TestDocument(name='Sally',is_active=False,no_subscriptions=6,gpa=3.0,state='VA')

>>>sally.save()
Show all Documents
python
>>>TestDocument.objects().all()

[,,]

>>>TestDocument.objects().all(skip=1)

[,]

>>>TestDocument.objects().all(limit=2)

[,]
Get One Document
python
>>>TestDocument.get('ec640abfd6')

>>>TestDocument.objects().get({'state':'NC'})
Filter Documents
python
>>>TestDocument.objects().filter({'state':'VA'})

[,]

>>>TestDocument.objects().filter({'no_subscriptions':3})
[,]

>>>TestDocument.objects().filter({'no_subscriptions':3,'state':'NC'})
[]
Sort Documents
python
>>>TestDocument.objects().filter({'no_subscriptions':3}).sort_by('name')
[, ]
>>>TestDocument.objects().filter({'no_subscriptions':3}).sort_by('name', reverse=True)
[, ]
>>>TestDocument.objects().all().sort_by('gpa')
[, , ]
TestDocument.objects().all().sort_by('name').sort_by('gpa')
[, >, >>TestDocument.objects().filter({'no_subscriptions':3}).filter({'state':'NC'})
[]
Wildcard Filters

Wildcard filters currently only work with the Redis and S3/Redis backend. Use prefixes with the S3 backend.

python
>>>TestDocument.objects().filter({'state':'N*'})
[]
Prefix Filters

Prefix filters currently only work with the S3 backend. Use wildcard filters with the Redis or S3/Redis backends.

python
>>>TestDocument.objects().filter({'state':'N'})
[]

Backup and Restore

Easily backup or restore your model locally or from S3. The backup method creates a JSON file backup.

Backup

Local Backup
python
TestDocument().backup('test-backup.json')
S3 Backup
python

TestDocument().backup('s3://your-bucket/kev/test-backup.json')

Restore

Local Restore
python

TestDocument().restore('test-backup.json')

S3 Restore

python

TestDocument().restore('s3://your-bucket/kev/test-backup.json')

Author

Twitter::@brianjinwright Github: bjinwright

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonormrediss3

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库