Simple and lightweight document oriented database
Project description
LemonDB
LemonDB is a simple and lightweight document oriented database written in pure Python 3 tried on version: 3.9
& 3.8
. It should work on versions <= 3.7. This class handle all operation including storing document on a file.
Example:
from lemondb import LemonDB
db = LemonDB('test.db')
db.insert_many([{'name': 'Zenqi'}, {'name': 'John Doe'}, {'name': 'Elizabeth Doe'}])
# Search from database using `find` or `search`
for i in db.find('Doe').where(lambda x: x['name'].startswith('John')):
print(i)
#: {'name': 'John Doe'}
#: You can use the query or dict
from lemondb import Query
query = Query()
print(db.find_one(query.name == 'Zenqi')))
#: {'name': 'Zenqi'}
print(db.find_one({'name': 'Zenqi'}))
#: {'name': 'Zenqi'}
📌 New Features in 1.x Series!
- Different
types
are now supported! - Searching / filtering were improved.
Have you ever wanted to serialize a datetime object? and other type object that standard JSON could'nt serialized? Well lemondb now support those. Search & filtering were improved. LemonDB now using cursors. Don't believe me? Try this out
from lemondb import LemonDB
from datetime import datetime
# Adding datetime object
db = LemonDB('test.json')
db.insert({'name': 'John Doe', 'elapsed-time': datetime.now()})
# Searching now accept dict queries
db.find_one({'name': 'John Doe'})
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
lemondb-1.0.3.tar.gz
(20.3 kB
view details)
File details
Details for the file lemondb-1.0.3.tar.gz
.
File metadata
- Download URL: lemondb-1.0.3.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee9f6b05e99f61a138a21df32622b460d031ff0a141e18f60c1b7570ebde845 |
|
MD5 | 8db28c22b3b7069d18a3822f5461a174 |
|
BLAKE2b-256 | db6fd27fd0f745893e69e4eccd248258844038619da28ffc3358202d3c38a3a3 |