new exercise and files

This commit is contained in:
waldek 2021-06-03 20:47:37 +02:00
parent 7b61997ebb
commit 9996859a37
3 changed files with 18 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@ Can you sort the following picture collections for me please?
I don't really care what ordering system you use but thousands of files in one directory is **not** practical.
There are four different folders with files to sort and each one is a **separate** assignment so at the end I expect **four** folders with **sorted** files (and subdirectories).
The files are archived and can me downloaded [here](./assets/files.tar).
The files are archived and can me downloaded [here](./assets/files.tar.gz).
I advise you to keep a copy of the archive so you can run your scripts multiple times until you achieve a desirable outcome.
## The batches
@ -25,7 +25,7 @@ The choice is yours.
### Messy filenames
The third batch is very messy and has not only multiple cameras and formats but also multiple date structures.
This one will require some hefty debugging!
This one will require some hefty debugging to parse the datetime strings!
### Recovery files
@ -36,6 +36,22 @@ Installing will be done via `pip3` which comes with Pycharm.
Have a look at this [library](https://github.com/TNThieding/exif) and figure out how to use it.
It might be handy to install `imagemagick` via `sudo apt install imagemagick`.
This gives you the ability to inspect metadata on the Linux command line via `identify -verbose BJtpWU7n7WCeOL2B84Vz.jpg`.
I left the file extension on purpose to make it a bit easier but in the last exercise you'll have to live without so maybe try not relying on the extension to prepare yourself.
### Music metadata
This batch is similar to the previous batch but instead of photo's it's a bunch of mp3's.
As with photo's mp3's have metadata in them do help with sorting in programs like iTunes.
There are multiple libraries out there to read and write these tags with Python3 but none come installed by default.
I can recommend [eyed3](https://eyed3.readthedocs.io/en/latest/) to parse the metadata.
Here it makes little sense to sort via date so maybe sort by `$ARTIST/$ALBUM`.
As an added bonus you could rename the mp3's by their track number instead of the cryptic string the have.
### Mixed filetypes
This one is very tricky.
It's a mix of photo's and mp3's and the extensions are missing!
You'll have to figure out how to determine the filetype before reading the metadata *or* have a deep dive into `try except` statements in Python3.
## Some hints and tips