Python Forum

Full Version: How to desing an app for tracking workload
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, everyone keeps telling me the best way to learn Python is to start your own projects, so I wanted to create my own desktop app. I need help with designing it and choosing the best solutions/architecture though. Hope you can guide me a little!

Purpose: I need to have a GUI for users to input how much time they spend on different projects for department capacity calculations. Then, I will add additional view showing different charts for management.

Limitations: My users would be non-techies, so the app would have to be a simple GUI accessed via a stand-alone executable. Unfortunately, I won't have access to any good databases so I though I'll just save the data as dictionary and store it in JSON txt file on SharePoint or network drive (that probably sounds really lame :/ ). Here's how I envisioned the data structure would look like.

time_spent = {"Ann": {"October": {"Project X": "50", "Project Y": "20"},
                     "November": {"Project X": "40", "Project Y": "30"}},

              "Laura": {"October": {"Project X": "50", "Project Z": "10"},
	                   "November": {"Project X": "70", "Project Z": "20"}}}
Libraries: Matplotlib, PyQt5, json, PyInstaller - (Python 3.7)

Questions:
1. Do you think the data structure makes sense considering limitations in my workplace? Wouldn't it be inefficient for calculations (e.g. showing overall time for the Project Y in October would mean I have to scan for each nested dictionary)?
2. Any thoughts on what I should think about before I start to code?
3. Please let me know if I ask wrong questions!
(Jan-08-2019, 08:58 AM)Cuz Wrote: [ -> ]I won't have access to any good databases
Look at sqlite - it's a full feature database and it store the info in a simple file that could reside on network drive/share point - in any case better than JSON in my opinion as will be easier to query and update info (e.g. to update json you will need to read the whole file, update it and dump it back agan). The best part - sqlite support is included in the python standard library.
That's exactly the kind of advice I was looking for! Briefly looked it up and from what I understand it's open-source, doesn't require any kind of installation or configuration from users, it can be moved easily, and can be used offline, is that right? Looks like a perfect solution for me.
Yes, all that's true
And another bit of advise - think about the design of your application in advance. In any case there may/will be need to refactor code to improve it, but good design will make everything (i.e. development/testing/support/future updates) much more easier. For example - separate GUI and logic, build the system of small blocks that work together, etc. All this is part of the software design.
Once again, I'm in awe looking at how helpful is python community. ◕‿◕