TinyDB in Python - Simple Database For Personal Projects

preview_player
Показать описание
In this Python Tutorial, I want to show you how to work with TinyDB. TinyDB is a tiny, document oriented database which is perfect for small personal projects. The API is super simple and fun to use. I show you basic functionalities like adding, deleting, updating, and searching. TinyDB is open sourced an can be found on GitHub:

Update 07/2020:
Unfortunately some of the used methods have been removed in the newest 4.0 version:

~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~

📚 Get my FREE NumPy Handbook:

📓 Notebooks available on Patreon:

If you like this Tutorial, please subscribe to the channel!

The code can be found here:

Further readings:

You can find me here:

#Python #database

----------------------------------------------------------------------------------------------------------
* This is a sponsored link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

This is a great video and thank you for posting it. There are really no other up to date guides on Youtube besides the MIT App implementations.

machinimaaquinix
Автор

This is very good. Solid stuff. The purge() > truncate() thing is not a problem at all. Thanks Patrick.

zt.
Автор

oh man this video just saved me from a huge headache, thanks

emporiummedia
Автор

Love this, I was using MS Access and Flask (CSV) for Databases and data store.

A couple of questions if i may.

A. Is there a way to search for data in real time? ie you hard code New York but could the function be set up to take an input and display differnet cities, London etc?

B. The outputs are ok on a tiny DB but could get messy can you display tabular? like a DF in Pandas ?

C. Could it be sent to HTML (via Flask or whatever) for a better UI/UX ?

I'm sure ChatGTP would tell me all this but your video is ace and well described thank you, to my shame i didn't even know about this before yesterday !

tinytechs
Автор

how can i do the same but in a website, i mean like an online database to u can insert in a website table the user data?

tigron
Автор

is there any way to use two different databases in the same file?

nikro
Автор

hey nice tutorial but i have a problem.
If i copy your code i get an bad file descriptor error in line 5 "db.insert({'type': 'peach', 'count': 3})".
Do you know what could be wrong?

heikoherrmann
Автор

how does one access these key values however? when you have {name: 'Max'}, how are you able to access Max

noiseus_e
Автор

I love this channel. Thanks for sharing such great content

abhijeetgupta
Автор

Thanks. Is there any Deep Learning related use case you have used it for? Just curious.

DanielWeikert
Автор

How do you get the age number insted of getting everything?

madeggs
Автор

hey im having problem with my tinydb, when i tried running it i keep getting an error that says "cannot import name 'tinydb' from partially initialized module 'tinydb'". any help would be really appreciated:)

rezayusrilnaufal
Автор

Hello !!
I'd like to know if I can use TinyDB with Flask to make it work everywhere for everyone

evatzug
Автор

First db.purge(), now db.write_back()... Though your video is not that old, it is already outdated. One thing that may be done: in the title, include the version of TinyDB the video is intended for.

chachacha
Автор

Good video, just as an FYI:
JSON should be pronounced as jay-son not jason
query should be pronounced as queer-e (long E)

torimcullah
Автор

Holy shit, this is so good explained!

qxch
Автор

Hi everyone. The video is great but I have some real probleme with Python or Python Community. Well, I come from javaScript and I am learning Python. This language seem like a mess (to be polite). Because purge() was replace by truncate but .write_back() has been remove AND THAT IT and other Python issue! How do you deal with this unstable language?

jeanyvesnadal
Автор

This doesn't make a lot of sense. If you're dealing with information that fits into a single JSON file, that's just not enough data to require a database.

chaosordeal
Автор

I created a table « Players »
Each players got « classement »
I tried so many times to change this « classement » but it’s impossible..
to find the player i use to write
Player_table = db.table(« players »)


But nothing changed

nemutluturkumdiyeneasphixi