Skip to main content

Organize files with one simple command

Project description

PickItUp

Super-simple way to categorize files in a messy directory. And it's only 4 KB!

PickItUp can categorize files by:

  • File type(video,photo,archive etc.)
  • Size of file
  • Last modification date

How To Install

  1. If pip is not installed sudo apt install pip3
  2. Install pickitup package with pip3 install pickitup
  3. Open your folder in terminal and run pickitup (Don't run program in /home folder :) )

How It Works:

  1. Lists all files in directory (os.listdir)
files = os.listdir(os.curdir)
filelist = []
for f in files:
    filelist.append(f)
  1. Takes user input for category type
print("PickItUp 1.0\nCommands:\n ext: Folder by extension\n date: Folder by modification date\n size: Folder by file size\n quit: Quit PickItUp")
action = input("> ")
  • By file extension
for file in filelist:
    filename ,file_extension = os.path.splitext(file)
    for category in types:
        if file_extension in types[category]:
            dst_path = "./" + category + "/" + file
            src_path = "./" + file
            try:
                shutil.move(src_path, dst_path)
            except:
                pass
  • By file size (<1MB for example)
for file in filelist:
    file_source = "./" + file
    file_size = os.stat(file_source)
    if file_size.st_size < 1000000:
        if os.path.exists("./Less Than 1 MB") == False:
            os.makedirs("./Less Than 1 MB")
        try:
            shutil.move(file_source, "./Less Than 1 MB/"+file)
        except:
            pass
  • By modification date
for file in filelist:
    file_source = "./" + file
    file_mod_date = time.localtime(os.path.getmtime(file_source))
    folder_name = calendar.month_abbr[file_mod_date.tm_mon] + " " + str(file_mod_date.tm_year)
    folder_path = "./" + folder_name
    if os.path.exists(folder_path) == False:
        os.makedirs(folder_path)
    try:
        shutil.move(file_source, folder_path)
    except:
        pass

Special Thanks To

Dyne.org - file-extension-list

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pickitup-1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pickitup-1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pickitup-1.0.tar.gz.

File metadata

  • Download URL: pickitup-1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pickitup-1.0.tar.gz
Algorithm Hash digest
SHA256 be91447d7873b408f849881eaa890843a36a5b6767f9f4c6d095f9502aee4c23
MD5 f421ef228bd1499b4195250501cc8cd7
BLAKE2b-256 7d91784246c0fe1130fa97dc2387bb782e30e26925004d25641a4323454519af

See more details on using hashes here.

File details

Details for the file pickitup-1.0-py3-none-any.whl.

File metadata

  • Download URL: pickitup-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pickitup-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7f729c837b761612f8880813304580c5a100531b3a805b30d4dd62d5e64753
MD5 c1d1384a2dc69b912a996fb388bca8a7
BLAKE2b-256 3accbc7338d71878d2cfd01c4674f2b025bdb208fa9d3526190d7af7bb928ad0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page