photo-stats

statistics processor for the terminal
git clone https://git.clttr.info/photo-stats.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 5fd7e15f0f77ee66a476ffec6878007eae874bff
parent cadfdffc0a348b70981acd57ea7139d47e431446
Author: René Wagner <rwa@clttr.info>
Date:   Sun,  2 Apr 2023 16:46:09 +0200

cosmetics for 1.1

Diffstat:
MCHANGELOG.md | 5+++++
MPKGBUILD | 6+-----
MREADME.md | 15++++++++-------
Mphosta | 6+++---
4 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## 1.1 (02.04.2023) +- introduce aliases to allow data to be sanitized +- new param -T for table output +- new param -W for output width limiting + ## 1.0 (31.08.2020) initial release with the following features: - extract EXIF data from media files and store it in the database diff --git a/PKGBUILD b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: René Wagner < rwagner at rw-net dot de > pkgname=photo-stats -pkgver=1.0_10_ga8cfae0 +pkgver=1.1 pkgrel=1 pkgdesc='photo stats for your terminal' arch=('x86_64' 'i686' 'aarch64') @@ -13,10 +13,6 @@ options=(!strip) source=('phosta') sha256sums=('SKIP') -pkgver() { - printf "%s" "$(git describe | sed -r 's/\-/_/g' )" -} - package() { mkdir -p "${pkgdir}/usr/bin" install -Dm755 phosta "${pkgdir}/usr/bin/" diff --git a/README.md b/README.md @@ -4,8 +4,6 @@ This project is a small statistic generator for the terminal which accumulates d It is mainly a selfcontained [SQlite](https://sqlite.org) database that stores the data which is extracted from the exif data of your images using [exiftool](https://exiftool.org/) and provides some methods to query the gathered data and gain some statistical insight. -**Additional information can be found on the [wiki page](https://src.clttr.info/rwa/photo-stats/wiki/Home).** - ## features - loading of EXIF data from media files to a self-contained database - apply aliases to unify names of bodies or lenses @@ -15,7 +13,7 @@ It is mainly a selfcontained [SQlite](https://sqlite.org) database that stores t - camera maker - camera model (body) - lens model - - focal length + - focal length (physical and 35mm equivalent) - iso - aperture - grouping with summarizing based on date&time of pictures @@ -26,17 +24,18 @@ It is mainly a selfcontained [SQlite](https://sqlite.org) database that stores t - filtering of data by - time range of photos shot - values in fields in "CONTAINS" and "NOT CONTAINS" mode + - lines with empty fields - custom sorting of output by arbitrary fields -- output results in a table view to your terminal +- output results to your terminal in a table or a simple graph view ## usage Before you can query some stats, the EXIF data has to be extracted from your media files and written to the database. -You can add different folders one by another to the database, the import will take care the files added and avoid duplicates (currently based on file path). If you think something is messed up you can clean your database and start over. +You can add different folders one by another to the database, the import will take care the files added and avoid duplicates (based on file path and name). If you think something is messed up you can clean your database and start over. After you've added some data, you can query different statistics which might be interesting. There are no predefined stats, instead you have the option to adjust the output to your needs using the different params. -For a complete list of params and example querys use `phosta --help` or have a look at the [wiki](https://src.clttr.info/rwa/photo-stats/wiki/Params). +For a complete list of params and example querys use `phosta --help`. ### example output The output will be shown as a bar graph when you select only one output column: @@ -87,7 +86,9 @@ A total of **5090 images** matched your criteria. ## requirements The famous `exiftool` needs to be installed on your system. -Simply clone the repo or manually download the scripts from https://src.clttr.info/rwa/photo-stats/ +Simply clone the repo or manually download the scripts from https://git.sr.ht/~rwa/photo-stats/blob/master/phosta and put the file into a folder that is included in your `$PATH`. + +For ArchLinux, `phosta` is available as an AUR package that takes care of the dependencies. To run the script, open a shell and invoke `perl phosta`, on most systems it should be sufficient to just invoke `phosta` (after you granted execute-permissions to the script). diff --git a/phosta b/phosta @@ -389,7 +389,7 @@ sub print_filterinfo if (defined($opt_n) || $opt_e) { - say 'Showing '. color('bold'). "$currentlines". color('reset'). ' results, skipping '. color('italic') . "$skippedlines lines".color('reset') .'.'; + say 'Showing '. color('bold'). "$currentlines". color('reset'). ' results, skipping '. color('italic') . "$skippedlines results".color('reset') .' due to empty fields.'; } say 'A total of '. color('bold'). "$sum images". color('reset') .' matched your criteria.'; say ''; @@ -430,7 +430,7 @@ sub result_to_table { my ( $headers, $rows, $sum, $skippedlines ) = @_; - my $tb = Text::SimpleTable::AutoWidth->new(); + my $tb = Text::SimpleTable::AutoWidth->new('max_width' => $opt_W); $tb->captions($headers); foreach (@$rows) @@ -483,7 +483,7 @@ sub main::HELP_MESSAGE say ' allowed fields: file, maker, model, lensmake, lens, aperture, exposuretime, iso, focallength, focallength35mm'; say ' -n <number> : limit the resultset to <number> of lines'; say ' -o <fields> : sort your output by the given fields (sequence matters!) in descending order'; - say ' allowed values: any comma separated combination of the values of -t and -s param and \'count\''; + say ' allowed values: any comma separated combination of the values of -g and -s param and \'count\''; say ' -r : sort in reverse (ascending) order, default is descending order'; say ' -e : skip lines with empty selected or grouping fields'; say ' -W <number> : define max char width of output, default: 80, a minimum of 50 is required for meaningful output';