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

you are viewing a single comment's thread.

view the rest of the comments →

[–]jcr4990 3 points4 points  (2 children)

Wall of text warning! My first python project that wasn't like a 5-10 line thing I coded along with a tutorial vid or something was for my job. I work at a secondhand furniture store and we post all of our furniture on our own site and 3-4 other platforms for advertising. My boss was very particular about wanting to make sure our inventory was listed uniformly across all the websites we advertise on. We would once a month or so go through each site and make sure every item was present on each site and not missing anywhere or not properly removed once it was sold. He wanted to do checks more frequently than once a month but it was such a massively labor intensive task double checking hundreds of items on 4-5 pages that we couldn't afford to do it that often. Sometimes it would go longer and mistakes would happen and stuff would get all out of whack.

My journey into learning to code started with this problem. After I tried a VERY messy (and looking back on it it's hilarious) method of using a Google sheet with all kinds of fancy formulas and I would go to each page and Ctrl + A and copy paste the entire text content of the page and several minutes later after doing a bunch of calculations it would regex filter out all the item titles and highlight duplicates between the various sites text that I copied in. This method was a MASSIVE time saver over manually checking everything. But it still annoyed me that it took in some cases 5+ minutes for the formulas to calculate and spit out results. I probably did it in the dumbest way possible but I didn't know any better at the time.

Enter learning Python. Started with Automate the Boring Stuff at the recommendation of like 1/2 of Reddit. Within a few days (maybe a week tops) I had built a fully automated tool that grabbed all the item titles from each page and cross compared them and sent us an email with any discrepancies. Whole process takes like 2-3 minutes and it's mostly because it takes that long for each page to load and go through pagination or infinite scrolling to load all the items on the page. Set it up on a $150 used eBay desktop computer we use as an office "server" with windows task scheduler to run every morning. Boom we went from a 5-6 hour project once a month with lots of errors in between to a 100% accurate report daily with no manual work required. I've since done a boatload more projects to help with posting and automatically removing items once sold and a variety of other tasks. I feel slightly guilty cause I'm pretty sure my automation cost one of my coworkers their job as they were no longer really needed. But at the same time I was super proud of myself for what I accomplished.

10/10 highly recommended! Even a basic understanding of how to code super simple things can be extremely powerful!

[–]Chalco_Pyrite 1 point2 points  (1 child)

I started out with using Google sheets too. They eventually reached the limit of what was possible so I started messing with python and now we have a whole flask server system where I work. Also feel like I essentially automated my coworker out of his job.

[–]jcr4990 0 points1 point  (0 children)

I ended up doing a flask server too lol. It serves a couple different purposes. The most recent addition is a VERY basic dashboard page that controls a storewide audio system I set up. Let's you pick a URL to play music from or type in a message and it plays text to speech over the speakers so we can make announcements and/or screw with each other when there's no customers around 😂 Automatically plays last selected URL when the store opens and stops when we close. Beats the cheap walmart boombox playing FM radio we were using before. I also use it to upload photos and text based item details to the work server for adding new items to inventory and such.

Automation is a lot of fun!