A terminal utility to sort image files based on their characteristics.

Overview

About

A terminal utility to sort image files based on their characteristics.

Motivation

This program was developed after I've realized that I had too many wallpapers, and too little time. Although there are more advanced programs with a wider range of features (e.g.: variety, hydrus) most of the times I just want to filter my wallpapers by resolution or ratio from my downloads to my wallpaper folder, without leaving my terminal.

As so this tool was born, a minimal solution, which is meant to be used in a terminal ecosystem with other common utilities found in Linux based OSs, to assist the user in filtering image files.

Installation

Dependencies

This program requires Python version 3 as well as the following packages:

These packages are automatically resolved by pip.

Stable version

Install this program directly from Pypi:

$ pip install imgsort

Development version

For the latests updates, install the program directly from the dev branch on this repository:

$ pip install -e git+https://github.com/jpmvferreira/[email protected]#egg=imgsort

If instead you want to make changes to the source code, then clone this repository locally and install it in editable mode:

$ git clone https://github.com/jpmvferreira/imgsort
$ pip install -e imgsort

Usage

Let us now see this program in action with a few examples. Remember that at any time the help dialog (-h or --help) is available to provide information regarding the available flags.

To tell if wallpaper1.jpg in your current working directory is 1920x1080, then using the -s or --size flag:

$ imgsort wallpaper1.jpg -s 1920x1080

If the file is 1920x1080 then it will print its name, otherwise, it will print nothing.

If instead you want to know if wallpaper1.jpg is 16:9, you can use the same flag with with a ':' instead of the 'x':

$ imgsort wallpaper1.jpg -s 16:9

This can also be used for several files, with different formats:

$ imgsort wallpaper1.jpg wallpaper2.png -s 1920x1080

Naturally you can make use of bash's features, for example the wildcard statement, to filter a set of files which match a given pattern, in this case all of the .jpg files in the current working directory:

$ imgsort *.jpg -s 1920x1080

This program also reads from STDIN, which means that you can create pipelines with it.

For example, if you wish to tell if all your wallpapers, located at ~/wallpapers and respective subfolders, are 1920x1080, then create the following pipeline with find:

$ find ~/wallpapers | imgsort -s 1920x1080

If you wish to filter out all the wallpapers that are not 1920x1080, then you can rely on the -o or --opposite flag, which prints the file name if it doesn't match the provided size:

$ find ~/wallpapers | imgsort -s 1920x1080 -o

You can keep on adding to this pipeline to apply further actions.

Let's say you're trying to move all of your 1920x1080 wallpapers from ~/wallpapers/unsorted to ~/wallpapers/fullhd. By using the pipeline created above, and using xargs to which converts content found in STDIN to command line arguments, we can move all of those files to their designated location:

$ find ~/wallpapers/unsorted | imgsort -s 1920x1080 | xargs -I '{}' mv {} ~/wallpapers/fullhd

If you want to be sure that the program isn't doing anything funny, which you should, use -v or --verbose to print the image resolution or ratio to STDERR, which shouldn't affect the pipeline.

Contributing

If you happen to find a bug, have a question or would like to suggest a feature or simply share some fancy terminal wizardry, feel free to open up an issue.

Release cycle

This is a (very) small project, however, I do like to keep things tidy. As such I made a release cycle which goes as follows.

The first version will be 1.0.0, which is released once I consider that the program is good enough, and all the following versions will have the format X.Y.Z.

Each time that there is an update which does not modify the program behavior (e.g.: documentation, packaging) it will increment Z (e.g.: 1.0.0 -> 1.0.1).

Each time that there is an update which modifies the program behavior (e.g.: adding features, fixing bugs) it will increment Y and reset Z (e.g.: 1.0.1 -> 1.1.0).

Each time that there is an update which is not backwards compatible (e.g.: removing features, fundamental change on how the program is used) it will increment X and reset both Y and Z (e.g.: 1.1.2 -> 2.0.0).

In this Github repository you will find branches for the stable version (master) and the development version (dev). All modifications are done in the development branch and, after being tested, are included in the stable version, with the appropriate version bump.

License

MIT

Owner
José Ferreira
MSc student in Astrophysics and Cosmology at Instituto de Astrofísica e Ciências do Espaço (IA), in Faculty of Sciences of the University of Lisbon (FCUL)
José Ferreira
A super simple wallet application for the NANO cryptocurrency that runs in the terminal

Nano Terminal Wallet A super simple wallet application for the NANO cryptocurrency that runs in the terminal Written in 2021 by NinjaSnail1080 (Discor

9 Jul 22, 2022
Simple and convenient console ToDo list app

How do you handle remembering all that loads of plans you are going to realize everyday? Producing tons of paper notes, plastered all over the house?

3 Aug 03, 2022
This is a repository for collecting global custom management extensions for the Django Framework.

Django Extensions Django Extensions is a collection of custom extensions for the Django Framework. Getting Started The easiest way to figure out what

Django Extensions 6k Jan 03, 2023
CLI tool to develop StarkNet projects written in Cairo

OpenZeppelin Nile ⛵ Navigate your StarkNet projects written in Cairo. Getting started Create a folder for your project and cd into it: mkdir myproject

OpenZeppelin 305 Dec 30, 2022
Todo - You could use terminal to set your todo

Python Tutorial You can learn how to build a terminal application(CLI applicatio

29 Jun 29, 2022
spotifytools is a Python command line tool

spotifytools spotifytools is a Python command line tool Documentation The documentation is available on the following link Releases Instalation instru

0 Sep 28, 2021
Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Charles Tapley Hoyt 11 Feb 11, 2022
Ideas on how to quickly learn to build command-line tools

CLI-Bootcamp Ideas on how to quickly learn to build command-line tools Part 1-Bash Week1: Using Linux Lesson 1: Using Linux Shell Lab Lesson 2: How sh

Noah Gift 10 Apr 18, 2022
CLI Utility to encode and recursively recreate directories with ffmpeg.

FFenmass CLI Utility to encode and recursively recreate directories with ffmpeg. Report Bug · Request Feature Table of Contents Getting Started Prereq

George Av. 8 May 06, 2022
🕰 The command line tool for scheduling Python scripts

hickory is a simple command line tool for scheduling Python scripts.

Max Humber 146 Dec 07, 2022
grungegirl is the hacker's drug encyclopedia. programmed in python for maximum modularity and ease of configuration.

grungegirl. cli-based drug search for girls. welcome. grungegirl is aiming to be the premier drug culture application. it is the hacker's encyclopedia

Eristava 10 Oct 02, 2022
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
A simple script that outputs the current date on the user interface/terminal.

Py-Date A simple script that outputs the current date on the user interface/terminal. How to Run Open your terminal and cd into the folder containi

Arinzechukwu Okoye 1 Jan 13, 2022
Postgres CLI with autocompletion and syntax highlighting

A REPL for Postgres This is a postgres client that does auto-completion and syntax highlighting. Home Page: http://pgcli.com MySQL Equivalent: http://

dbcli 10.8k Jan 02, 2023
A command line tool made in Python for the popular rhythm game

osr!name A command line tool made in Python for the popular rhythm game "osu!" that changes the player name of a .osr file (replay file). Example: Not

2 Dec 28, 2021
CLTools provides various tools and command to use in the terminal.

CLTools provides various tools and command to use in the terminal. As of date, CLTools is only able to generate temporary email addresses and receive emails. There are plans to integrate more tools a

Ashwin Chugh 2 Feb 14, 2022
Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.

OpenCV on Wheels Pre-built CPU-only OpenCV packages for Python. Check the manual build section if you wish to compile the bindings from source to enab

OpenCV 3.2k Jan 04, 2023
Borderless-Window-Utility - Modifies window style to force most applications into a borderless windowed mode

Borderless-Window-Utility Modifies window style to force most applications into

8 Oct 22, 2022
This is a tool for managing file notes through the command line

This is a tool for managing file notes through the command line

2 Jun 22, 2022
Tmux Based Dropdown Dashboard For Python

sextans It's a private configuration and an ongoing experiment while I use Archlinux. A simple drop down dashboard based on tmux. It includes followin

秋葉 4 Dec 22, 2021