Sd-copy is a command line tool for copying DCIM files from an SD card and sorting them into a target folder according to metadata. The following cameras are currently supported:
- Fujifilm X-T3
- DJI Osmo Action
Executing sd-copy via
sd-copy sort [source path] [output path]
a DCIM folder structure in [source path]
such as
[source_path]
├── DJI_0163.MOV
├── DSCF0226.JPG
├── DSCF0229.MOV
├── DSCF0230.MOV
├── DSCF0231.JPG
├── DSCF0231.RAF
└── DSCF0232.MOV
is copied to [target path]
with the following structure
[target path]
out/
├── 2021-07-08
│ ├── 20210708-173628_x-t3_DSCF0226_6240x4160.jpg
│ ├── 20210708-173906_x-t3_DSCF0229_1080p-24fps.mov
│ ├── 20210708-174010_x-t3_DSCF0230_2160p-59.94fps.mov
│ ├── 20210708-174028_x-t3_DSCF0231_4416x2944.raf
│ ├── 20210708-174028_x-t3_DSCF0231_6240x4160.jpg
│ └── 20210708-174626_x-t3_DSCF0232_1080p-24fps.mov
└── 2021-07-12
└── 20210712-075107_dji-oa_DJI0163_2160p-29.97fps.mov
If you're looking for a general purpose tool for moving photos and videos from an SD card, please consider Damon Lynch's Rapid Photo Downloader. In my case, the bug described here and here initially prevented me from using the tool.
After starting work on this project, I realized that there are problems with the handling of timestamps both in the Fujifilm X-T3 and DJI Osmo Action camera (see concepts). Sd-copy corrects timestamps for media from these cameras where needed. Later, I have added additional features, such as support for timelapses (#22) and utility file operations (#21).
First install exiftool
(exiftool.org). Then, in the root directory of this project
pip install .
to install the tool in your current environment. Add -e
for editable mode1.
For development, install the project using Poetry as usual (poetry install
).
If you need DCIM data for local development or testing, use
git submodule init
to initialize your local configuration file, and
git submodule update
to download the files. Alternatively you can clone this repository with the --recurse-submodules
flag.
Run unit tests with
pytest tests/unit
and integration tests with
pytest tests/integration
Integration tests require the dcim
git submodule.
1: Editable installations now possible with PEP 660. See also See also this discussion, PEP 606 and the discussion here.