smugmug.py -- large scale batch smugmug tool
rutt
Registered Users Posts: 6,511 Major grins
This program allows you to:
I have used to to move more than 50GB of images to smugmug. It maintains more than 800 albums. If I add a new photo or new edit of an old photo to any of these galleries, it finds it and uploads it.
It also enables you to have some defaults that smugmug doesn't. In particular, "show filenames" can be the default mode for new galleries. I like this very much, but Don and Chris thought it was unsuitable as a default. It also allows you to use the filename as a caption. This has the benefit that smugmug searches for the filename will find its associated image.
Quick start:
I don't think I did a very good job of advertising this when I first announced it, and probably I haven't done so this time either. But I wrote this thing because I needed it, and now I love it. If you are a true geek, you will proably love it, too.
- Upload unlimited numbers of images to arbitrary smugmug albums
- Create new smugmug albums with arbitrary properties
- Mirror an arbitrary directory/folder tree in your smugmug account
- Keep smugmug albums up to date as new images are added to local folders mirrored on smugmug.
I have used to to move more than 50GB of images to smugmug. It maintains more than 800 albums. If I add a new photo or new edit of an old photo to any of these galleries, it finds it and uploads it.
It also enables you to have some defaults that smugmug doesn't. In particular, "show filenames" can be the default mode for new galleries. I like this very much, but Don and Chris thought it was unsuitable as a default. It also allows you to use the filename as a caption. This has the benefit that smugmug searches for the filename will find its associated image.
Quick start:
- Install python >= 2.3 if you don't already have it. Macs with panther kept up to date do have this. Linux users will know what to do. Windows isn't really supported yet, but likely works. For windows, visit python.org
- Get smugmug.py
- Do smugmug.py --help for documentation
- Automatic resorting after new photos are added to an album
- Better control over captions and album names
- Ability to change album properties, categories, subcategories
- When albums are created, properties, categories, subcategories are inhereted from parent folders/directories. This allows one to have a tree whose direct branches are categories and then subcategories.
I don't think I did a very good job of advertising this when I first announced it, and probably I haven't done so this time either. But I wrote this thing because I needed it, and now I love it. If you are a true geek, you will proably love it, too.
If not now, when?
0
Comments
Rutt, do you have a "homepage" for this that I can link to so people can see what the latest version is and everything? Right now, I have smugmug linked to the thread, but already the thread has changed, so that's not going to work.
Thanks,
Don
My only question is, when will the new features be added so that it creates new categories/subcategories to mirror the directory tree?
Also, the feature of resorting would be nice. Particularly I would like the ability to sort all of my albums alphabetically as they appear in my directory structure.
I have put a request in for this with SmugMug as well. I am really trying to avoid having to write my own program to manage my photos, since I don't have the time right now. But right now it looks like you are headed in the right direction.
I actually prefer scripts over GUI's. So I will be watching the progress very closely.
Thanks for all your great work!
There is no API for this yet..
We al need to beg Don to add it asap..
Smugmug Explorer can do sorting for you. Auto album creation is still in the works, though - can' figure a nice logical UI for it..
Cheers!
Hi rutt,
wanted to give your script a shot, because I like the syncronizing feature about it, but I can't get it to run. I always get the following error:
Do you have an idea what I've to do to get it working?
Also I would like to know if it's possible to update a modified picture with your script? smugmug doesn't officially support it as far I know.
I want the updating function mainly for the reason to add captions later on in the ITPC part of a file.
So if updating is not possible, what do you think of expanding your script to look at the ITPC-description and update the caption on smugmug according to it?
Thanks for your help.
Bye,
Sebastian
SmugMug Support Hero
Nilolai, help us here. Shouldn't this be set by default? If not, what's the right thing for an application to do to look for a file containing per user initializations?
Rutt,
for what I know, HOME was never a part of default environment settings (unlike PATH or TEMP, for example) in DOS/Windows enviroment.
Here's what you can do:
- check for this variable value and require a user to set it if it's empty - it's a relatively easy thing to do
- Traditionally, windows recommends using registry or (during win16 times) INI files. I'm not a huge fan of storing things in registry, even though it's a "recommended" way. However, I am very much in favor of using old good INI files. They are plain text files named after its "master" with .ini extension (in your case it would be .ini instead of .py) with a very simple structure:
HTH[section1]
key1=value1
key2=value2
...
that any user can modifiy very easily.
However, I'm not sure if you have acess to INI files support from the python environment - don't know anything about python at all:-(, except that it's a nice script language.
Yes, but where do I look for the .ini files if HOME isn't set. That's what I was looking for. For os x and linux HOME tells where to look for this cikd of thing. Is there a convention I can follow on windows?
As you can see, I'm not a unix guru, so I didn't (and still don't:-) know what exactly HOME is..
Well, in this case, probably you simply need to check this variable's value and, if empty, ask your user to quit the program and set it up..
Is there any windows API availalbe for you? Amongst other things, each process has its own current directory, which you can get via winAPI.. Apart from that, the only thing you can rely on is the environment variables (it is my understanding that you can access those, right?)
HTH
If I understand the question (and it sound similar to things you have to do to get cygwin and stuff working properly), you need to set a HOME variable.
You can do that in System Properties -> Advanced -> Environment Variables.
HTH.
Don
Bye,
Sebastian
SmugMug Support Hero
SmugMug Support Hero
Just to let you know that you have an appreciative audience, I will chime in that I have been using the single file upload method from your original script for over a month now on a regular basis. I invoke it within an applescript under Mac OS X. The reason I'm doing it this way is that I can easily control iView Media Pro from applescript as well, and upload files based on the annotations in each file, which are easily accessed through iView Media Pro. Applescript has xml-rpc support built in, but no easy way to perform the required conversion to base64 as a data object, rather than as a string. I am using your script to implement the HTTP POST method, since I can't figure out how to do it on my own. I plan to take a look at your newest version as soon as I have some spare time (which probably won't be for another few weeks) and see how I can make use of the new features. Thanks for your hard work and for posting it.
Not a true geek, as I couldn't figure out what the heck I was supposed to do without a button. How 'bout a little handholding for us wanna-be-geeks?
Dgrin FAQ | Me | Workshops
I clicked on the link to get it, and Safari showed my the text of the program. That's where I quit. I imagine that I could right-click and download linked file as...but then I wouldn't know what to do with that.
Dgrin FAQ | Me | Workshops
I just need to figure out the scope of the hand holding required.
"That's what I was afraid of"... great.
I have used the terminal a bit, but only with step by step instructions. I would never open it and just do something. Most recently I ran plutil to check prefs, but I was just following directions.
Dgrin FAQ | Me | Workshops
I must be doing something wrong. I've got version 1.7 of the tool (although the version variable still says 1.6. :-}
Creating albums seems to work, as does uploading to a specific gallery_id.
But what I can't get to work is automatic uploading upon creation or update. I have a directory structure of ~/photos/2005/2005.04.17-OneYearPartyCake
Should I be running sm_tool.py when I'm inside that directory? It needs to create the SMUGMUG_INFO/ subdir within each gallery, right? (Also, it would've been nice if you made that a dotted directory so it was hidden from normal views, but no biggie.)
At any rate, when I do:
~/sm_tool.py create 2005.04.17-OneYearPartyCake --category=Children *
Nothing gets uploaded. *.JPG doesn't work, nor does IMG_1945.JPG
What's the trick? I also tried it one-level up, specifying the directory name, but no luck. But I don't think that's the right place to run from.
I'm running this on OS X 10.3.8, with Python 2.3 installed.
Thanks!
--Darryl
Just looked at the change notes for the new version. It's because my filenames were .JPG?
Argh.
--Darryl
This was a bug. When deciding what to update (and directory creation is a sort of update) it was case sensitive and only would see .jpg and not .JPG. I've fixed. Grab a new version at http://www.chezrutt.com/rutt/sm_tool/sm_tool.py
Yeah, hope it works now. It's a case sensitive world on unix below the gui layer...