63 lines
1.9 KiB
ReStructuredText
63 lines
1.9 KiB
ReStructuredText
autoimport
|
|
**********
|
|
|
|
.. content::
|
|
|
|
What is autoimport?
|
|
===================
|
|
|
|
``autoimport`` is a python3 module and program for importing photos into
|
|
a libraries using metadata, namely the name; the date and time of
|
|
the photo, the digitization and the original; the Model and Make
|
|
and the Software used to create the photo.
|
|
|
|
Usage
|
|
=====
|
|
|
|
``autoimport`` is used in basically two steps: selecting files to copy/move
|
|
and then actually copying and moving the files. By default the selection step
|
|
is implicit, but it can be run separately using ``autoimport select``.
|
|
|
|
``autoimport --help`` gives a list of all available commands and options.
|
|
|
|
Extended Usage
|
|
==============
|
|
|
|
Persistent Database
|
|
-------------------
|
|
|
|
It can be quite useful to run the selection and actual operation separately.
|
|
For instance, when the actual data is unknow and/or homogenous. To avoid
|
|
long search times, the intermediate data should then be stored.
|
|
This is done using the ``--storage`` option that specifies a path where
|
|
a sqlite3 database containing the data is stored.
|
|
|
|
A typical use case is a collection of RAW and JPEG data, which might be quite big::
|
|
|
|
autoimport select images/ --storage=autoimport.db -p jpg --walk
|
|
autoimport select images/ --storage=autoimport.db -p dng --walk
|
|
|
|
Then the files can be copied using::
|
|
|
|
autoimport copy images/ new_images --storage=autoimport.db
|
|
rm autoimport.db
|
|
|
|
without having to re-search all files.
|
|
|
|
The persistent can also be used to explicitly exclude some files using extra scipts,
|
|
by accessing the database directly. This requires some knowledge in sqlite3 (and maybe
|
|
python3)::
|
|
|
|
autoimport select images/ --storage=autoimport.db -p jpg --walk
|
|
|
|
sqlite3
|
|
> .open autoimport.db
|
|
> DELETE FROM FILES WHERE Model='Nexus 5X';
|
|
> ^D
|
|
|
|
autoimport copy images/ new_images/ --storage=autoimport.db
|
|
|
|
This example shows how to remove all images made with the Nexus 5X (a cellphone) from the
|
|
files that are copied.
|
|
|