Tag Archives: Python

Introducing download-sweeper

One of the biggest issues on any system of mine is the cluttering of the Downloads folder. In the modern Internet age, we download a ton of files. Checking right now, the contents of my Downloads folder sum to about 15GB in filesize. Although that probably isn’t too much of an issue given the cheapness of storage today, it remains troublesome when hand-searching through the files.

When I only ran Windows, I used Cyber-D’s Autodelete to delete my old downloads. This worked perfectly for me, except for the fact that sometimes it would delete files that I forgot that I wanted. But with Windows, I could always find those files in the recycle bin.

Fast forward several years, and I now run Linux as my primary operating system. Without doing much research to see if a program already existed, I drafted a “spec” for download-sweeper, a program that would delete old files in the Downloads directory, but also allow the user a “grace period” where they could still recover old Download files if they were removed.

Sure, this could probably be created in less than 100 lines of C, but I was looking to create a robust and portable solution that would allow me to quickly make changes if I needed to. Thus, I created a clean (~350 lines) Python solution that would do just that.

Further, when integrated with systemd, everything works perfectly. I currently have the application deployed on my Laptop, my Desktop, and on the webserver that’s running this blog. Of course, there aren’t any downloads on the webserver, so I use it to act as a “virus/malware quarantining tool”.

You can view the project on its GitHub page, here: https://github.com/brandonio21/download-sweeper

An Update on Python

Upon looking at the title of this post, you may be under the impression that
I am starting to learn python from scratch. Although that is most definitely
what the title implies, I am doing something a little bit different.

For the past 6 months I have been using python. I first started with a hackathon
project Recipr, where I implemented a server backend using Flask. This gave me the confidence I needed to start using python for other projects.

By its own standards, python is a language that allows you to quickly prototype
ideas. With that being said, it’s perfect for homework assignments where all
that matters is the final answer. (I don’t think many students are very proud
of the actual code that is submitted along with these assignments). Thus,
I also used python to implement several machine learning algorithms for a course
I was taking at the time.

Since then, I wrote a working replacement for my Programming Competition
framework, PCFramework, in python. I uncreatively called it PyCFramework.

I also used python for a fairly-large professional project during an internship
I held this summer.

With that being said, it is obvious that I have a decent amount of experience
with python. However, there is a clearly defined difference between knowing
a language and really knowing a language. To simply know a language is to
code in that language. To really know a language is to understand its principles,
design paradigms, and hidden features that make the language great.

Over the course of the next few months, I intend to really know and understand
python. Here is what to expect:

  1. Progression guided by Intermediate Python
  2. Refactoring and recreation of old projects, such as machine learning algorithms
  3. Creation of new projects, such as a new version of PyCFramework
  4. Discussion of the topics via this blog