No project description provided
Project description
Dingdb, a thingdb like storage & retrieval Python API
Simple implementation of Thingdb, called Dingdb (German for 'thing') Currently expects a sqlite3 database.
Inspired by:
- http://web.archive.org/web/20080109204022/http://pharos.infogami.com/tdb
- https://github.com/reddit-archive/reddit/blob/master/r2/r2/lib/db/ding.py
- https://github.com/itslukej/ding/tree/master/dingdb
- https://www.reddit.com/r/webdev/comments/30ycc1/has_anyone_built_a_reddit_clone_if_so_any_tips_on/
- https://www.youtube.com/watch?v=hB-M8oH4K4w
Installation
git clone git@github.com:chrisjsimpson/dingdb.git
cd dingdb/
pip3 install ./
python3 dingdb/migrations/1-create-dingdb-schema.py -up -db ./data.db
Usage
from dingdb import dingdb
from uuid import uuid4
dingdb.help() # See help
# Connect and insert data
tdb = dingdb(database='./data.db')
# Put things
tdb.putDing(1, 'person', 'person', data=[{'key':'name', 'value': 'Sam'}, {'key':'age', 'value':30}])
# Get a thing
person = tdb.getDing(1)
person.name
'Sam'
person.age
'30'
person.age = 31
person.save()
# Get things by type
tdb.getDingsByType('person')
# More..
# Use a uuid for ids:
tdb.putDing(str(uuid4()), 'person', 'person', data=[{'key':'name', 'value': 'Sam'}, {'key':'age', 'value':30}])
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
dingdb-0.0.2.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file dingdb-0.0.2.tar.gz
.
File metadata
- Download URL: dingdb-0.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79aebb08d62c9ac1eaed2070db94979721109f41cfcc3dcafc076697d79ecbff |
|
MD5 | 2abcc1d9bac897f271ff254116f21aeb |
|
BLAKE2b-256 | c6748fade45a8f2441ee21712f6a70415f1aa0829aaddcd853eb355116e9663d |
File details
Details for the file dingdb-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: dingdb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 765fa3ed3e40f1861b87e46d26031cfcfad83d8091599cbb5a976679a9b8b50e |
|
MD5 | ca84f020b4da1b305c5b66233a9abc87 |
|
BLAKE2b-256 | a10497ae508b235dc75450984205c44cfe75997037ad052fe4abf9b937ad8b76 |