{ "info": { "author": "Geoff Harvey", "author_email": "hoafaloaf@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing" ], "description": "==================================================\r\nseqparse: A nifty way to list your file sequences.\r\n==================================================\r\n\r\n|Pypi Package| |Build Status| |Coverage Status| |Code Health| |License|\r\n\r\nOverview\r\n--------\r\n\r\nThe seqparse module may be used to ...\r\n\r\n- Scan specified paths for file sequences and \"singletons,\"\r\n- Construct frame and file sequence from supplied values, and\r\n- Query disk for overall footprint of tracked files.\r\n\r\nThe module also comes supplied with a simple tool named ``seqls`` that\r\nallows the user to scan multiple locations for file sequences and\r\nsingletons from the command line.\r\n\r\nIf you're curious about the **regular expressions** used to determine\r\nwhat is and isn't a valid file sequence, take a look at the\r\n``seqparse.regex`` module.\r\n\r\nFrame Sequences\r\n~~~~~~~~~~~~~~~\r\n\r\nFrame sequences are broken down into comma-separated chunks of the\r\nformat ``first frame`` **-** ``last frame`` **x** ``step`` where the following\r\nrules apply:\r\n\r\n- Frame numbers can be zero-padded,\r\n- Frame step (increment) is always a positive integer,\r\n- The number of digits in a frame may exceed the padding of a sequence,\r\n eg ``001,010,100,1000``,\r\n- Frame chunks with a specified step will **always** consist of three\r\n or more frames.\r\n\r\nExamples of proper frame sequences:\r\n\r\n- Non-padded sequence, frames == **(1, 3, 5, 7)**: ``1-7x2``\r\n- Four-padded sequence, frames == **(1, 3, 5, 7)**: ``0001-0007x2``\r\n- Three-padded sequence, frames == **(11, 13)**: ``011,013``\r\n- Two-padded sequence **(1, 3, 5, 7, 11, 13, 102)**:\r\n ``01-07x2,11,13,102``\r\n\r\nFile Sequences\r\n~~~~~~~~~~~~~~\r\n\r\nMembers of a file sequence can be one of two formats:\r\n\r\n- ``base_name``\\ **.**\\ ``frame_sequence``.\\ ``file_extension``\r\n- ``frame_sequence``.\\ ``file_extension``\r\n\r\nExamples of valid file sequences:\r\n\r\n- ``my_little_pony.1-7x2.exr``\r\n- ``/maya/is/very/strange/01-07x2,11,13,102.tif``\r\n- ``C:\\this\\even\\works\\in\\windows\\billy.0001-0095.tga``\r\n\r\nseqls\r\n-----\r\n\r\n``seqls`` is the command line interface for the ``seqparse`` module.\r\n\r\n::\r\n\r\n usage: seqls [-h] [-a] [-H] [-l] [--maxdepth MAX_LEVELS]\r\n [--mindepth MIN_LEVELS] [-m] [-S]\r\n [search_path [search_path ...]]\r\n\r\n Command line tool for listing file sequences. Upon installation of the\r\n package this script will be accessable via ``seqls`` command on the command\r\n line of your choice.\r\n\r\n positional arguments:\r\n search_path Paths that you'd like to search for file sequences.\r\n\r\n optional arguments:\r\n -h, --help show this help message and exit\r\n -a, --all Do not ignore entries starting with '.'.\r\n -H, --human-readable with -l/--long, print sizes in human readable\r\n format (e.g., 1K 234M 2G).\r\n -l, --long Use a long listing format.\r\n --maxdepth MAX_LEVELS\r\n Descend at most levels (a non-negative integer)\r\n MAX_LEVELS of directories below the\r\n starting-points. '--maxdepth 0' means scan the\r\n starting-points themselves.\r\n --mindepth MIN_LEVELS\r\n Do not scan at levels less than MIN_LEVELS (a non-\r\n negative integer). '--mindepth 1' means scan all\r\n levels except the starting-points.\r\n -m, --missing Whether to invert output file sequences to only\r\n report the missing frames.\r\n -S, --seqs-only Whether to filter out all non-sequence files.\r\n -v, --version Print the version and exit.\r\n\r\nMost of the functionality is self-explanatory, but the ``-m/--missing``\r\noption is probably the most useful to users generating large sequences\r\nof frames on multiple servers.\r\n\r\nSay you're creating imagery for the latest superhero movie -- and your\r\nrender job crashed some time in the early morning.\r\n\r\nYou're expecting to see something like this ...\r\n\r\n::\r\n\r\n superhero_cape_v0001.0001-1000.exr\r\n\r\n... but not everything rendered.\r\n\r\n::\r\n\r\n $ cd /renders/superhero_cape_v0001\r\n $ seqls\r\n superhero_cape_v0001.0001-0500,0600-0800,0990-1000x5.exr\r\n\r\nYou can easily figure out the missing frames, though, with the\r\n``--missing`` option:\r\n\r\n::\r\n\r\n $ seqls --missing\r\n superhero_cape_v0001.0501-0599,0801,0991-0994,0996-0999.exr\r\n\r\nThe module\r\n----------\r\n\r\nUsing the module is fairly simple:\r\n\r\n1. Instantiate a parser (``Seqparse`` instance).\r\n2. Add files to the parser either\r\n\r\n - via the ``add_file`` method, or\r\n - by scanning a list of locations on disk via the ``scan_path``\r\n method.\r\n\r\n3. Create an **iterator** for all file sequences (``FileSequence``\r\n instances) and singletons (``File`` instances).\r\n4. ...\r\n5. Profit.\r\n\r\nExample (taken from the ``Seqparse`` docstring):\r\n\r\n::\r\n\r\n With the following file structure ...\r\n\r\n test_dir/\r\n TEST_DIR.0001.tif\r\n TEST_DIR.0002.tif\r\n TEST_DIR.0003.tif\r\n TEST_DIR.0004.tif\r\n TEST_DIR.0010.tif\r\n SINGLETON.jpg\r\n\r\n >>> from seqparse.seqparse import Seqparse\r\n >>> parser = Seqparse()\r\n >>> parser.scan_path(\"test_dir\")\r\n >>> for item in parser.output():\r\n ... print(str(item))\r\n ...\r\n test_dir/TEST_DIR.0001-0004,0010.tif\r\n test_dir/SINGLETON.jpg\r\n >>> for item in parser.output(seqs_only=True):\r\n ... print(str(item))\r\n ...\r\n test_dir/TEST_DIR.0001-0004,0010.tif\r\n >>> for item in parser.output(missing=True):\r\n ... print(str(item))\r\n ...\r\n test_dir/TEST_DIR.0005-0009.tif\r\n\r\nUseful Classes\r\n~~~~~~~~~~~~~~\r\n\r\n``FrameSequence`` instances are pretty useful on their own.\r\n\r\n::\r\n\r\n >>> from seqparse import get_sequence\r\n >>> seq = get_sequence([1, 2, 3, 4, 8])\r\n >>> print(repr(seq))\r\n FrameSequence(pad=4, frames=set([1, 2, 3, 4, 8]))\r\n >>> print(seq)\r\n 0001-0005,0008\r\n >>> for frame in seq:\r\n ... print(frame)\r\n ...\r\n 0001\r\n 0002\r\n 0003\r\n 0004\r\n 0010\r\n >>> for frame in seq.invert():\r\n ... print(frame)\r\n ...\r\n 0005\r\n 0006\r\n 0007\r\n\r\nAs are ``FileSequence`` instances (which behave similarly; check class\r\ndocumentation for details).\r\n\r\nFinal Notes\r\n-----------\r\n\r\nI'm moderately happy with this code -- but there's **always** room for\r\nimprovement (and new/exciting features).\r\n\r\nLemme know if you have any requests/complaints/suggestions!\r\n\r\n.. |Build Status| image:: https://travis-ci.org/hoafaloaf/seqparse.svg?branch=master\r\n :target: https://travis-ci.org/hoafaloaf/seqparse\r\n.. |Coverage Status| image:: https://coveralls.io/repos/github/hoafaloaf/seqparse/badge.svg\r\n :target: https://coveralls.io/github/hoafaloaf/seqparse\r\n.. |Code Health| image:: https://landscape.io/github/hoafaloaf/seqparse/master/landscape.svg?style=flat\r\n :target: https://landscape.io/github/hoafaloaf/seqparse\r\n.. |License| image:: https://img.shields.io/github/license/mashape/apistatus.svg\r\n.. |PyPi Package| image:: https://badge.fury.io/py/seqparse.svg\r\n :target: https://badge.fury.io/py/seqparse\r\n\r\n\r\n", "description_content_type": null, "docs_url": "https://pythonhosted.org/seqparse/", "download_url": "https://github.com/hoafaloaf/seqparse/archive/v0.7.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/hoafaloaf/seqparse", "keywords": "command-line,file,sequence", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "seqparse", "package_url": "https://pypi.org/project/seqparse/", "platform": "", "project_url": "https://pypi.org/project/seqparse/", "project_urls": { "Download": "https://github.com/hoafaloaf/seqparse/archive/v0.7.3.tar.gz", "Homepage": "http://github.com/hoafaloaf/seqparse" }, "release_url": "https://pypi.org/project/seqparse/0.7.3/", "requires_dist": [ "future", "humanize", "six", "scandir (>=1.1); python_version < '3.5'" ], "requires_python": "", "summary": "A nifty way to parse your file sequences.", "version": "0.7.3" }, "last_serial": 3402822, "releases": { "0.6.4": [ { "comment_text": "", "digests": { "md5": "df8bdaf951a2eb63dc7bf3ff6757acd6", "sha256": "abf02c323ce11f0f48c0283c061ea7bdc173eca7a825b1d6d37353733a75edf7" }, "downloads": -1, "filename": "seqparse-0.6.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "df8bdaf951a2eb63dc7bf3ff6757acd6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27078, "upload_time": "2017-04-08T23:30:05", "url": "https://files.pythonhosted.org/packages/76/57/0aa6213ce9c9cf1a71328853772d7295a3486bc9a044d02191c29348d75f/seqparse-0.6.4-py2.py3-none-any.whl" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "133272eac6df3a619951622cf8d7af39", "sha256": "80038cfe5d0a5641ddc87072fb069e9cebdb7fc788c41c4477967ce9c1fc65b0" }, "downloads": -1, "filename": "seqparse-0.7.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "133272eac6df3a619951622cf8d7af39", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27735, "upload_time": "2017-04-28T18:22:44", "url": "https://files.pythonhosted.org/packages/39/49/04c0c2c7cf8a505b1fa86a4551f0a24d05713411bdb994217470d00dec70/seqparse-0.7.0-py2.py3-none-any.whl" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "3818042fc7c3fc84e42893406e5bb5c9", "sha256": "65ca6d553f79c68214cced492866d17665f9a07c058019f1fd2169ed02fd6379" }, "downloads": -1, "filename": "seqparse-0.7.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3818042fc7c3fc84e42893406e5bb5c9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27662, "upload_time": "2017-12-09T04:29:36", "url": "https://files.pythonhosted.org/packages/d2/38/e06e25b7f00f3a511676172a875421b8caddf660df88d218717a72f9720b/seqparse-0.7.2-py2.py3-none-any.whl" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "5f612bc09ea6c3d4a9ceb6a939d224cc", "sha256": "b78acbbfd39d51e7c3bdcc5a4d6fb78657e27911acff83987162412052d9efed" }, "downloads": -1, "filename": "seqparse-0.7.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5f612bc09ea6c3d4a9ceb6a939d224cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27794, "upload_time": "2017-12-09T04:30:04", "url": "https://files.pythonhosted.org/packages/9c/c5/0425e475c32966ba36b1289d41ac61cd6042c2eb78b4a75e718d61beda94/seqparse-0.7.3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5f612bc09ea6c3d4a9ceb6a939d224cc", "sha256": "b78acbbfd39d51e7c3bdcc5a4d6fb78657e27911acff83987162412052d9efed" }, "downloads": -1, "filename": "seqparse-0.7.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5f612bc09ea6c3d4a9ceb6a939d224cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27794, "upload_time": "2017-12-09T04:30:04", "url": "https://files.pythonhosted.org/packages/9c/c5/0425e475c32966ba36b1289d41ac61cd6042c2eb78b4a75e718d61beda94/seqparse-0.7.3-py2.py3-none-any.whl" } ] }