{ "info": { "author": "Mohammad Alghafli", "author_email": "thebsom@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.1" ], "description": ":Date: 2018-10-10\n:Version: 0.0.1\n:Authors:\n - Mohammad Alghafli \n\nFile slice is a part of a file. This library allows you to open a binary file\nand see only part of it. You specify the start and end of the file part you want\nto see. Read and write operations will always start at the specified start\nposition and will never exceed the specified end position. Here is an example of\nhow to use it::\n \n from fileslice import Slicer\n \n #let's open a file for reading\n r = open('example.png', 'br')\n \n #create a slicer for the file\n slicer = Slicer(r)\n \n #the slicer behaves like a function. call it to create as many fileslices\n #as you want\n start = 5 #the beginning of our partial file is at 5\n size = 95 #the size of the part is 95 bytes so our end is 99\n fileslice = slicer (start, size) #this is a file like object\n \n #now we have a fileslice file from byte 5 to byte 99.\n #the initial partial file seek position is 0.\n print(fileslice.read()) #will print from byte 5 to 99.\n \n #now our seek position is at the end of the fileslice file\n #that is byte 100 of the full file\n try:\n #if we seek to a position out of the fileslice file range (from 0 to 95)\n fileslice.seek(200)\n except ValueError:\n #an exception will be thrown\n print('error while seeking to 200')\n \n #we can seek from the end of the fileslice or from current fileslice\n #seek position\n #let's seek to fifth byte from the end of the file. that is byte 95\n fileslice.seek(-5, 2)\n\nThis library also works in writable files. Multiple threads can be used to read\nand write to different file slices from the same file. Just make sure you do not\nuse the original opened file or the fileslices (and the original file object)\nwill be confused.\n\n --------\n Tutorial\n --------\n Check out fileslice tutorial at http://fileslice.readthedocs.io/", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alghafli/fileslice", "keywords": "file,slice,region,part", "license": "", "maintainer": "", "maintainer_email": "", "name": "fileslice", "package_url": "https://pypi.org/project/fileslice/", "platform": "", "project_url": "https://pypi.org/project/fileslice/", "project_urls": { "Homepage": "https://github.com/alghafli/fileslice" }, "release_url": "https://pypi.org/project/fileslice/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "File slice is a part of a file. This library allows you to open a binary file and see only part of it.", "version": "0.0.1" }, "last_serial": 4361106, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6c51b0801f9f9717175200f7b172745f", "sha256": "d470cc4f8feee66f12b9cf0fd4e656cd7ca72077b2e4c3c0f672751cbdd92bcd" }, "downloads": -1, "filename": "fileslice-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6c51b0801f9f9717175200f7b172745f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7654, "upload_time": "2018-10-10T18:27:55", "url": "https://files.pythonhosted.org/packages/2b/34/6c900ee5eba39fb38e95e78a71f797017e05794a4b634d6225015c2822c8/fileslice-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6c51b0801f9f9717175200f7b172745f", "sha256": "d470cc4f8feee66f12b9cf0fd4e656cd7ca72077b2e4c3c0f672751cbdd92bcd" }, "downloads": -1, "filename": "fileslice-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6c51b0801f9f9717175200f7b172745f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7654, "upload_time": "2018-10-10T18:27:55", "url": "https://files.pythonhosted.org/packages/2b/34/6c900ee5eba39fb38e95e78a71f797017e05794a4b634d6225015c2822c8/fileslice-0.0.1.tar.gz" } ] }