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
🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. 🌈

🌈 Colorist for Python 🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. Prerequisites Python 3.9 or hig

Jakob Bagterp 1 Feb 05, 2022
An interactive aquarium for your terminal.

sipedon An interactive aquarium for your terminal, written using pytermgui. The project got its name from the Common Watersnake, also known as Nerodia

17 Nov 07, 2022
A useful and easy to use Terminal Timer made with Python.

Terminal SpeedCubeTimer Installation ¡No requirements! Just Download and play Usage Starts timer.py and you will see this. python timer.py Scramble

Achalogy 5 Dec 22, 2022
GoogleFormSpammer - A simple CLI script to spam Google Forms used by Crypto Wallet scammers to collect stolen data

GoogleFormSpammer - A simple CLI script to spam Google Forms used by Crypto Wallet scammers to collect stolen data

14 Dec 17, 2022
CLI helper to install Github releases on your system.

gh-release-install is a CLI helper to install Github releases on your system. It can be used for pretty much anything, to install a formatter in your CI, deploy some binary using an orcherstration to

Jonas L. 28 Nov 06, 2022
The command line interface for Gradient - Gradient is an an end-to-end MLOps platform

Gradient CLI Get started: Create Account • Install CLI • Tutorials • Docs Resources: Website • Blog • Support • Contact Sales Gradient is an an end-to

Paperspace 58 Dec 06, 2022
A simple command line tool written in python to manage a to-do list

A simple command line tool written in python to manage a to-do list Dependencies: python Commands: todolist (-a | --add) [(-p | --priority)] [(-l | --

edwloef 0 Nov 02, 2021
py-image-dedup is a tool to sort out or remove duplicates within a photo library

py-image-dedup is a tool to sort out or remove duplicates within a photo library. Unlike most other solutions, py-image-dedup intentionally uses an approximate image comparison to also detect duplica

Markus Ressel 96 Jan 02, 2023
A command line tool (and Python library) for archiving Twitter JSON

A command line tool (and Python library) for archiving Twitter JSON

Documenting the Now 1.3k Dec 28, 2022
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
A Neat Application To Manage Your To-Do Lists.

WTD - What To Do? A Neat Application To Manage Your To-Do Lists. One folder can only have one to-do file. Running wth without any subcommands executes

Adam Vajda 1 Oct 24, 2021
MasterDuel Image Recognition Translation Command Line Tool

MasterDuelTranslate(Use Ygo Card DataBase,belong win32 window shot & image match)

PatchouliTC 77 Dec 01, 2022
iTerm2 Shell integration for Xonsh shell.

iTerm2 Shell Integration iTerm2 Shell integration for Xonsh shell. Installation To install use pip: xpip install xontrib-iterm2 # or: xpip install -U

Noorhteen Raja NJ 6 Dec 29, 2022
jrnl is a simple journal application for the command line.

jrnl To get help, submit an issue on Github. jrnl is a simple journal application for the command line. You can use it to easily create, search, and v

jrnl 5.7k Dec 31, 2022
dsub is a command-line tool that makes it easy to submit and run batch scripts in the cloud.

Open-source command-line tool to run batch computing tasks and workflows on backend services such as Google Cloud.

Data Biosphere 233 Jan 01, 2023
Package installer for python

This is a package that adds a JSON file to your project that records all of the packages used in it and allows people to install it with a single command.

Anmol Malik 1 May 23, 2022
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.

parse_it A python library for parsing multiple types of config files, envvars and command line arguments that takes the headache out of setting app co

Naor Livne 97 Oct 22, 2022
Trans is a dependency-free CLI for Google Translate

Trans is a dependency-free CLI for Google Translate

11 Jan 04, 2022
Pastekan adalah website paste kode / teks sederhana

Pastekan pastekan adalah website paste kode / teks sederhana. install pip install pastekan penggunaan pastekan myfile.txt atau echo "hi" | pastekan

Sekai Kode 1 Dec 24, 2021
Projeto Reverse Shell For Python

Use com sabedoria!!! Modo de uso: Linux (inclui Android e Mac): - apt-get update - apt install python3 (ou "python" apenas) - git clone https://github

1 Jan 03, 2022