I prepared backend for parsing csv file and getting only relevant information. Preparing those information into dictionary and then creating json in propper output folders. Why have I chosen this program? I wanted something to help me get overview for daily basis. Right now it just prepared json, but later on I would love to expand this program with propper frontend (to show different versions of project with their stats) and some charts... It would save me alot of time for showing developer's performance, tendencies etc. It might be really simple and short project (right now), but for my future plans I would need frontend knowledge, sql and some other stuff. And I don't want to cheat here, so I work only with my current knowledge. So let's call it my project part 1.
Funtions:
- create_folder() function is checking if we have /csv and /output folders, if not, create them
- rename_file() after getting file (csv) into /csv folder we rename it from whatever to "1", just for easier maintaining files. Right now we can work only with 1 file, otherwise it raise an Error. Later on I might add some kind of logic to be able to work with multiple files, altho not sure if needed.
- open_file() kinda core function to read csv file, before I was using this funtion multiple times in single app run, which is wrong. Later on I changed this function to run once and then save it in main function into variable. In future I might expand this function, when I prepare frontend, to be able to download and re-read new file...
- delete_identifier() just help function, windows sometimes create identifier files, so we just delete them
- check_if_empty() another help function just to check if folder with csv file is empty to raise and error
- total_ticket_count() function to count all tickets by their status
- highest_tickets_per_user() function to get highest count of tickets per single user (open, assigned)
- get_version() project version getter. If we'll continue using this program in future in next version, so we can have propper overview
- data_preparation_into_dict() function to get all those data and put them into single dictionary. Help a ton for readability
- save_output() function to put our prepared data and export them into json in proper folders (current and history)
- main() well, it's a main function
Files/Folders:
- main.py: For now I've put everything into this file, later on I will refactor it.
- Readme.md: Readme (this file)
- gitignore: classic
- /csv/ folder: folder for csv files (for not we tend to store only one file)
- /csv/updated_with_fake_summaries.csv: dummy csv file to try out program (had to change everything from czech language to english and change from real datas to fake (names, projects, summaries etc.))
- /src/ folder: we will have sources later on here, for now it's just for constants.py
- /src/constants.py: for now it's just for few constants, I like to use constant files for some easy settings...
- /output/ folder: for exported jsons, we will have here current json and then project/year/month/day/ folder where we will have json named as current date (for history purposes)
Logic:
- We take csv file and put it in /csv/ folder, from where we start parsing file
- After parsing file we prepared parsed data in propper form (dictionary)
- export them into output (json)
Plans for expansion:
- frontend for showing data, charts, different versions etc.
- put it on framework (flask?) so I'll have it running 24/7 on server for automatic work
- get some functions to automatic/ad-hoc download of new csv files from out ticket tracker system (for me it's MantisBT). Maybe reading from SQL database?
- refactor project for my future plans