Small Python scripts offer an effective way to automate daily tasks that often disrupt focus. These simple tools can be saved as individual files and executed with keyboard shortcuts or scheduled tasks. They address common irritations, such as messy downloads and cluttered notes, enabling users to enjoy a more efficient workflow.
Organize Your Downloads Folder
A disorganized Downloads folder can hinder productivity, especially when searching for files. This script categorizes files by type and moves them into designated subfolders, helping to maintain a tidy working directory. Utilizing only the standard Python library, it can be easily executed across various operating systems, including Windows, Linux, and macOS.
By pointing the script to any folder, users can automate the organization process. It categorizes files by extension, which works well for documents, media, and installers. Users can also customize the script to include file types relevant to their specific needs, such as STL files for 3D printing or ISO images.
This script effectively avoids duplicates by moving files instead of copying them. Users sharing a machine can help maintain privacy by directing files to personal folders. Additionally, the script can skip over files that are currently open, ensuring smooth operation.
Capture Quick Notes with Ease
Inspiration often strikes unexpectedly, and this script provides a solution for capturing fleeting thoughts. It appends lines to a daily markdown file, complete with timestamps. This method allows users to keep track of ideas in a straightforward folder that can be easily synchronized with preferred notes applications.
Each entry begins with the current time, followed by the user’s input. This organization simplifies searching and archiving. The script creates a new note file if one does not already exist, ensuring continuity in documentation. Users can assign a global hotkey for quick access, streamlining the process of note-taking.
For those who prefer more structured entries, the script can accommodate headers or sections for tasks and links. This small, focused script enhances productivity without overwhelming users.
Clean Up Tracking Links
Tracking parameters often clutter URLs, making them cumbersome to share. This script cleans up links by removing common tracking codes, such as utm_source and fbclid, and pastes the cleaned version back into the clipboard. It employs the standard library for URL parsing, along with the pyperclip package for clipboard access.
By modifying only text recognized as URLs, the script prevents interference with non-URL content. This functionality is useful when copying links from social media or search engines, ensuring that notes remain tidy for future reference. Users can also implement a whitelist to retain specific parameters when necessary.
Log Internet Issues for Better Troubleshooting
Intermittent internet outages can be frustrating and difficult to diagnose. This script monitors connectivity by pinging reliable hosts and logs any failures, along with timestamps, into a CSV file. By providing a compact log of incidents, users can easily identify whether the issue lies with their internet service provider or local equipment.
The script records consecutive failures as a single incident, simplifying data analysis. Users can run it in the background at set intervals, allowing for continuous monitoring. For those who prefer immediate feedback, adding desktop notifications can alert them to connectivity issues, making it a proactive tool for troubleshooting.
These Python scripts exemplify the power of automation in daily life, allowing users to focus on what truly matters. By implementing just one of these tools, individuals can enhance their productivity and enjoy a more organized day.
