____ ____ ___ __ /\ _`\ /\ _`\ /\_ \ __ /\ \ \ \ \L\ \__ __\ \ \L\_\//\ \ /\_\ ___\ \ \/'\ \ \ ,__/\ \/\ \\ \ _\/ \ \ \ \/\ \ /'___\ \ , < \ \ \/\ \ \_\ \\ \ \/ \_\ \_\ \ \/\ \__/\ \ \\`\ \ \_\ \/`____ \\ \_\ /\____\\ \_\ \____\\ \_\ \_\ \/_/ `/___/> \\/_/ \/____/ \/_/\/____/ \/_/\/_/ /\___/ \/__/ My quick hack to get images from my machine to flickr adding some metadata along the way. Usage: ./upload.py -i $HOME/work/flickr/2019/2019AUG/2019AUG11/u/*.jpg -t "bootload 2019 2019AUG 2019AUG11 winter sun blue colde camellia flowers" -d "One cold winter day in August." nb: updated ip for gitolite? try 'git remote set-url origin git@ip.address:pyflick' 2020AUG29 * fired up the upload & it failed. - some half-arsed attempt to start something - commented out 2019NOV03 * CLI argument bug in BUGS - empty description fails 2019OCT26 * ok, install of flickrapi required. - new TODO tasks * sudo pip install flickrapi - lets try again * problems - not working 2019OCT12 * added README, LICENSE, TODO, USAGE * looking for hurdles to move code to new project. - changes made to authentication in: upload.process() upload.process_batch() -now do authentication outside 2019OCT11 * modified upload.py to authenticate once for multiple files - requires refactoring, maybe some testing. 2019OCT01 * changes to command line optional arguments: -h, --help show this help message and exit -i INPUT, --input INPUT input source directory -j, --jpg process only jpg files -d DESCRIPTION, --description DESCRIPTION add a description to the the image -e TITLE, --title TITLE add a title to the the image -t TAGS, --tags TAGS add tags to the the image -v, --version Version information 2019SEP21 * argparse changed from optparse * update -g to -t and change title to something else - difficult to use such a common command unless I can remember it * failure caused by filepaths in tools.py called by upload.py - fixed - improved upload by sorting files before loop allowing files to be uploaded in order. 2019SEP06 * new idea to UPDATE - add images to albums * added USAGE - a sample usage on how I use the app * OH SHITE, only now adding to git! - some files added, some not - document this. * docs - <https://help.github.com/en/articles/adding-a-remote> * UPGRADE add to upload.process - metatag information if tags are not included - could also simply flag an error but I like the idea of code supplying tedious information if I forget. * NEW proposed upgrade to test for the following: - log the directory path and files - this can be used to do a quick check if files are being uploaded - also gives log of what has/has not been added * reasons to do this: - I want a more reliable way to point the tool at a filepath and know the files I point to are uploaded if needed, left if they are already existing * how - there are two immediate ways I can think of: a) log files uploaded and check against this log uploading b) check the unique file ID when uploading against uploaded files this could also be done a number of ways. Download the metadata and do a check against this file OR do it online and wait... - I'll have to think about this because I could use a combination of both ideas. * proposed change ./upload.py -i $HOME/work/flickr/2019/2019AUG/2019AUG11/u/2019AUG1121* -g "bootload 2019 2019AUG 2019AUG11 winter sun blue colde camellia flowers" -d "One cold winter day in August." -j -l - the ^-l^ command logs the file information to a log file with suggested information: date: date uploaded in epoch filepath: yyyy/yyyymmm/yyyymmm/ upload path: u, u1, u0 etc. files: list of files in path - the date uploaded is important because sometimes I upload multiple uploads at different times. - file format should be JSON 2019AUG11 * uploading - note the -i using regex like paths - the description, -d is the same for all - need to work on constants in -g or tags ./upload.py -i $HOME/work/flickr/2019/2019AUG/2019AUG11/u/2019AUG1121* -g "bootload 2019 2019AUG 2019AUG11 winter sun blue colde camellia flowers" -d "One cold winter day in August." -j * added sample_upload.py - <https://stuvel.eu/flickrapi-doc/4-uploading.html> * added CLI input for images to upload * added CLI from ip/ directory * install new repository - <https://github.com/sybrenstuvel/flickrapi> * lets try this again checklist: - documentation - code quality - tests - work? * below documentation found in ip/README * filename generation - a filename is generated from current time and rendered as a string. - each filename is unique + calculate now in UTC as datetime + build filename as string using a format * information on image: * image is selected by image type [jpg,jpeg,gif,png] * an image has a filepath, filename, file extension * image has a list of operations needed to process - resize - rotate - aspect ratio applied - white balance 2016JAN21 * examples <https://bitbucket.org/sybren/flickrapi/src/875f0705db20743580364706a13bba4cb0d60d7e/doc/2-calling.rst?at=default&fileviewer=file-view-default> * using Python FLickr API Kit <https://stuvel.eu/flickrapi> - source <http://pypi.python.org/pypi/flickrapi> * install '$ sudo pip3 install flickrapi' * located at </usr/local/lib/python3.4/dist-packages/> * docs at <https://bitbucket.org/sybren/flickrapi>
peterrenshaw/pyflick
My quick hack to get images from my machine to flickr adding some metadata along the way.
PythonAGPL-3.0