{ "info": { "author": "Martin Matusiak", "author_email": "numerodix@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython" ], "description": "nametrans\n=========\n\n.. image:: https://badge.fury.io/py/nametrans.png\n :target: https://badge.fury.io/py/nametrans\n\n.. image:: https://travis-ci.org/numerodix/nametrans.png?branch=master\n :target: https://travis-ci.org/numerodix/nametrans\n\n.. image:: https://pypip.in/wheel/nametrans/badge.png\n :target: https://pypi.python.org/pypi/nametrans/\n\n.. image:: https://pypip.in/license/nametrans/badge.png\n :target: https://pypi.python.org/pypi/nametrans/\n\n\nPython version support: CPython 2.6, 2.7, 3.2, 3.3, 3.4 and PyPy.\n\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install nametrans\n $ nametrans\n\n\nUsage\n-----\n\n\nSimple substitutions\n^^^^^^^^^^^^^^^^^^^^\n\nThe simplest use is just a straight search and replace. All the files in the\ncurrent directory will be tried to see if they match the search string.\n\n.. code:: bash\n\n $ nametrans.py \"apple\" \"orange\"\n * I like apple.jpg -> I like orange.jpg\n * pineapple.jpg -> pineorange.jpg\n * The best apples.jpg -> The best oranges.jpg\n Rename 3 files? [y/N]\n\n\nIgnore case\n\"\"\"\"\"\"\"\"\"\"\"\n\nMatching against strings with different case is easy.\n\n.. code:: bash\n\n $ nametrans.py -i \"pine\" \"wood\"\n * pineapple.jpg -> woodapple.jpg\n * Pinetree.jpg -> woodtree.jpg\n Rename 3 files? [y/N]\n\n\nLiteral\n\"\"\"\"\"\"\"\n\nThe search string is actually a regular expression. If you use characters that\nhave a special meaning in regular expressions then set the *literal* option and\nit will do a standard search and replace. (If you don't know what regular\nexpressions are, just use this option always and you'll be fine.)\n\n.. code:: bash\n\n $ nametrans.py --lit \"(1)\" \"1\"\n * funny picture (1).jpg -> funny picture 1.jpg\n Rename 1 files? [y/N]\n\n\nRoot\n\"\"\"\"\n\nIf you prefer the spelling \"oranje\" instead of \"orange\" you can replace the G\nwith a J. This will also match the extension \".jpg\", however. So in a case like\nthis set the *root* option to consider only the root of the filename for\nmatching.\n\n.. code:: bash\n\n $ nametrans.py --root \"g\" \"j\"\n * I like orange.jpg -> I like oranje.jpg\n * pineorange.jpg -> pineoranje.jpg\n * The best oranges.jpg -> The best oranjes.jpg\n Rename 3 files? [y/N]\n\n\nHygienic uses\n^^^^^^^^^^^^^\n\nShort of specific cases of transforms, there are some general options that have\nto do with maintaining consistency in filenames that can apply to many\nscenarios.\n\n\nNeat\n\"\"\"\"\n\nThe *neat* option tries to make filenames neater by capitalizing words and\nremoving characters that are typically noise. It also does some simple sanity\nchecks like removing spaces or underscores at the ends of the name.\n\n.. code:: bash\n\n $ nametrans.py --neat\n * _funny___picture_(1).jpg -> Funny - Picture (1).jpg\n * i like apple.jpg -> I Like Apple.jpg\n * i like peach.jpg -> I Like Peach.jpg\n * pineapple.jpg -> Pineapple.jpg\n * the best apples.jpg -> The Best Apples.jpg\n Rename 5 files? [y/N]\n\n\nLower\n\"\"\"\"\"\n\nIf you prefer lowercase, here is the option for you.\n\n.. code:: bash\n\n $ nametrans.py --lower\n * Funny - Picture (1).jpg -> funny - picture (1).jpg\n * I Like Apple.jpg -> i like apple.jpg\n * I Like Peach.JPG -> i like peach.jpg\n * Pineapple.jpg -> pineapple.jpg\n * The Best Apples.jpg -> the best apples.jpg\n Rename 5 files? [y/N]\n\nIf you want the result of neat and then lowercase, just set them both. (If you\nlike underscores instead of spaces, also set ``--under``.)\n\n\nNon-flat uses\n^^^^^^^^^^^^^\n\nAssuming the files are named consistently you can throw them into separate\ndirectories by changing some character into the path separator.\n\n**Note:** On Windows, the path separator is ``\\`` and you may have to write it\nas ``\\\\\\\\``.\n\n.. code:: bash\n\n $ nametrans.py \" - \" \"/\"\n * france - nice - seaside.jpg -> france/nice/seaside.jpg\n * italy - rome.jpg -> italy/rome.jpg\n Rename 2 files? [y/N]\n\nThe inverse operation is to *flatten* the entire directory tree so that all the\nfiles are put in the current directory. The empty directories are removed.\n\n.. code:: bash\n\n $ nametrans.py --flatten\n * france/nice/seaside.jpg -> france - nice - seaside.jpg\n * italy/rome.jpg -> italy - rome.jpg\n Rename 2 files? [y/N]\n\nIn general, the *recursive* option will take all files found recursively and make\nthem available for substitutions. It can be combined with other options to do\nthe same thing recursively as would otherwise happen in a single directory.\n\n.. code:: bash\n\n $ nametrans.py -r --neat \n * france/nice/seaside.jpg -> France/Nice/Seaside.jpg\n * italy/rome.jpg -> Italy/Rome.jpg\n Rename 2 files? [y/N]\n\nIn recursive mode the whole path will be matched against. You can make sure the\nmatching only happens against the file part of the path with ``--files`` or only\nthe directory part with ``--dirs``.\n\n\nSpecial uses\n^^^^^^^^^^^^\n\nDirectory name\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nSometimes filenames carry no useful information and serve only to maintain them\nin a specific order. The typical case is pictures from your camera that have\nmeaningless sequential names, often with gaps in the sequence where you have\ndeleted some pictures that didn't turn out well. In this case you might want to\njust use the name of the directory to rename all the files sequentially.\n\n.. code:: bash\n\n $ nametrans.py -r --dirname \n * rome/DSC00001.jpg -> rome/rome 1.jpg\n * rome/DSC00007.jpg -> rome/rome 2.jpg\n * rome/DSC00037.jpg -> rome/rome 3.jpg\n * rome/DSC00039.jpg -> rome/rome 4.jpg\n Rename 4 files? [y/N]\n\n\nRename sequentially\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nStill in the area of sequential names, at times the numbers have either too few\nleading zeros to be sorted correctly or too many unnecessary zeros. With this\noption you can specify how many leading zeros you want (and if you don't say\nhow many, it will find out on its own).\n\n.. code:: bash\n\n $ nametrans.py -r --renseq 1:3 \n * rome/1.jpg -> rome/001.jpg\n * rome/7.jpg -> rome/007.jpg\n * rome/14.jpg -> rome/014.jpg\n * rome/18.jpg -> rome/018.jpg\n * rome/123.jpg -> rome/123.jpg\n Rename 5 files? [y/N]\n\nThe argument required here means ``field:width``, so in a name like:\n\n series14_angle3_shot045.jpg\n\nthe number ``045`` can be shortened to ``45`` with ``3:2`` (third field from\nthe beginning) or ``-1:2`` (first field from the end).\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/numerodix/nametrans", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "nametrans", "package_url": "https://pypi.org/project/nametrans/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nametrans/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/numerodix/nametrans" }, "release_url": "https://pypi.org/project/nametrans/0.2.4/", "requires_dist": null, "requires_python": null, "summary": "Rename files with regex search/replace semantics", "version": "0.2.4" }, "last_serial": 1132921, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "e6d651b507b63dd270d76ab0e6d06ada", "sha256": "81d2af5a6b86d2849d5fbbd11fb25f3baec3470cf293a24249919ddca92425a5" }, "downloads": -1, "filename": "nametrans-0.2.0-py27-none-any.whl", "has_sig": false, "md5_digest": "e6d651b507b63dd270d76ab0e6d06ada", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11108, "upload_time": "2014-03-18T21:09:40", "url": "https://files.pythonhosted.org/packages/0e/78/1934f0eb77763013780c7dd26d380f7c98b06598c853f90aa31f577482f1/nametrans-0.2.0-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "800e049c20bd195a5df6a3d5a371fe93", "sha256": "47c008bf9fd418ec6c924a69b3e0830aeb592ad4cc154bd8c04a676a7fc240f7" }, "downloads": -1, "filename": "nametrans-0.2.0.tar.gz", "has_sig": false, "md5_digest": "800e049c20bd195a5df6a3d5a371fe93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7385, "upload_time": "2014-03-18T21:09:36", "url": "https://files.pythonhosted.org/packages/0f/cd/37351a4d18871f4f3755d5684e8b55ada7de325ca11b653d893432e65144/nametrans-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f91d4f751a06bb8fc3f13b236156343a", "sha256": "fe8d3db4adf1484bca9f34930aa65042bd20cea652b42893f200ba4824eaa4eb" }, "downloads": -1, "filename": "nametrans-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f91d4f751a06bb8fc3f13b236156343a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11137, "upload_time": "2014-03-18T22:01:21", "url": "https://files.pythonhosted.org/packages/ee/d8/dd87b537c4eb418b2ddaacca2ddb6549150a32361dcb1571c7a45e38a72b/nametrans-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d8d8bf105ee41e9a5d6f71f6750d567", "sha256": "7442627d6305e86b4de7796861e737197343137d9b63cab0ffe9ac20bb2b1f1f" }, "downloads": -1, "filename": "nametrans-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7d8d8bf105ee41e9a5d6f71f6750d567", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7465, "upload_time": "2014-03-18T22:01:18", "url": "https://files.pythonhosted.org/packages/63/db/87d7eb49b1f1466d7bf92fa1f57effb8b5bda632fbf83f8b47f8d927c834/nametrans-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "c35024efc162ff432676f7e9bfcae277", "sha256": "b8d93b3b6b40bbc6dcdb5e159f28449ff0149baa98a7cce16df727703993a02c" }, "downloads": -1, "filename": "nametrans-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c35024efc162ff432676f7e9bfcae277", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11368, "upload_time": "2014-03-18T22:04:23", "url": "https://files.pythonhosted.org/packages/bd/9c/6dcf1b407a8fc6aa2904235fe967b88fa1fb6c65077db044402deb0c065c/nametrans-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "debc710e8b5438532e56ba2d80a0b53a", "sha256": "4632263ed2dc4d19de3ea9aef4e2928f0cd569eb9ad80c11f6f46a4d2a1d3311" }, "downloads": -1, "filename": "nametrans-0.2.2.tar.gz", "has_sig": false, "md5_digest": "debc710e8b5438532e56ba2d80a0b53a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7841, "upload_time": "2014-03-18T22:04:19", "url": "https://files.pythonhosted.org/packages/8b/d2/bfeca4ab1bc19773adefdb75e0e2705aa0949485eefd11e73dd98a6bec64/nametrans-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "efc7f503a933ee5185eb7e03ea727b42", "sha256": "2d83968d1fca7c2a51991ffa24feeded68922cd933994684898b92b03fc48e7d" }, "downloads": -1, "filename": "nametrans-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "efc7f503a933ee5185eb7e03ea727b42", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11366, "upload_time": "2014-03-22T19:02:31", "url": "https://files.pythonhosted.org/packages/ab/2d/d0f6057a439012c8c339661e259b5c7310b4cb3e4acc954d23b5e5a6e1f2/nametrans-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ecf63acba1da93a6815ab23003de5339", "sha256": "b53199417c8db2d63cdfd2eccce4a5c84383c9ea6e3897edcfc4c5372e73c924" }, "downloads": -1, "filename": "nametrans-0.2.3.tar.gz", "has_sig": false, "md5_digest": "ecf63acba1da93a6815ab23003de5339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9790, "upload_time": "2014-03-22T19:02:28", "url": "https://files.pythonhosted.org/packages/2f/de/92d6badf817c79378197084e80675f0c8b2bb1976cd3b0367943bb9233d5/nametrans-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "7002690c3c879f43c7ecc0c04bee4c55", "sha256": "2029457cc0723bfc2423ccf2bdf7a74767c7cd6c7c0f9d2a216436f32c13911f" }, "downloads": -1, "filename": "nametrans-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7002690c3c879f43c7ecc0c04bee4c55", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11372, "upload_time": "2014-06-21T19:31:02", "url": "https://files.pythonhosted.org/packages/38/a1/8545caf51bd4df136f8cd240bc576ff6fc60717242a58ec2e7ce6b3abb53/nametrans-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "320310eebf86c60a11abaa8457259261", "sha256": "f307c640f43ddb2b4d2da3a5187359042c86e2eb8d25aea9f2a3e000e1acf617" }, "downloads": -1, "filename": "nametrans-0.2.4.tar.gz", "has_sig": false, "md5_digest": "320310eebf86c60a11abaa8457259261", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9866, "upload_time": "2014-06-21T19:31:00", "url": "https://files.pythonhosted.org/packages/06/9b/c9f043887d886d17706387cc8508c65751cbfe45acaed5a43e9c6bfd1801/nametrans-0.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7002690c3c879f43c7ecc0c04bee4c55", "sha256": "2029457cc0723bfc2423ccf2bdf7a74767c7cd6c7c0f9d2a216436f32c13911f" }, "downloads": -1, "filename": "nametrans-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7002690c3c879f43c7ecc0c04bee4c55", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11372, "upload_time": "2014-06-21T19:31:02", "url": "https://files.pythonhosted.org/packages/38/a1/8545caf51bd4df136f8cd240bc576ff6fc60717242a58ec2e7ce6b3abb53/nametrans-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "320310eebf86c60a11abaa8457259261", "sha256": "f307c640f43ddb2b4d2da3a5187359042c86e2eb8d25aea9f2a3e000e1acf617" }, "downloads": -1, "filename": "nametrans-0.2.4.tar.gz", "has_sig": false, "md5_digest": "320310eebf86c60a11abaa8457259261", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9866, "upload_time": "2014-06-21T19:31:00", "url": "https://files.pythonhosted.org/packages/06/9b/c9f043887d886d17706387cc8508c65751cbfe45acaed5a43e9c6bfd1801/nametrans-0.2.4.tar.gz" } ] }