Member-only story
Project of the week —Refactoring the RuneScape tracker from last week.
Cleaning up the code from the goal tracker in part 1.
Last week I created a runescape goal tracker that allows you to log data to keep a record of your profits from various sources. All in all the program worked but the I didn’t like the user experience and the code was all over the place.
This week I took the time to clean up my code and make it more modular.
The code from part 1 can be viewed in my github https://github.com/Kristian-Roopnarine in the repository “Runescape Goal Tracker”.
The entire code for part 2 is found in the repository “RsTracker”
Data storage
The first step was to figure out how to create a class to store my data efficiently. I also thought it would be a good idea to have some methods that perform actions on the data itself. All the data is converted into a Pandas DataFrame so one method involves converting the user input into a dictionary that is passed into pd.DataFrame.
The create_data_object() method constructs a Data class and then the information is converted into a…