FunDB: A No-SQLite based Document Store, with indexes and search capabilities
Project description
FunDB
WIP
A document store build on SQLite, leveraging the power of SQLite and JSON
Install
pip install python-fundb
Usage
from fundb import fundb
# Open the db
# or in memory > fun = fundb()
fun = fundb("./my.db")
# Select a collection.
# Collection will be created automatically
# or explicitely > test = fun.select('test')
test = fun.test
# Get total entries
print(test.size)
# Insert an entry. It returns fundb#Document
entry = test.insert({
"name": "Fun",
"type": "DB",
"version": "1.0.0"
})
# Retrieve document by _id
_id = "9c5e5fbd05544700995c5fa3ca3ef214"
entry = test.get(_id)
# Access properties
entry.name # -> fun
entry.type # -> DB
entry.version # -> 1.0.0
# Update a field
entry.update(version="1.0.1")
# ...or
entry.update({"version": "1.0.1"})
#
entry.version # -> 1.0.1
# Delete entry
entry.delete()
# Search
results = test.find({"version:$gt": "1.0.0"})
for entry in results:
print(entry.name)
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
python-fundb-0.0.3.tar.gz
(12.9 kB
view hashes)
Built Distribution
Close
Hashes for python_fundb-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ae5841fade8553e5ca1169c45a2323039d479d1e42a45aee5273a259ed8748 |
|
MD5 | a777edba4132161da5c5727a008f27ad |
|
BLAKE2b-256 | 0c0d83f56c9f701749b223c2508d520454a5d3bbfb956ec6aa2ddb34b2a5ea00 |