{"id":18376801,"url":"https://github.com/serene-arc/numincrement","last_synced_at":"2025-10-20T04:32:24.510Z","repository":{"id":115511648,"uuid":"340027094","full_name":"Serene-Arc/numincrement","owner":"Serene-Arc","description":"CLI tool for incrementing numbers in filenames","archived":false,"fork":false,"pushed_at":"2021-02-19T02:09:37.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T06:49:16.987Z","etag":null,"topics":["cli","command-line","command-line-tool","filename","filenames-change","increment","number"],"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/Serene-Arc.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-18T11:21:01.000Z","updated_at":"2021-02-19T02:09:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"13767bd0-0511-4e49-899c-c88022eecb30","html_url":"https://github.com/Serene-Arc/numincrement","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Serene-Arc/numincrement","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serene-Arc%2Fnumincrement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serene-Arc%2Fnumincrement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serene-Arc%2Fnumincrement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serene-Arc%2Fnumincrement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Serene-Arc","download_url":"https://codeload.github.com/Serene-Arc/numincrement/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serene-Arc%2Fnumincrement/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260890031,"owners_count":23077857,"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":["cli","command-line","command-line-tool","filename","filenames-change","increment","number"],"created_at":"2024-11-06T00:24:49.679Z","updated_at":"2025-10-20T04:32:24.423Z","avatar_url":"https://github.com/Serene-Arc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numincrement\n\nThis is a simple tool to increment numbers in a filename or sequence of file names. \n\nThe program can be run with `python3 -m numincrement` or the shorter `numincrement` commands.\n\nAdditionally, the format of the supplied numbers will be preserved. For example, 001 will be incremented to 002, not simply 2. This is also the case for decimal numbers\n\n## Arguments and Options\n\nThe following arguments and options are available for the program:\n\n  - `expression` is the regex expression; see [here](#regex-expression)\n  - `files` are the files to be incremented; at least one file must be supplied\n  - `-i, --increment` is the number to increment numbers by; the flag can be supplied without a value in which case the increment number will be 1. The supplied number can be negative or positive\n  - `-d, --decrement` is the number to decrement numbers by; the flag without a value will assume a default of -1. This flag can only be negative\n  - `-n, --no-act` will print the proposed changes but not actually move any files\n  - `-v, --verbose` will increase the verbosity of the output; can be supplied multiple times\n\n### Regex Expression\n\nThe regex expression for the tool is in Python regex format, and must contain at least one capture group. This capture group must be the number to be incremented. For example:\n\n  - `^(\\d+)` will increment the number found at the beginning of a filename\n  - `page_(\\d+)` will increment the number found after the string `page_` in the filename\n  - `doc_(\\d+)_page_(\\d+)` will increment both of the captured numbers, after the `doc_` and `page_` strings\n  - `doc_\\d+_page_(\\d+)` will only increment the second number, after the string `page_`\n\n## Example Commands\n\nThe following commands showcase the use of the tool:\n\n  - `numincrement -i 1 '^(\\d+)' *.txt`\n  - `numincrement -i -1 'image_(\\d+)' *.png`\n\nIn the case of the last example, the files would be renamed in the following manner:\n  - `image_01.png` -\u003e `image_00.png`\n  - `image_02.png` -\u003e `image_01.png`\n  - `image_03.png` -\u003e `image_02.png`\n\n### Decimal Increments\n\nThe tool can handle incrementing decimal numbers, or applying decimals to a number in the filename. For example, an increment of `-i 0.5` on a file named `image_1.png` will result in a file named `image_1.5.png`.\n\nThe decimal increment will also preserve formatting as much as possible. For example, a decimal represented as `01.000` and incremented by 0.5 will retain the same number of digits, becoming `01.500`. However, the increment will add the necessary digits required to represent the number, so `1.0` incremented by `0.01` will become `1.01`.\n\nWhen incrementing a decimal already in a name, note that the decimal point must be included in the capture group, as the `\\d` regex group does not include it. For the capture for the above example, `image_([\\d.]+)` would be required in order to properly increment the filename. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserene-arc%2Fnumincrement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserene-arc%2Fnumincrement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserene-arc%2Fnumincrement/lists"}