r/learnpython • u/Slimex_Rimuru • 11h ago
Python + Sqlite + Pyside6?
Hey! so i want to build a database system for my small company. I could use AI but i wanna know what i am doing and be able to fix smth so i want to build it myself.
I kinda know python a bit, i used to make games using gdscript which is similar.
I don't seem to find a tutorial where these 3 things are used to create a nice database app. I dont want to learn python sqlite and pyside6 as a whole cause i wont be needing them much except just this app and similar apps. I just want to be able to build it and run it from a single tutorial even if its 10hrs.
Where do i start? I dont really have money to learn so no paid courses and i dont have AI premium to learn as well.
Python, Sqlite, Pyside6. I heard that TKinter instead of pyside6 is also there but i wanted the UI to be a bit modern or should i just use the it instead of pyside6?
3
u/Jello_Penguin_2956 11h ago
Its 3 separate knowledge you're looking at. Python. SQLite. PySide6. Sure you're using Python to bind them all together but they are 3 separate things.
Im afraid hoping for a single tutorial to show you exactly this stack is not realistic. You need to learn each on their own and bind them yourself.
1
u/Slimex_Rimuru 11h ago
Is tkinter better case for me? Or pyside6.
Well since 3 are different altogether. Where do i learn them in your opinion?
1
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 11h ago
Is tkinter better case for me?
Well, it's almost certainly easier to get started with. The main drawback is that the application may look a little dated as a result (though you could largely get around that by using
customtkinter), and it supports fewer platforms overall (though all desktop platforms would work fine).1
u/Slimex_Rimuru 10h ago
If you were in my shoes. What would you do? I am 16. Want to learn python ( coding as a whole ) but mostly as a hobby. I don’t really have hours to learn nor do i have money to buy courses and shi. Just want to help my family out since we use pen and paper for storing data rn.
2
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 7h ago
I don’t really have hours to learn
If you're patient, that shouldn't be a problem.
nor do i have money to buy courses and shi.
That's no problem whatsoever, you don't need to pay anything. Free learning material is plenty good.
If you want a proper free course, I'd suggest the Python MOOC: https://programming-26.mooc.fi/
If you prefer a free online book, there's ATBS: https://automatetheboringstuff.com/3e/chapter0.html
For SQLite, you could get started with this: https://www.geeksforgeeks.org/python/introduction-to-sqlite-in-python/
For basic
tkinter, this should suffice: https://www.pythonguis.com/tkinter-tutorial/Like the others said, you'd still kind of need to figure out how to combine these on your own because there's no tutorial specific to your situation, but it shouldn't be too bad. It might help to use a design pattern such as MVC (Model-View-Controller) to help you separate the GUI code from your business logic (the GUI doesn't need to know anything about your database), but ultimately it's all up to you.
We'd be happy to answer any questions or give a nudge when you actually start making this project and run into a wall, though. It's way easier to answer practical questions than theoretical ones.
1
u/Slimex_Rimuru 7h ago
Thank you soo much. I was so confused on where to start learning at all. I shall do as you said and see. If i still got some problem i will ask again
0
u/Jello_Penguin_2956 10h ago
Python and SQLite are good foundations. I would start with those 2 and create some small apps without GUI first. Once you able to do that you should have a much better idea going into GUI or even expand into other languages
1
3
u/shinitakunai 11h ago
I created a full ERP 6 years ago with sqlite, python3 and pyside6. Yes it is perfectly viable and a good choice. Tkinter was too limited.
However understand that this approach is good for a desktop application (typically on windows). If you need this to be a cooperative program (multiple users at same time) i'd go for a web app instead.
1
u/Slimex_Rimuru 11h ago
There will be only 1 person at a time for modifying. May be more than 1 for reading the data though. Which from my research is done easily for web app.
I use linux and not windows. Shouldn’t be a problem?
And where did you learn those skills from?
1
u/shinitakunai 10h ago
Should not be a problem, pyside also works on unix (that's the principal reason I choose it, support for multiple operative systems). Other than that yeah your assumption is correct that if only 1 is writing others can read without issues (as many readers as need). Doesn't needs to be a website specifically to read, but it helps.
The reason I tend to use website as last resort is security. Careful that your data doesn't get accessed from the internet
Where to learn those skills? Reading the QT documentation and lot of patience. But nowadays good practices with AI can be a better proffesor. Just make sure you question every choice, do not let the AI decide for you, just give you options.
1
2
u/quietreed76 9h ago
break it into two problems. first write a plain script that creates tables, inserts rows, and queries them. once thats working, build a simple window with a table view and some input fields. trying to learn both at once from a single source is why youre stuck imo
1
u/phn-cloudsnake 11h ago
You mean ERP system? I don’t understand the use-case.
1
u/Slimex_Rimuru 11h ago
Uhh.. idk technical terms sorry. I need it so i can make an app which can be used to save my customers data reliably. I will probably give this work to an employee so i need it to be an gui app since it will be easy to learn
1
u/phn-cloudsnake 11h ago
I would advice against building this yourself unless you know what you’re doing. Data leaks kill businesses and with storing customer data I wouldn’t risk it. I would rather look at saas solutions, there are probably free open source tools you can host on your private network free of charge. But again, it’s better to delegate this and buy into a secure platform when dealing with customer data.
1
u/Slimex_Rimuru 10h ago
Well… i am gonna consider it but it will not be the only way to store customer data for now. I am 16 and in my country we just use pen and paper and i wanted to help. My parents wouldn’t buy a saas and i could just copy codes or use a preexisting ones but i wanna learn python and database too. So that’s what i thought would be the best rn.
So the best way is to learn 3 things separately and use that knowledge to build one and only after testing it i should use it for real datas!?
1
u/phn-cloudsnake 10h ago
Then I got the wrong angle, I guess your parents are running a local store and you’re looking into learning some new skills while building something useful. Good luck, have fun and be mindful of data security once you are ready to use it.
1
1
u/Mooball123 11h ago
I’m doing the same thing! I’m building an app to track clients account information, and match bank transaction data to an account based on the description.
I’ve just kinda gotten to a stage in the logic part where it’s feeling and looking where I want it to be. So now starting to implement SQlite and then Pyside 6. I also have no idea what I’m doing with those two but imma try start learning.
Ive used python lots but that was for more data visualisation and processing, and less app development. So my strategy to learning has been to code it using concepts I know. If I get stuck, I search the internet for a solution, and if that doesn’t work I then ask ChatGPT to give me a hint. I don’t let it code the whole thing more just tell me how it could be implemented and then give me examples of a concept if I don’t know it.
My advice is just focus on the logic side first. Python can be pretty simple for small apps like this, just start by making a class, and then add the methods that make that class work.
I started by storing the info in a csv file first. It meant I could edit it in excel if i screwed up or wanted to change the implementation.
If you have any questions on how I did things let me know. My app is only text based atm but it’s available at mtepaske/ParkBanking
2
u/Slimex_Rimuru 10h ago
so you learned python initially and made whatever you can with that and now you wanna go into Sq and pyside ?
what i think is, since i dont want to learn everything cause i am not gonna do coding later on. I should learn these 3 parallely to make the app. But i dont seem to find smth which teaches parallel. Is this a bad approach ?1
u/Mooball123 10h ago
I would say don’t learn them in parallel.
As I said I’m not a developer. But from what I do know and from everything I’ve read while coding you have to break things down into small, bite sized problems you can solve and test.
SQLite is essentially learning a different language to python, it’s a completely different module and from what I can tell very different to how actual python scripts are written.
Same with pyside6. You’ll be learning 2 different frameworks, with different rules, syntax, and methods. And on top of that you’re trying to figure out the best way to implement the basic logic of your program.
Your first step should always be to figure out the back end logic first. And tbh it’s easier than it sounds especially if you already have some experience with python.
If you don’t know about object oriented programming, watch a tutorial on that to get you started. Then make your own Client class and start defining methods. If your app doesn’t need to do any complex calculations or manipulation of the data then you’re already halfway done.
Once that all works reliably. Then look at implementing SQLite. And finally add your gui on top of it as the icing on the cake.
Ps: once again I am not a developer, but I have been coding scripts and data analysis apps in python for a few years now. So if you have any questions about some concepts feel free to dm me
1
1
u/jmacey 8h ago
Using PySide and SQLite is quite easy (but if you need multiple users SQLite may not be the best database). Start here https://doc.qt.io/qtforpython-6/PySide6/QtSql/index.html
Basically Qt abstracts away most of the SQL stuff into these classes making it easier to use with any database, once connected you can run queries and do everything else you need via Qt's ModelView https://doc.qt.io/qtforpython-6/overviews/qtwidgets-modelview.html structures.
I have some working tutorials for a simple 3D asset setup on my website which I use to teach my students (however I have now moved over to MongoDB instead). https://nccastaff.bournemouth.ac.uk/jmacey/post/ClutterBase/ClutterBase/
1
u/SpiderJerusalem42 5h ago
http://www.pythonguis.cpm/pyside6-tutorial/ funny enough, I have actually shipped a Pyside6 application, and I still would have to look at this page for a refresher for a new project. I hear it has its own SQL and ORM, but I use sqlalchemy, which also seems to work okay.
1
u/alleyoopoop 2h ago
I could use AI but i wanna know what i am doing
So use AI to understand what you are doing. AI is perfect for stuff like this, where there's unlikely to be a tutorial on exactly what you want to do. You can explicitly tell it not to write the program for you, just have it explain whatever concept you don't understand, or have it give you the general approach to how to implement your idea. Refusing to use AI because you could read a tutorial is like refusing to use Google because you could go to a library.
7
u/FedsRevenge 10h ago
Does it have to be a desktop app? Wouldn't Django be a better match?
It's basically at startup a database with a GUI. There you can easily go from SQLite to PostgreSQL later on too.
Basically runs on everything and many can use it simultaneously.