A python library for https://db.marcusweinberger.repl.co/
Project description
# mdb
A client to [my database](https://db.marcusweinberger.repl.co)
- ## Installation
pip install marcusdb
Sorry, mdb was taken
- ## Usage
import mdb
keys = mdb.generate() # {“priv”:”XXXXXXXX”, “pub”:”XXXXXXXXX”} # tip: the public key is just a hashed version of the private key [sha256(sha256(key) + salt)] # protip: you can choose your own key using mdb.register(“YOUR_TOKEN_HERE”), but remember - if your token isn’t secure, someone could crack the hash
privclient = mdb.Client(keys[‘priv’]) pubclient = mdb.Client(keys[‘pub’]) # yep, both use the same class. attempting priv methods with pub keys just dont work
privclient.store(“hello”, “world”) # can store all types of data by using the jsonpickle library
pubclient.retrieve(“hello”) # > “world”
pubclient.store(“test”, “wa”) # will return False
privclient.delete(“hello”) # returns True
privclient.unregister(conf=True) # conf defaults to false, when false will do nothing # deletes your account from the DB, making both keys invalid and out of the system
## Github: [https://github.com/AgeOfMarcus/mdb](https://github.com/AgeOfMarcus/mdb) ## View post on repl.it: [post & demo](https://repl.it/talk/share/MDB-A-database-with-seperate-readwrite-keys-perfect-for-small-projects-to-store-JSON/35762)
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
File details
Details for the file marcusdb-1.0.2.tar.gz
.
File metadata
- Download URL: marcusdb-1.0.2.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 676b54f8fdd3c1cc803ad2eacdc561835f2d5581451b21b35be191b533851aa8 |
|
MD5 | ed8618075d394c5b9bc6ef9faaa5ff89 |
|
BLAKE2b-256 | 6f3862fe27997fb88760fc516940a7313fb07ff997f48f367432d83aac2739d1 |