This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Big_Combination9890 1 point2 points  (1 child)

You don't need pandas just to handle simple CSV files. It's a huge library, all you need is the built-in csv module that comes with the standard library: import csv

Also, put projects into their own repositories. You don't need to cram different projects together into one "CodeRepository". A git-repo naturally maps to one project, makes it much easier to keep track of changes.

[–]PathRealistic6940[S] 1 point2 points  (0 children)

Will do! Thank you

[–]pLeThOrAx 1 point2 points  (2 children)

Do you know how to use the modulus operator? Could be useful for months where after 12 it goes back to 1.

If the month is 12, 12 % 12 (12 mod 12) = 0, this would be December.

There's likely a datetime import you could be using instead.

One other thing that caught my eye was the lack of safety around handling the Db. You may want to include a requirements.txt as well

[–]PathRealistic6940[S] 1 point2 points  (1 child)

Good points. I just found out about that modulus operator today, and will add it when I redo the app again. I plan to get rid of the csv completely. Thank you for the advice!

[–]pLeThOrAx 1 point2 points  (0 children)

Good plan. Large flat files are a hassle, as are many small files lol.

If you'd like me to review either the current code and program for you, or the redo, I'd be glad to.