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}])
Metadata
Release files for dingdb 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dingdb-0.0.2.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dingdb-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / dingdb-0.0.2.tar.gz
| Download URL | dingdb-0.0.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79aebb08d62c9ac1eaed2070db94979721109f41cfcc3dcafc076697d79ecbff
|
|
BLAKE2b-256 checksum How to use checksums |
c6748fade45a8f2441ee21712f6a70415f1aa0829aaddcd853eb355116e9663d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / dingdb-0.0.2-py3-none-any.whl
| Download URL | dingdb-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
765fa3ed3e40f1861b87e46d26031cfcfad83d8091599cbb5a976679a9b8b50e
|
|
BLAKE2b-256 checksum How to use checksums |
a10497ae508b235dc75450984205c44cfe75997037ad052fe4abf9b937ad8b76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|