photo-stats

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

README.md (4527B)


      1 # Photo Stats
      2 
      3 This project is a small statistic generator for the terminal which accumulates data about your photographical habits.
      4 
      5 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.
      6 
      7 For extensive usage information see `man phosta`.
      8 
      9 ## features
     10 - loading of EXIF data from media files to a self-contained database
     11 - apply aliases to unify names of bodies or lenses
     12 - querying different statistics from the gathered data
     13 - available fields
     14     - file
     15     - camera maker
     16     - camera model (body)
     17     - lens maker
     18     - lens model
     19     - focal length (physical and 35mm equivalent)
     20     - iso
     21     - aperture
     22     - exposure time
     23 - grouping with summarizing based on date&time of pictures
     24     - year
     25     - month
     26     - week
     27     - hour
     28 - filtering of data by
     29     - time range of photos shot
     30     - values in fields in "CONTAINS" and "NOT CONTAINS" mode
     31 	- lines with empty fields
     32 - custom sorting of output by arbitrary fields
     33 - output results to your terminal in a table or a simple graph view
     34 
     35 ## usage
     36 Before you can query some stats, the EXIF data has to be extracted from your media files and written to the database. 
     37 
     38 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.
     39 
     40 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. 
     41 
     42 For a complete list of params and example querys use `phosta --help`.
     43 
     44 ### example output
     45 The output will be shown as a bar graph when you select only one output column:
     46 ```
     47 $ ./phosta -s model -f maker=ricoh -o model
     48 Querying database ~/photo_stats.db with 29399 entries...
     49 
     50 Applied filters:
     51    - *maker* LIKE **ricoh**
     52 
     53 A total of **5090 images** matched your criteria.
     54 
     55           RICOH WG-4 |                                                    |  1.1% (56)
     56          PENTAX MX-1 | **                                                 |  4.9% (251)
     57            PENTAX KP | *********                                          | 19.7% (1005)
     58          PENTAX K-S2 | **************                                     | 29.5% (1502)
     59          PENTAX K-S1 | **********                                         | 21.6% (1098)
     60        PENTAX K-3 II | ********                                           | 17.0% (863)
     61                GR II | *                                                  |  2.2% (114)
     62            Caplio R7 | *                                                  |  3.9% (201)
     63 
     64 ```
     65 
     66 or as a table when you choose more then one field:
     67 ```
     68 Querying database ~/photo_stats.db with 29399 entries...
     69 
     70 Applied filters:
     71    - *maker* LIKE **ricoh**
     72 
     73 A total of **5090 images** matched your criteria.
     74 
     75 .-----------------------------+---------------+-------+---------.
     76 | maker                       | model         | count | percent |
     77 +-----------------------------+---------------+-------+---------+
     78 | RICOH IMAGING COMPANY, LTD. | RICOH WG-4    | 56    | 1.1%    |
     79 | PENTAX RICOH IMAGING        | PENTAX MX-1   | 251   | 4.9%    |
     80 | RICOH                       | PENTAX KP     | 52    | 1.0%    |
     81 | RICOH IMAGING COMPANY, LTD. | PENTAX KP     | 953   | 18.7%   |
     82 | RICOH IMAGING COMPANY, LTD. | PENTAX K-S2   | 1502  | 29.5%   |
     83 | RICOH IMAGING COMPANY, LTD. | PENTAX K-S1   | 1098  | 21.6%   |
     84 | RICOH IMAGING COMPANY, LTD. | PENTAX K-3 II | 863   | 17.0%   |
     85 | RICOH IMAGING COMPANY, LTD. | GR II         | 114   | 2.2%    |
     86 | RICOH                       | Caplio R7     | 201   | 3.9%    |
     87 '-----------------------------+---------------+-------+---------'
     88 ```
     89 
     90 ## Installation
     91 Clone the repo, then run
     92 ```
     93 $ make
     94 $ sudo make install
     95 ```
     96 
     97 For ArchLinux, `phosta` is available as an [AUR package](https://aur.archlinux.org/packages/phosta) that takes care of the dependencies.
     98 
     99 To run the script, open a shell and invoke `phosta`.
    100 
    101 #### prerequisites for running the pure scripts
    102 
    103 - exiftool
    104 - SQLite 3
    105 - Perl 5.30 (or newer)
    106 
    107 Additionally the following perl modules need to be installed:
    108 
    109 - File::HomeDir
    110 - File::Spec::Functions
    111 - Perl::DBD::SQLite
    112 - Perl::DBI
    113 - Perl::Modern
    114 - Text::SimpleTable::AutoWidth
    115 - Term::AnsiColor
    116 - Scalar:Util