{"id":28526447,"url":"https://github.com/stephbu/photo_organizer","last_synced_at":"2025-06-23T14:38:24.192Z","repository":{"id":32357027,"uuid":"35932887","full_name":"stephbu/photo_organizer","owner":"stephbu","description":"Photo archive folder organization program.","archived":false,"fork":false,"pushed_at":"2018-03-29T06:53:32.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T11:52:35.457Z","etag":null,"topics":["exif","jpeg","nef","nikon","photos","pillow","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephbu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-20T07:29:12.000Z","updated_at":"2021-01-30T19:31:22.000Z","dependencies_parsed_at":"2022-09-11T03:40:57.137Z","dependency_job_id":null,"html_url":"https://github.com/stephbu/photo_organizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephbu/photo_organizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2Fphoto_organizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2Fphoto_organizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2Fphoto_organizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2Fphoto_organizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephbu","download_url":"https://codeload.github.com/stephbu/photo_organizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephbu%2Fphoto_organizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261496006,"owners_count":23167414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exif","jpeg","nef","nikon","photos","pillow","python"],"created_at":"2025-06-09T11:37:19.853Z","updated_at":"2025-06-23T14:38:24.179Z","avatar_url":"https://github.com/stephbu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# photo_organizer\n\nBasic python tools to organize large directories full of NIKON .NEF and JPEG images into folders organized by picture date.\nThe date is extracted from EXIF metadata, in priority order as follows: CreateDate, DateTimeOriginal, ModifyDate tags, then as fallback filesystem created or last-modified attributes.\n\n## How To Use\nFast Start\n- Clone this repository\n- Install dependency libraries Pillow/PIL, datetime, dateutil\n- Run In The \"Work In Progress\" Directory e.g.\n````\npython ./organize.py /users/stephbu/pictures\n````\n- Output directories created as children of current directory\n\nAdvanced\n- TBD\n\n## Intention\nThis code is intend to enable me to quickly manipulate flat folders full of files into a year/month/day encoded set of folders that I can merge into my long term storage.\n\n## Workflow\nI take a lot of photos and sweep them off camera into \"Work in Progress\" folders until I have time to process them at a later date.  It takes less than an hour to generate more photos than you can process in one day.  When I process my photos I move them into date encoded set of folders for long term storage.\n\nMy workflow generates folder structure that look like this:\n```\n  photo_root/\n             work_in_progress/\n                              date1/\n                              date2/\n                              daten/\n             year1/\n                  month1-day1 meaningful label/\n                  month2-day1 meaningful label/\n             yearn/\n                  month-day meaningful label/\n```  \n## NEF EXIF Data\nNikon's NEF format is an extension of the TIFF format. Metadata such as time, camera, lense etc. are encoded into the NEF file as EXIF data structures.  I selected Python Pillow libraries to parse the TIFF EXIF metadata for two reasons:\n\n- Pillow is an active community-maintained EXIF library\n- These tools developed on OS/X\n\nI use Tag #306 DateTimeOriginal to determine the camera source date taken.  This encoded string omits timezone information and is formatted as:\n\n  \u003ccode\u003e\n  YYYY:mm:dd HH:MM:SS\n  \u003c/code\u003e\n  \nWhile developing the code, I discovered that the NEF tags don't appear to encode the Timezone information (Tag #34858 - TimezoneOffset)\neven though the camera is explicitly set for the timezone (determines it's Local TZ).  Workarounds suggested parsing GPS data if it was available.  I've not had a chance to try that out yet, so I ended up with an \nassumption that the NEF data is encoded in Local Timezone format.\n\n## Output Folder Structure\nThe code copies or moves the file without altering the original - for a source structure\n\n```\n  sourcefolder/\n              DSC0001.NEF (taken in 1/1/2014)\n              subfolder1/\n                        DSC0002.NEF (taken in 1/1/2014)\n              subfolder2/\n                        DSC0003.NEF (taken in 31/1/2014)\n```  \n\nThe output would be:\n\n```\n  sourcefolder/\n              2014/\n                  01-01/\n                    DSC0001.NEF\n                    DSC0002.NEF\n                  01-31/\n                    DSC0003.NEF\n``` \n\n\n## External Linkage\nSome useful further reading on the subject\n- EXIF Data http://en.wikipedia.org/wiki/Exchangeable_image_file_format\n- EXIF Tag Spec http://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf\u003cbr/\u003eTag encoding information starts on page 28.\n- Pillow Source https://github.com/python-pillow/Pillow \n- NEF http://www.nikonusa.com/en/Learn-And-Explore/Article/ftlzi4ri/nikon-electronic-format-nef.html\n- NEF File Format Description http://lclevy.free.fr/nef/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephbu%2Fphoto_organizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephbu%2Fphoto_organizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephbu%2Fphoto_organizer/lists"}