Share your repls and programming experiences

← Back to all posts
Simple and easy-to-use python database!
h
Nayoar (566)

We've all been in that position. The first time you made a project that needed to store data, you had no idea where to start with a database... well I've now made it easy for you, with my new easypydb module!
This simple database allows you to save JSON with great ease. It's hardly more complicated than just using a python dictionary!
A complete demo/tutorial is in this repl, in main.py
Have fun!
If there's anything you don't understand about how to use it, or if anything doesn't work, please say so in the comments.

Comments
hotnewtop
Coder543 (2)

@minx28 How do I fix this ?
AttributeError: "dict" object has no attribute "save"

Nayoar (566)

@Coder543 send your code. How do you expect me to help you without it?

Coder543 (2)

It gives some error on line 14: Traceback (most recent call last):
File "main.py", line 14, in <module>
db1=DB("myData",token)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/easypydb/db.py", line 9, in init
self.load()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/easypydb/db.py", line 15, in load self.data=self.s1.get(self.name)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/s1db/init.py", line 28, in get
response = requests.get(self.base_url + '/db/' + quote(key), headers={'Authorization': 'Bearer ' + self
.token, 'Content-Type': 'text/plain;charset=UTF-8'})
TypeError: can only concatenate str (not "NoneType") to str

Nayoar (566)

@Coder543 you have got an invalid token. Did you make a file called .env and put in it token=YOUR-TOKEN?

rediar (503)

Where is it stored? Also pls include easypydb source code

Nayoar (566)

@NDLFOREVER thanks! I've updated the tutorial, and it's now a module you can just import instead of copying the code. Simply install easypydb in your project and voila!

k9chelsea2 (731)

oh cool, thanks for letting me know