@@ -0,0 +1,963 @@
+import couchdb%0Aimport glob %0Aimport os%0A%0Acouch = couchdb.Server('http://127.0.0.1:5984')%0A%0Adb = couch%5B'paullaroid'%5D%0A%0A%0Aevents_gen = glob.iglob(os.path.join('data','*')) #it's a%0A%0Afor event in events_gen:%0A    doc = %7B '_id' : os.path.basename(event), 'type_doc':'event'%7D%0A%0A    db.save(doc)%0A    pict_gen = glob.iglob(os.path.join(event,'*.jpg'))%0A    for pict in pict_gen: %0A        picture = %7B '_id' : os.path.basename(pict), 'type_doc':'image',%0A                    'datetime': ' '.join(os.path.basename(pict).split('_')%5B:-1%5D) %7D%0A%0A        db.save(picture)%0A        with open(pict, 'rb') as current_pict_full:%0A            db.put_attachment(picture, current_pict_full, filename='full',%0A                              content_type='image/jpeg')%0A              %0A%0A        with open(pict+'.thumbnail', 'rb') as current_pict_thumb:%0A            db.put_attachment(picture, current_pict_thumb, filename='thumb',%0A                              content_type='image/jpeg')%0A              %0A%0A%0A%0A

add script to populate couchdb with data