{"id":17059189,"url":"https://github.com/novoid/move2archive","last_synced_at":"2025-10-19T20:12:21.234Z","repository":{"id":8509025,"uuid":"10120305","full_name":"novoid/move2archive","owner":"novoid","description":"Managing event-related files in a folder hierarchy like \"\u003cARCHIVE\u003e/2013/2013-05-17 Event name/\"","archived":false,"fork":false,"pushed_at":"2024-10-23T09:36:03.000Z","size":213,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-09T20:53:58.309Z","etag":null,"topics":["file","files","personal-information-management","pim","shell"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/novoid.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-17T09:35:30.000Z","updated_at":"2024-10-23T09:36:07.000Z","dependencies_parsed_at":"2024-10-23T13:36:53.218Z","dependency_job_id":null,"html_url":"https://github.com/novoid/move2archive","commit_stats":{"total_commits":55,"total_committers":5,"mean_commits":11.0,"dds":"0.18181818181818177","last_synced_commit":"7d82c6089c87c37d34bce1c9ae4a5777a8ec0300"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novoid%2Fmove2archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novoid%2Fmove2archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novoid%2Fmove2archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novoid%2Fmove2archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novoid","download_url":"https://codeload.github.com/novoid/move2archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230438185,"owners_count":18225870,"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":["file","files","personal-information-management","pim","shell"],"created_at":"2024-10-14T10:33:04.365Z","updated_at":"2025-10-19T20:12:16.193Z","avatar_url":"https://github.com/novoid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"* m2a.py\n\nThis script moves items (files or directories) containing ISO datestamps\nlike ~YYYY-MM-DD~ into a directory stucture for the corresponding year.\n\nYou define the base directory either in this script (or using the\ncommand line argument ~--archivedir~). The convention is, e.g.:\n\n#+begin_src bash\n\u003carchivepath\u003e/2011\n\u003carchivepath\u003e/2011/2011-12-20 Meeting Friends at Barleys\n\u003carchivepath\u003e/2011/2011-12-20 Meeting Friends at Barleys/Tom with Beer.jpeg\n#+end_src\n\nThis script extracts the year from the datestamp of each file and\nmoves it into the corresponding directory for its year:\n\n#+begin_src bash\nm2a 2010-01-01_Jan2010.txt 2011-02-02_Feb2011.txt\n#+end_src\n... moves ~2010-01-01_Jan2010.txt~ to ~\u003carchivepath\u003e/2010/~\n... moves ~2011-02-02_Feb2011.txt~ to ~\u003carchivepath\u003e/2011/~\n\nOPTIONALLY: you can define a sub-directory name with option ~-d DIR~. If it\ncontains no datestamp by itself, a datestamp from the first file of the\nargument list will be used. This datestamp will be put in front of the name:\n\n#+begin_src bash\nm2a  -d \"2009-02-15 bar\"  one two three\n#+end_src\n... moves all items to: ~\u003carchivepath\u003e/2009/2009-02-15 bar/~\n\n#+begin_src bash\nm2a  -d bar  2011-10-10_one 2008-01-02_two 2011-10-12_three\n#+end_src\n... moves all items to: ~\u003carchivepath\u003e/2011/2011-10-10 bar/~\n\nIf you feel uncomfortable you can simulate the behavior using the ~--dryrun~\noption. You see what would happen without changing anything at all.\n\nFor the complete usage help, please use the ~--help~ option.\n\n\n- *Target group*: users who are able to use command line tools and who\n  are managing photographs and other event-related files in folder\n  structures.\n- Hosted on github: https://github.com/novoid/move2archive\n\n** Why\n\nThere is no integrated software solution for managing photographs\nthat will (a) provide you all of the features you will ever want, (b)\nbe available for a long period of time, and (c) provide a\nfuture-prove, platform-independent work-flow.\n\nThis is the reason I came up with this method of organizing archive\nfiles (photographs, scanned PDF files, memories, ...) in such a\nfolder structure.\n\n** Installation\n\nGet it from [[https://github.com/novoid/move2archive][GitHub]] or install it via «pip install move2archive».\n\n** Interactive Use\n:PROPERTIES:\n:CREATED:  [2022-01-06 Thu 11:34]\n:END:\n\nIf you are using =m2a= in an interactive way, you need to know the\nfollowing behavior difference when you (1) provide a target directory\nand (2) when no specific target directory is provided by you.\n\nLet's use two example files:\n- =2020-07-13T13.55 xkcd about PIM.png=\n- =2022-01-06 screenshot of my editor.png=\n\nNow let's assume those two files are the only PNG files in the current\ndirectory and the following command line you're using: =m2a *png=\n\nFirst, let's take a look at the version (1) where you select or enter\na target directory to file to.\n\n*** Selecting a Target Directory\n\nWhen asked \"Please enter directory basename:\" in the interactive\nprompt you're entering \"some images\".\n\nThis will result in *both* files moved to the one target directory\nwhere the oldest date-stamp is used to determine the year:\n\n- =\u003carchivepath\u003e/2020/2020-07-13 some images/2020-07-13T13.55 xkcd about PIM.png=. \n- =\u003carchivepath\u003e/2020/2020-07-13 some images/2022-01-06 screenshot of my editor.png=. \n\nThis is because the files are grouped together to be filed to the same\nspot when one single target directory is given.\n\nA handy feature of =m2a= is that it suggest existing folders in the\n=archivepath=. So if you already do have a folder like\n=\u003carchivepath\u003e/2020/2020-07-13 interesting stuff/= and you call =m2a=\nwith any file that starts with =2020-07-13...=, it shows a prompt\nlike:\n\n: One matching target directory found. Enter \"1\" if you want to use it:\n:  [1]  2020-07-13 interesting stuff\n\nIn the case you want to re-use this directory as the target directory\nfor the current files , you simply enter =1= to the prompt and the\nfiles are moved to that directory. Isn't that handy?\n\nNow, let's compare with (2) when no target directory is given in the\nnext section.\n\n*** Not Selecting a Target Directory\n\nThis time, you do not enter anything in the target directory prompt\nand you do not select a proposed target by entering a numeric\nshortcut.\n\nThis will result in each file moved to its corresponding yearly archive directory:\n\n- =\u003carchivepath\u003e/2020/2020-07-13T13.55 xkcd about PIM.png=\n- =\u003carchivepath\u003e/2022/2022-01-06 screenshot of my editor.png=\n\n*** On the Difference of Behavior\n\nThe reasoning behind this different behavior between a specific target\ndirectory is provided and not is that you can use =m2a= to file away a\nlarger group of files to their yearly archive folders without the need\nof filing each one individually or writing a loop command. \n\nHowever, when you do provide one single target directory, this is used\nfor all files, independent of their date-stamp (using the oldest\ndate-stamp).\n\nThis might irritate at first but makes perfectly sense if you think\nabout it or the alternatives.\n\n** Bonus: integrating into Geeqie (or similar file browsers)\n\nI am using [[http://geeqie.sourceforge.net/][geeqie]] for browsing/presenting image files. For quickly\nmoving files to their folders, I mapped this script to ~m~. This way,\nI can go through new image files and move event-related photographs\nvery quickly.\n\nUsing GNU/Linux, this is quite easy accomplished. The only thing that\nis not straight forward is the need for a wrapper script. The wrapper\nscript does provide a shell window for entering the tags.\n\n~vk-m2a-wrapper-with-gnome-terminal.sh~ looks like:\n#+begin_src bash\n#!/bin/sh\n\n/usr/bin/gnome-terminal \\\n    --geometry=157x56+330+5  \\\n    --hide-menubar \\\n    -x /home/vk/bin/m2a --pauseonexit \"${@}\"\n\n#end\n#+end_src\n\nIn ~$HOME/.config/geeqie/applications~ I wrote a desktop file such\nthat geeqie shows the wrapper script as external editor to its\nimage files:\n\n~$HOME/.config/geeqie/applications/m2a.desktop~ looks like:\n#+begin_src bash\n[Desktop Entry]\nName=m2a\nGenericName=m2a\nComment=\nExec=/home/vk/src/misc/vk-m2a-wrapper-with-gnome-terminal.sh %F\nIcon=\nTerminal=true\nType=Application\nCategories=Application;Graphics;\nhidden=false\nMimeType=image/*;video/*;image/mpo;image/thm\nCategories=X-Geeqie;\n#+end_src\n\nIn order to be able to use the keyboard shortcuts ~m~, you can define\nthem in geeqie:\n1. Edit \u003e Preferences \u003e Preferences ... \u003e Keyboard.\n2. Scroll to the bottom of the list.\n3. Double click in the ~KEY~-column of ~m2a~ and choose\n   your desired keyboard shortcut accordingly.\n\nI hope this method is as handy for you as it is for me :-)\n\n* Related tools and workflows\n\nThis tool is part of a tool-set which I use to manage my digital files\nsuch as photographs. My work-flows are described in [[http://karl-voit.at/managing-digital-photographs/][this blog posting]]\nyou might like to read.\n\nIn short:\n\nFor *tagging*, please refer to [[https://github.com/novoid/filetags][filetags]] and its documentation.\n\nSee [[https://github.com/novoid/date2name][date2name]] for easily adding ISO *time-stamps or date-stamps* to\nfiles.\n\nFor *easily naming and tagging* files within file browsers that allow\nintegration of external tools, see [[https://github.com/novoid/appendfilename][appendfilename]] (once more) and\n[[https://github.com/novoid/filetags][filetags]].\n\nMoving to the archive folders is done using [[https://github.com/novoid/move2archive][move2archive]].\n\nHaving tagged photographs gives you many advantages. For example, I\nautomatically [[https://github.com/novoid/set_desktop_background_according_to_season][choose my *desktop background image* according to the\ncurrent season]].\n\nFiles containing an ISO time/date-stamp gets indexed by the\nfilename-module of [[https://github.com/novoid/Memacs][Memacs]].\n\nHere is [[https://glt18-programm.linuxtage.at/events/321.html][a 45 minute talk I gave]] at [[https://glt18.linuxtage.at/][Linuxtage Graz 2018]] presenting the\nidea of and workflows related to appendfilename and other handy tools\nfor file management:\n\n[[https://media.ccc.de/v/GLT18_-_321_-_en_-_g_ap147_004_-_201804281550_-_the_advantages_of_file_name_conventions_and_tagging_-_karl_voit/][bin/2018-05-06 filetags demo slide for video preview with video button -- screenshots.png]]\n\nOther projects with similar features:\n\n- https://github.com/velvet-jones/imgfiler/\n\n* How to Thank Me\n\nI'm glad you like my tools. If you want to support me:\n\n- Send old-fashioned *postcard* per snailmail - I love personal feedback!\n  - see [[http://tinyurl.com/j6w8hyo][my address]]\n- Send feature wishes or improvements as an issue on GitHub\n- Create issues on GitHub for bugs\n- Contribute merge requests for bug fixes\n- Check out my other cool [[https://github.com/novoid][projects on GitHub]]\n\n\n\n* Local Variables                                                  :noexport:\n# Local Variables:\n# mode: auto-fill\n# mode: flyspell\n# eval: (ispell-change-dictionary \"en_US\")\n# End:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovoid%2Fmove2archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovoid%2Fmove2archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovoid%2Fmove2archive/lists"}