Automating Import of Quarterly Data with Python

🚀 𝑨𝒖𝒕𝒐𝒎𝒂𝒕𝒊𝒏𝒈 𝑫𝒂𝒕𝒂 𝑰𝒎𝒑𝒐𝒓𝒕𝒔 — 𝑶𝒏𝒍𝒚 𝑾𝒉𝒂𝒕’𝒔 𝑵𝒆𝒆𝒅𝒆𝒅! 🧠📊 Over the last 10 years, I’ve accumulated a huge collection of performance files in my system. Each file, fortunately, contains its own date — which gave me an idea 💡. Instead of manually selecting which files to import every quarter, I wrote a small yet powerful Python script that automatically 𝐢𝐦𝐩𝐨𝐫𝐭𝐬 𝐨𝐧𝐥𝐲 𝐭𝐡𝐞 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐪𝐮𝐚𝐫𝐭𝐞𝐫’𝐬 𝐝𝐚𝐭𝐚 from my archive. Here’s how it works 🧾 ✅ Scans the target folder for all .zip files ✅ Extracts the date (in DDMMYYYY format) from filenames ✅ Identifies the 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐪𝐮𝐚𝐫𝐭𝐞𝐫 𝐚𝐧𝐝 𝐲𝐞𝐚𝐫 dynamically ✅ Filters and imports only the files that fall within that rang This small automation saves time ⏱️, reduces mistakes ❌, and keeps the data pipeline clean and focused on the 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐪𝐮𝐚𝐫𝐭𝐞𝐫’𝐬 𝐊𝐏𝐈𝐬. 🔹 Function name: get_current_quarter_files() 🔹 Output: A list of .zip files belonging to the 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐪𝐮𝐚𝐫𝐭𝐞𝐫 (𝐞.𝐠., 𝐐𝟒 𝟐𝟎𝟐𝟓) Python continues to be my go-to tool for streamlining repetitive data engineering tasks — one function at a time 🐍⚙️ #Python #DataAutomation #QuarterlyData #KPIs #DataEngineering #Productivity #Automation

  • text
See more comments

To view or add a comment, sign in

Explore content categories