<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ahmedul kabir</title>
    <description>The latest articles on DEV Community by ahmedul kabir (@ahmedul_kabir_a24bca9546f).</description>
    <link>https://dev.to/ahmedul_kabir_a24bca9546f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1638161%2Ff71f12ba-bfc1-4543-9a6d-0c65d39f268a.jpg</url>
      <title>DEV Community: ahmedul kabir</title>
      <link>https://dev.to/ahmedul_kabir_a24bca9546f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmedul_kabir_a24bca9546f"/>
    <language>en</language>
    <item>
      <title>Taming Folder Chaos: Building a Simple Python CLI for Auto File Organization</title>
      <dc:creator>ahmedul kabir</dc:creator>
      <pubDate>Sat, 18 Oct 2025 16:23:43 +0000</pubDate>
      <link>https://dev.to/ahmedul_kabir_a24bca9546f/taming-folder-chaos-building-a-simple-python-cli-for-auto-file-organization-1hne</link>
      <guid>https://dev.to/ahmedul_kabir_a24bca9546f/taming-folder-chaos-building-a-simple-python-cli-for-auto-file-organization-1hne</guid>
      <description>&lt;p&gt;Hey DEV community! 👋 As a software engineer who's constantly juggling code, downloads, and random files, I got fed up with messy folders. &lt;/p&gt;

&lt;p&gt;My Downloads directory was a warzone of images, PDFs, ZIPs, and who-knows-what. So, I built Auto File Organizer—a lightweight Python CLI tool that sorts files into neat subfolders based on extensions. No bloat, no dependencies, just pure stdlib magic.&lt;/p&gt;

&lt;p&gt;We've all been there: Searching for that one PDF in a sea of screenshots and archives. Manual sorting? Ain't nobody got time for that. This tool automates it, categorizing files into folders like:&lt;/p&gt;

&lt;p&gt;Images (.jpg, .png, etc.)&lt;br&gt;
Documents (.pdf, .docx, etc.)&lt;br&gt;
Archives (.zip, .rar, etc.)&lt;br&gt;
Videos (.mp4, .mkv, etc.)&lt;br&gt;
Audio (.mp3, .wav, etc.)&lt;br&gt;
Code (.py, .js, etc.)&lt;br&gt;
Misc (catch-all for the rest)&lt;/p&gt;

&lt;p&gt;It handles duplicates by renaming and skips directories to avoid mishaps.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why I Built It (and Open-Sourced It)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm a fitness freak by day (or whenever I can squeeze in a workout), but coding is my jam. This started as a quick script for personal use, but I realized it could help others—devs, creators, or anyone with digital hoarding tendencies. Open-sourcing it on GitHub (MIT license) lets folks fork and tweak it. Plus, it's a great starter project for Python beginners.&lt;br&gt;
Key decisions:&lt;/p&gt;

&lt;p&gt;No deps: Sticks to os, shutil, and argparse for portability.&lt;br&gt;
CLI-first: Easy to run from terminal, with options for flexibility.&lt;br&gt;
Small scope: Under 100 lines—hackable without overwhelm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works: A Quick Dive&lt;/strong&gt;&lt;br&gt;
Here's the core logic (full code in the repo):&lt;br&gt;
pythonimport os&lt;br&gt;
import shutil&lt;br&gt;
import argparse&lt;/p&gt;

&lt;p&gt;`# ... (category definitions)&lt;/p&gt;

&lt;p&gt;def organize_files(directory, recursive=False, dry_run=False, move_noext=False):&lt;br&gt;
    # Scan and move logic here...&lt;br&gt;
    pass  # See repo for full implementation&lt;/p&gt;

&lt;p&gt;if &lt;strong&gt;name&lt;/strong&gt; == "&lt;strong&gt;main&lt;/strong&gt;":&lt;br&gt;
    parser = argparse.ArgumentParser(description="Organize files by type.")&lt;br&gt;
    # Add args: directory, --recursive, --dry-run, --move-noext&lt;br&gt;
    args = parser.parse_args()&lt;br&gt;
    organize_files(args.directory, args.recursive, args.dry_run, args.move_noext)`&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To try it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clone:&lt;/strong&gt; git clone &lt;a href="https://github.com/ahmedul/auto-file-organizer.git" rel="noopener noreferrer"&gt;https://github.com/ahmedul/auto-file-organizer.git&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Preview:&lt;/strong&gt; python3 file_organizer.py ~/Downloads --recursive --dry-run&lt;br&gt;
&lt;strong&gt;Run:&lt;/strong&gt; python3 file_organizer.py ~/Downloads --recursive --move-noext&lt;/p&gt;

&lt;p&gt;It previews moves in dry-run mode, so no surprises!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Testing is key: I added unit tests after a near-miss with recursive moves.&lt;br&gt;
Community input: Early feedback on Reddit led to --move-noext for extensionless files.&lt;br&gt;
Promotion matters: Sharing on X and HN got initial stars—thanks, folks!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Custom config files for user-defined categories.&lt;br&gt;
Undo logs for reversing changes.&lt;br&gt;
Scheduling (e.g., cron integration).&lt;/p&gt;

&lt;p&gt;If this resonates, check out the repo: &lt;strong&gt;&lt;a href="https://github.com/ahmedul/auto-file-organizer" rel="noopener noreferrer"&gt;https://github.com/ahmedul/auto-file-organizer&lt;/a&gt;&lt;/strong&gt;. Star it ⭐, fork it, or drop a PR with ideas. What pain points do you have with file management? &lt;/p&gt;

&lt;p&gt;Let's discuss in the comments!&lt;br&gt;
Thanks for reading—happy organizing! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  python #opensource #cli #productivity #devtools
&lt;/h1&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>cli</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
