r/Python • • Aug 17 '26

Discussion What are some Python automations you built for your life?

What Python scripts/projects did you built to use on a day to day basis? Or maybe someone else built it, but it’s useful for your personal life in some way

I think the “projects ideas” thread is really missing those useful opportunities

I myself thought about automating tax calculations, but still didn’t take the time to do it hah

323 Upvotes

164 comments sorted by

View all comments

Show parent comment

1

u/unsungzero1027 Aug 17 '26

… i never thought to put in my scripts to pull data from our data warehouse. 🤦‍♂️ I suddenly feel so stupid. Time to make sure I can do it since our data warehouses are pretty locked down (one we have to use a secure login via the web that downloads a VM that automatically connects to a VPN or else the connection is refused even if you have access to it). The lockdown makes sense though since it has clients’ data and people’s PHI and PII.

I really should also update at least some of the scripts to pull the data I can get from our shared drives directly off of them. I just hate doing anything directly from the shared drives bc I have to also put in to pull only the latest file in the folder and the shared drives are painfully slow so it takes forever to even pull a 3mb file sometimes. But doing that I can stop saving some files on my laptop and save space. I have so many scripts for different reports / audits / analysis I get asked to do / have to do.

1

u/ContractPhysical7661 Aug 17 '26

We use an older reporting system that isn't locked down to the extent you're describing, but there is no API for employees. That's why I'm experimenting with playwright + a cli tool (argparse/some custom fx to validate my entry/extract variables for filtering the reports). It's all point/click with dropdowns and entries.

What I do now is run all of the reports/queries that I need do, and save them to my downloads folder. I have a map of the glob patterns that each of the reports follow (e.g. Detail Financial Report Download*.xlsx, since only the suffix will be adjusted with multiple overlapping downloads), use Path.home().iterdir() / "Downloads" w/ those patterns, then sort the results using each path's .stat() / created time, and select the latest for each of them. From there i generate my frames and they're pointed to save to a shared directory for my team. Saves a decent amount of time and the biggest bottleneck for me is the manual/cut/paste/etc. so it's nice to be able to do this in a single run.

P.s. never feel stupid, we're always learning from each other

3

u/pacopac25 Aug 17 '26

For one of my clients, IT will dump a .parquet or CSV into a directory on a schedule. I use DuckDB to transform into the format I need.

Sometimes I just grab what I need with PowerQuery, but often I'll create "views" which I store in sqlite format for use later.

1

u/pacopac25 Aug 20 '26

Note: To ensure idempotency, I store a hash of the files I consume, because sometimes, for no reason, they stop appending the date to the csv. So I get heres yourcrappydata1.csv, heresyourcrappydata2.csv, etc instead of heresyourcrappydata_2026-08-20.csv

1

u/unsungzero1027 Aug 20 '26

That’s annoying. I have to send reports to one of our vendors for them to add clients that have or removed a specific program. I HAVE to append the report with mmddyyhhmmss and it literally is nothing to add. I wonder if they are having issues with the file path after appending the date. Though that would only make sense if they moved where the report originally gets dropped.

Or could just be someone is off that day and the person covering for them doesn’t decide to add the date?