{ "info": { "author": "Christopher Brown", "author_email": "io@henrian.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: System :: Filesystems", "Topic :: Text Processing :: General" ], "description": "File sequences\n--------------\n\nA ``FileSequence`` allows you to write to multiple files using standard\nPython file descriptor read / write functionality.\n\nYou specify the file size limit and naming scheme when opening the\nsequence, but the library handles creating new files as needed.\n\nEach call to the opened FileSequence's ``write`` function will\npotentially create a new file, if the chunk you want to write will push\nthe file over the limit. So if you want to only split files on newlines,\ncall ``write()`` once for each line. If you want behavior more like\nBSD's ``split`` command, you can write one byte at a time. Though, at\nthat rate, ``split`` is probably the better choice.\n\nInstallation |PyPI version|\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n pip install filesequence\n\nAPI\n~~~\n\nYou can simply use a FileSequence object as if it were a file.\n\n- ``filesequence.open(...)`` returns a ``FileSequence`` object.\n- ``my_file_sequence.write(line)`` takes a line and writes it to the\n next available file.\n\nNote that FileSequence requires ``with`` wrapping, as opposed to the\nPython built-in ``open()``:\n\n::\n\n import filesequence\n\n filenames = filesequence.interpolator('numbers-%02d.txt', xrange(1000))\n\n with filesequence.open(filenames, 1000000) as out:\n for a in xrange(1000):\n for b in xrange(1000):\n out.write('# %d * %d = %d\\n' % (a, b, a * b))\n\nNow you have a huge multiplication table in 20 different files that are\n1MB or less! So awesome!\n\nWant to keep going?\n\n::\n\n filenames = filesequence.interpolator('numbers-%02d.txt', xrange(1000))\n\n with filesequence.open(filenames, 1000000, 'a') as out:\n ...\n\nThe 'a' flag will make the sequence jump to the last existing file, and\nstart writing from there.\n\nBonus\n~~~~~\n\nA ``filesequence`` script will be installed to your ``PATH``. This\nscript reads STDIN line by line and command line arguments for the\nfilename ``pattern`` and filesize limit (see ``filesequence --help``),\nand writes out a series of files of at most that filesize and without\nbreaking any lines.\n\n::\n\n $ filesequence --help\n\n usage: cli.py [-h] [--limit LIMIT] [--pattern PATTERN] [--version]\n\n Write STDIN into a sequence of files, splitting only at newlines\n\n optional arguments:\n -h, --help show this help message and exit\n --limit LIMIT Maximum bytes per file (default: 50000000)\n --pattern PATTERN Filename string pattern: generate filenames in sequence\n by interpolating `pattern % indices.next()`\n (default: split.%02d)\n --version show program's version number and exit\n\nTODO\n----\n\n- Support reading (flags ``r`` and ``r+``).\n\nDevelopment\n-----------\n\nThis package is published to PyPI at\n`pypi.python.org/pypi/filesequence `__.\n\nTypical publish process:\n\n1. ``pandoc README.md -o README.rst``\n2. If needed, ``git commit ...``\n3. ``npm version patch``\n4. ``git push``\n5. ``python setup.py register sdist upload``\n\nTesting\n~~~~~~~\n\nContinuous integration:\n\n|Travis CI Build Status|\n\nOr run tests locally (after installing):\n\n::\n\n nosetests\n\nLicense\n-------\n\nCopyright (c) 2013 Christopher Brown. `MIT\nLicensed `__.\n\n.. |PyPI version| image:: https://badge.fury.io/py/filesequence.png\n :target: http://badge.fury.io/py/filesequence\n.. |Travis CI Build Status| image:: https://travis-ci.org/chbrown/filesequence.png?branch=master\n :target: https://travis-ci.org/chbrown/filesequence", "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/chbrown/filesequence", "keywords": null, "license": "Copyright (c) 2013 Christopher Brown\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "filesequence", "package_url": "https://pypi.org/project/filesequence/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/filesequence/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/chbrown/filesequence" }, "release_url": "https://pypi.org/project/filesequence/0.1.12/", "requires_dist": null, "requires_python": null, "summary": "Write to an indexed sequence of files using the standard Python file API", "version": "0.1.12" }, "last_serial": 971325, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "d40161de6c9c354f906d1cebfce3c1c0", "sha256": "eb96a178c1d3d2f8cef66d3d91b6e1811bc606f99be5085c83ca5fdfda22203d" }, "downloads": -1, "filename": "filesequence-0.1.10.tar.gz", "has_sig": false, "md5_digest": "d40161de6c9c354f906d1cebfce3c1c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6002, "upload_time": "2013-08-26T01:06:42", "url": "https://files.pythonhosted.org/packages/d4/ff/049a0b1fb18265b6a85726e3a689167097a6fb023912965494ca02d49886/filesequence-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "dc18507b0a5f84142707b0bb50bccd74", "sha256": "6cc59e36e85e66054fdb46e211df2ed2ac9f3bf4f2a4d9bf1ccf825cb5f82239" }, "downloads": -1, "filename": "filesequence-0.1.11.tar.gz", "has_sig": false, "md5_digest": "dc18507b0a5f84142707b0bb50bccd74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6160, "upload_time": "2013-09-13T13:46:34", "url": "https://files.pythonhosted.org/packages/26/d9/0a1bf8f572f94c23ba5dab8014b5839ecee7c57780e3be22ac60f7038a63/filesequence-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "8635b7b388002eb2c97745e0ecb79577", "sha256": "03615195414bee5cf225375939589de8e52307d2733bfa1a4a3095cbe67c34d9" }, "downloads": -1, "filename": "filesequence-0.1.12.tar.gz", "has_sig": false, "md5_digest": "8635b7b388002eb2c97745e0ecb79577", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6396, "upload_time": "2013-09-14T22:16:15", "url": "https://files.pythonhosted.org/packages/1f/2e/edafc6893b1e9d13d2f342d00df2c98f15338351ae0f83e60409154e1dcd/filesequence-0.1.12.tar.gz" } ], "0.1.2": [], "0.1.3": [], "0.1.4": [], "0.1.5": [ { "comment_text": "", "digests": { "md5": "127297f055c896aa79cff02b63fa31a4", "sha256": "3b41fba78623769960bd580e4f7d2234898fbb0d81fd3a70cd3148fb597abce6" }, "downloads": -1, "filename": "filesequence-0.1.5.tar.gz", "has_sig": false, "md5_digest": "127297f055c896aa79cff02b63fa31a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5840, "upload_time": "2013-08-16T01:17:57", "url": "https://files.pythonhosted.org/packages/ec/50/c13c3997b33429daf191152619a7131741b7ff33b0ed9d15c0a896616d9e/filesequence-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "fac5dc58f31ac1a4aae628a458f106e4", "sha256": "e4200126edbca9a8e5f9b786e1577d6675189b2bd146686cf9c131a525d962cb" }, "downloads": -1, "filename": "filesequence-0.1.6.tar.gz", "has_sig": false, "md5_digest": "fac5dc58f31ac1a4aae628a458f106e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6026, "upload_time": "2013-08-16T01:25:23", "url": "https://files.pythonhosted.org/packages/37/00/941f8c519f64db5e35cc09c2a6864ef3f0c565d5e335de49d94129fb9ddb/filesequence-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "01b1fe07dd74f2d1f09beda0df721f75", "sha256": "d454ccac8941c3322eabcd7e40d2dbb036ab0602af137d08a36901921e7725fd" }, "downloads": -1, "filename": "filesequence-0.1.7.tar.gz", "has_sig": false, "md5_digest": "01b1fe07dd74f2d1f09beda0df721f75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5755, "upload_time": "2013-08-16T15:40:44", "url": "https://files.pythonhosted.org/packages/25/f0/701dcc5f9f1baca5f4f6aa238aaacc142f6fbd4aeb54c594f4c448509842/filesequence-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "f7f10ec1eeea80e2219653eaafb54222", "sha256": "377d05090e9c2f36a9bf478c367b8762b8a39aa02d3d84e2b155747c0b6ced63" }, "downloads": -1, "filename": "filesequence-0.1.8.tar.gz", "has_sig": false, "md5_digest": "f7f10ec1eeea80e2219653eaafb54222", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5957, "upload_time": "2013-08-16T19:50:52", "url": "https://files.pythonhosted.org/packages/de/ff/9a01fe5835c1f1a2643357abc0492ad8fd670e4c73630b6598d5957ad820/filesequence-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "6271b142d6c2db1249d428ff8f122775", "sha256": "27cb9f8ad62dcd16c1d9eb54e04023b0cba2e41e220348d9bb6255866616358b" }, "downloads": -1, "filename": "filesequence-0.1.9.tar.gz", "has_sig": false, "md5_digest": "6271b142d6c2db1249d428ff8f122775", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5973, "upload_time": "2013-08-16T20:02:42", "url": "https://files.pythonhosted.org/packages/68/c9/5672ce9c2e8a06590f3a23145de04fad522aa0ae76a768ead7293c176166/filesequence-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8635b7b388002eb2c97745e0ecb79577", "sha256": "03615195414bee5cf225375939589de8e52307d2733bfa1a4a3095cbe67c34d9" }, "downloads": -1, "filename": "filesequence-0.1.12.tar.gz", "has_sig": false, "md5_digest": "8635b7b388002eb2c97745e0ecb79577", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6396, "upload_time": "2013-09-14T22:16:15", "url": "https://files.pythonhosted.org/packages/1f/2e/edafc6893b1e9d13d2f342d00df2c98f15338351ae0f83e60409154e1dcd/filesequence-0.1.12.tar.gz" } ] }