CTC-Image-Uploader
This python script gets collection information from a LightRoom database, uploads all the images to flickr, generates bitly short url, and output a pdf. It must be used together with a lightroom database file(lcat) and photos/files organized in the specific pattern.
It is recommanded to keep the current database file(main.db).
Extra configuration can be found in bin/configs.py
Workflow
Most of the following procedures must be executed in commandline. SQLite browser(http://sqlitebrowser.org/) is also required for working with the data.
Install
- Clone the repository into a local directory. Make sure you stay in dev branch
- Install python 2.7.13. Follow the instructions in https://www.cyberciti.biz/faq/install-python-linux/ to install 2.7.13
- Install virtualenv. Follow the instructions in https://virtualenv.pypa.io/en/stable/installation/ Note: you may need to install pip before running the commands
- Start the venv by running
source venv/bin/activate
- Install requirements from requirements.txt. Type
pip install requirements.txt
To add new photos
- Make sure you're in the virtual environment by running
source venv/bin/activate
- Copy the new Lightroom Catalog.lcat to data folder. It is highly recommended to make a backup of the old one each time you do it.
- Copy the new photos to data/images. Note that they should be in folders of their respecitve sets. e.g. Block_01-01_red_Snake, Concept_01-01_Programming, References_01_Breadboard_Noneslideshow. Notice the cases, underscore and noneslideshow surfix.
- Make a copy of the old db file, mainDB.db, and run
python flickr_uploader.py --fetchDB
. If nothing has been rearranged, also use--dont_reorder_sets
flag(?) - Run
python flickr_uploader.py --process
, and wait for finish. The result is intestExtra.txt
(extras) andtestRes.txt
(photos)
To replace existing photos
- Make sure you're in the virtual environment by running
source venv/bin/activate
- Find out the photo_id of the targets, and the set_id of the photo set with SQLite Browser
- Run
python flickr_uploader.py --deletePhoto (photoID)
on individual photo_ids - Run
python flickr_uploader.py --reorderSet (setID)
on the photo set - Run
python flickr_uploader.py --process
To update extra files
- Make sure you're in the virtual environment by running
source venv/bin/activate
- Make changes in the Exel sheets, please refer to the existing Exel files when making changes. If you want to change the structure, more information is available in
bin/configs.py
- Run
python ExelActions.py
To change url shortening provider
- With SQLite browser, open maindb.db
- In Execute SQL tab, write the following commands:
UPDATE sets SET shortlinked = 0
and press run button - Modify
bin/configs.py
, and change the yourls_URL field. - Open commandline, go to the path of flickrUploader.
- Make sure you're in the virtual environment by running
source venv/bin/activate
- Run
python flickr_uploader.py --process