{"id":20667119,"url":"https://github.com/thechymera/repositorg","last_synced_at":"2025-04-19T17:07:18.265Z","repository":{"id":21211037,"uuid":"24523922","full_name":"TheChymera/repositorg","owner":"TheChymera","description":"Automatically reposit, organize, rename, and process large collections of files.","archived":false,"fork":false,"pushed_at":"2023-11-17T03:57:40.000Z","size":192,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-29T00:10:06.226Z","etag":null,"topics":["batch-processing","file-management","multimedia","organizer"],"latest_commit_sha":null,"homepage":"","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/TheChymera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-09-27T04:58:07.000Z","updated_at":"2024-04-11T04:34:02.000Z","dependencies_parsed_at":"2023-11-17T05:05:01.893Z","dependency_job_id":null,"html_url":"https://github.com/TheChymera/repositorg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheChymera%2Frepositorg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheChymera%2Frepositorg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheChymera%2Frepositorg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheChymera%2Frepositorg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheChymera","download_url":"https://codeload.github.com/TheChymera/repositorg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224964679,"owners_count":17399434,"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":["batch-processing","file-management","multimedia","organizer"],"created_at":"2024-11-16T19:42:58.684Z","updated_at":"2024-11-16T19:42:59.150Z","avatar_url":"https://github.com/TheChymera.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Repositorg\n[![Build Status](https://travis-ci.com/TheChymera/repositorg.svg?branch=master)](https://travis-ci.com/TheChymera/repositorg)\n\nRepositorg is Python module that lets you automatically reposit, organize, rename, and process large collections of files (e.g. pictures, or video).\n\n## Installation\n\n#### On [Gentoo Linux](http://en.wikipedia.org/wiki/Gentoo_linux) and [Derivatives](http://en.wikipedia.org/wiki/Category:Gentoo_Linux_derivatives):\n\nRepositorg is available for [Portage](http://en.wikipedia.org/wiki/Portage_(software)) via the [chymeric overlay](https://github.com/TheChymera/chymeric) as **app-misc/repositorg**.\nJust run the following command:\n\n```\nemerge app-misc/repositorg\n```\n\n*If you are not yet using this overlay, it can be enabled with just two commands, as seen in [the README](https://github.com/TheChymera/chymeric).*\n\n#### On all other Operating Systems:\n\nFor all other Linux distributions or operating systems, the script can also be run directly from\nits containing directory (and thus, needs only be downloaded from here):\n\n```\ngit clone https://github.com/TheChymera/repositorg.git /your/local/repositorg/path\npip install [--user] -e /your/local/repositorg/path\n```\n\n## Usage\nFunctions from the `repositorg` module can be called from within the module directoy via Python, e.g.  `python -c 'import base; base.reposit()'`.\nAdditionally we provide a base command-line function, `repositorg` via which you can call our most frequently used functions.\n\n#### repositorg\n```\nusage: repositorg [-h] {reposit,reformat,redundant,vidproc} ...\n```\n## Triggers\n\nRepositorg is even better in conjunction with automatic triggers.\nMount or time monitoring functionality is handled out-of-the-box by your Unix-like system, but is best not hacked programmatically\n(especially since there is no way for us to know at what time and what devices you would like to reposit from).\nTherefore, as soon as you have put together a workflow to suit your needs (see examples), this will need a bit of manual configuration on your part.\n\n#### Trigger by UUID Mount\n\nA very useful way to trigger your workflow is automatically upon device insertion.\nFor this you need a unique identifier for your device, of which the best is the Universally Unique Identifier (UUID).\nTo obtain this string, run the following command, and look for the mount point on the output; the UUID will be listed to the right of it, e.g. (here it would be `2016-07-04-02-56-54-00` for the NIKON storage):\n\n```\nyouruser@yhourhost ~ $ findmnt -o TARGET,UUID\nTARGET                            UUID\n/                                 60eacce4-5634-4230-a87c-ff9e8d4a92cc\n├─/dev\n│ ├─/dev/shm\n│ ├─/dev/pts\n│ ├─/dev/mqueue\n│ └─/dev/hugepages\n├─/sys\n│ ├─/sys/fs/cgroup\n│ │ ├─/sys/fs/cgroup/unified\n│ │ ├─/sys/fs/cgroup/systemd\n│ │ ├─/sys/fs/cgroup/cpuset\n│ │ ├─/sys/fs/cgroup/freezer\n│ │ └─/sys/fs/cgroup/cpu,cpuacct\n│ ├─/sys/firmware/efi/efivars\n│ ├─/sys/fs/fuse/connections\n│ └─/sys/kernel/debug\n├─/proc\n│ └─/proc/sys/fs/binfmt_misc\n├─/run\n│ ├─/run/media/chymera/NIKON D750 2016-07-04-02-56-54-00\n│ ├─/run/user/115\n│ └─/run/user/1000\n├─/tmp\n└─/boot                           3E21-D52A\n\n```\n\nAfter having determined the UUID, setting your workflow up to automatically execute is as simple as creating a new executable file under `~/.repositorg/sources/\u003cUUID\u003e.sh` (as seen here).\nTo test the workflow, you can start the UUID trigger script (run `.repositorg/uuid_trigger.sh`), and (re)insert your medium.\nIf you wish your system to always be on the lookout for device insertion, add the following line to your user crontab (start editing the crontab by running `crontab -e`):\n\n```\n@reboot . /etc/profile ; ~/.repositorg/UUID_trigger.sh\n```\n\n## Examples\n\n### One-Liners\n\n```\nrepositorg reformat -l 0 -n 79 -p nd750_ a/*MOV\n\nrepositorg vidproc -p \"-crf 16 -c:a copy\" nd750_a00{00,01,02,03,37,38,39,70,71}.MOV\n\nrepositorg vidproc -p \"-crf 16 -c:a copy -filter:v 'crop=1080:1080:420:0'\" nd750_a00{80..84}.MOV\n\nrepositorg vidproc -p \"-crf 16 -c:a copy -filter:v 'crop=1280:1080:320:0'\" nd750_a00{85,86}.MOV\n```\n\n### Workflows\n\nWorkflows are best stored in files under a dedicated Repositorg directory in the user's home path at `~/.repositorg`, for which we distribute an [example](.repositorg).\nAn [UUID trigger](.repositorg/UUID_trigger.sh) is also provided, which can be called at boot, to monitor for mount events.\nUUIDs-based workflows ([example](.repositorg/sources/UUIDs/EXAMPLE-UUID.sh)) are best stored one directory level deeper.\nWe further provide examples for [SAMBA fetching](.repositorg/sources/example_samba.sh), and client-side [SSH pushing](.repositorg/repositorg_push.sh) (with the associated server-side [post-hook](.repostiorg/sources/example-device_post-hook.sh)).\n\n#### Reposit audio recordings using a continuous namespace with one hierarchical level:\n\nThis assumes that you are starting with `.wav` files produced by your recorder.\n\n```\ncd /run/media/chymera/DEVICE0/recordings_directory/\nrepositorg audioproc *\nrepositorg tag -e mp3 -a \"Horea Christian\" *\nrepositorg reposit --letters 1 --in-regex '^.*\\.(?P\u003cextension\u003e(mp3))$' --out-string '{LETTERS}/s41_{LETTERS}{DIGITS}.{extension!l}' /run/media/chymera/PHONE0/recordings/external\\ recordings/ ~/pu_data/audio/s41/\nrm *mp3\n```\n\n## Known issues\n\n### Command Prompt Broken after `repositorg audioproc` or `repositorg vidproc`\n\nBoth `repositorg audioproc` or `repositorg vidproc` call `ffmpeg` internally.\nWhen this program is parallelized, the command prompt may end up broken after the pool has finished executing.\nThis is likely because some strange character is returned to the terminal.\nThe solution is to type `reset` into the terminal (you may not actually see the test), press Enter and wait or repeat once.\n\n\n---\nProject led by Horea Christian (address correspondence to: horea.christ@yandex.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthechymera%2Frepositorg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthechymera%2Frepositorg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthechymera%2Frepositorg/lists"}