{ "info": { "author": "Sohonet", "author_email": "dev@sohonet.com", "bugtrack_url": null, "classifiers": [], "description": "SizeFS\n======\n\nA mock Filesystem that exists in memory only and allows for the creation of\nfiles of a size specified by the filename.\n\nFor example, reading a file named 128M+1B will return a file of 128 Megabytes\nplus 1 byte, reading a file named 128M-1B will return a file of 128 Megabytes\nminus 1 byte\n\nWithin the filesystem one level of folders may be created. Each of these folders\ncan have its extended attributes set to determine the default contents of each\nfile within the folder. The attributes of individual files may be overridden,\nand, when mounted as a filesystem using fuse, should be set using 'xattr' for\nOS X, or 'attr' for Linux. The attributes are described below in the 'Extended Usage'\nsection.\n\nFiles may only be created within the folders and can only be named with a valid\nsize descriptor. The names of the files should be a number followed by one of the\nletters B, K, M, G, T, P or E (to mean bytes, kilobytes, megabytes ...). Optionally\nan addition or subtraction may be specified to modify the base size of the file.\n\nExamples of valid filenames:\n\n 100K - A 100 kilobyte file.\n 4M - A 4 megabyte file.\n 2G-1B - A file 1 byte smaller than 2 gigabytes.\n 100K+10K - A file 10 kilobytes larger than 100 kilobytes.\n 10E - A ten exabyte file (yes really!)\n\nFile contents are generated as they are read, so it is entirely possible to 'create'\nfiles that are larger than any available RAM or HD storage. This can be very useful\nfor testing large external storage systems, and the +/- operations are useful for\nexploring file size limitations without having to specify a file size as a huge\nnumber of bytes. The contents of each file are specified by a set of regular\nexpressions that are initially inherited from the containing folder.\n\nExample Usage - SizeFS\n----------------------\n\nCreate Size File objects in memory:\n\n from sizefs import SizeFS\n sfs = SizeFS()\n sfs.open('/1B').read()\n sfs.open('/20B').read(20)\n sfs.open('/2K').read(1024)\n sfs.open('/128K').read(1024*128)\n sfs.open('/4G').read(4*1024*1024)\n\nThe folder structure can be used to determine the content of the files:\n\n sfs.open('/zeros/5B').read(5)\n out> 00000\n\n sfs.open('/ones/5B').read(5)\n out> 11111\n\n sfs.open('/alpha_num/5B').read(5)\n out> TMdEv\n\n\nExtended Usage - SizefsFuse\n---------------------------\n\nThe folders 'ones', 'zeros' and 'alpha\\_num' are always present, but new\nfolders can also be created. When files are created in a folder, the\nxattrs of the folder determine that file's content until the file's\nxattrs are updated:\n\n\n from sizefs.sizefsFuse import SizefsFuse\n sfs = SizefsFuse()\n sfs.mkdir('/regex1', None)\n sfs.setxattr('/regex1', 'generator', 'regex', None)\n sfs.setxattr('/regex1', 'filler', 'regex', None)\n print sfs.read('/regex1/5B', 5, 0, None)\n\n out> regex\n\n sfs.setxattr('/regex1/5B', 'filler', 'string', None)\n print sfs.read('/regex1/5B', 5, 0, None)\n\n out> string\n\n sfs.setxattr('/regex1/5B', 'filler', 'a{2}b{2}c', None)\n print sfs.read('/regex1/5B', 5, 0, None)\n\n out> aabbc\n\nFiles can also be added to SizeFS without reading their contents using\nsfs.create():\n\n\n sfs.mkdir('/folder', None)\n sfs.create('/folder/5B', None)\n print sfs.read('/folder/5B', 5, 0, None)\n\n out> 11111\n\nAnd as discussed above, the name of the file determines its size:\n\n\n\n # Try to read more contents than the files contains\n print len(sfs.read('/regex3/128K', 256*1000, 0, None))\n\n out> 128000\n\n # Try to read more contents than the files contains\n print len(sfs.read('/regex3/128K-1B', 256*1000, 0, None))\n\n out> 127999\n\n # Try to read more contents than the files contains\n print len(sfs.read('/alphanum/128K+1B', 256*1000, 0, None))\n\n out> 128001\n\n\nThe 'generator' xattr property defines the file content and can be set to one\nof:\n\n ones - files are filled with ones\n zeros - files are filled with zeros\n alpha_num - files are filled with alpha numeric characters\n regex - files are filled according to a collection of regular expression patterns\n\nWe can set up to 5 properties to control the regular expression patterns:\n\n prefix - defined pattern for the start of a file (default = \"\")\n suffix - defined pattern for the end of a file (default = \"\")\n filler - repeating pattern to fill file content (default = 0)\n padder - single character to fill between content and footer (default = 0)\n max_random - the largest number a + or * will resolve to\n\nWhere 'prefix', 'suffix', 'filler', and 'padder' conform to the following\ngrammar:\n\n ::= \n\n ::= \n | \n\n ::= []\n | \"(\" \")\" []\n | \"[\" \"]\" []\n\n ::= \"*\"\n | \"+\"\n | \"?\"\n | '{' '}'\n\n ::= \n | \"-\" \n | \n\nIf the requested file sizes are too small for the combination of header, footer\nand some padding, then a warning will be logged, but the file will still\nreturn as much content as possible to fill the exact file size requested.\n\nThe file contents will always match the following pattern:\n\n ^prefix(filler)*(padder)*suffix$\n\nThe generator will always produce a string containing the prefix and suffix if a\nfile of sufficient size is requested. Following that, the generator will fill\nthe remaining space with 'filler' generated as many times as can be contained.\nIf a filler pattern is generated that does not fit within the remaining space\nthe remainder is filled using the (possibly incomplete) padder pattern. The\npadder pattern will only be used if a complete filler pattern will not fit in\nthe space remaining.\n\n'max_random' is used to define the largest random repeat factor of any + or *\noperators.\n\nRandom seeks within a file may produce inconsistent results for general file\ncontents, however prefix and suffix will always be consistent with the requested\npattern.\n\nTesting\n------------------------\n\nSingle test run requires pytest\n\nFrom the command line:\n\n pytest\n\nFull test run requires tox\n\nFrom the command line:\n\n tox\n\nMounting as a filesystem\n------------------------\n\nMac Mounting - http://osxfuse.github.com/\n\n Usage:\n sizefs.py [--debug] \n sizefs.py --version\n\n Options:\n --debug Debug\n -h --help Show this screen.\n --version Show version.\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sohonetlabs/sizefs", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/SizeFS/", "keywords": "testing", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "SizeFS", "package_url": "https://pypi.org/project/SizeFS/", "platform": "", "project_url": "https://pypi.org/project/SizeFS/", "project_urls": { "Download": "https://github.com/sohonetlabs/sizefs", "Homepage": "http://pypi.python.org/pypi/SizeFS/" }, "release_url": "https://pypi.org/project/SizeFS/0.4.0/", "requires_dist": null, "requires_python": "", "summary": "SizeFS is a mock filesystem for creating files of particular sizes with specified contents.", "version": "0.4.0" }, "last_serial": 3147072, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "9f266e907e7292b208935f8a8829043d", "sha256": "3bcabfea216f8bf12c7a850ffd0be90d91aa162fbcf74cd353eca3f252cc3703" }, "downloads": -1, "filename": "SizeFS-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9f266e907e7292b208935f8a8829043d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8436, "upload_time": "2013-10-13T15:04:58", "url": "https://files.pythonhosted.org/packages/38/e5/412b1a704835216dd9aacc9871217a623be9cea91a82a2decea24a154412/SizeFS-0.2.0.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "1b709253e0af27e703d81e7b2cddcac7", "sha256": "3e963868ac8dfe354285fb0f5e7d7beb4f655857058c1b96c1eb9697d4a23e74" }, "downloads": -1, "filename": "SizeFS-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1b709253e0af27e703d81e7b2cddcac7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81775, "upload_time": "2013-11-30T12:15:09", "url": "https://files.pythonhosted.org/packages/3d/4f/e08f4ba1da17e4cc498b79e8cdc2ce7d1e1b6b73aff683de4cfc58e49273/SizeFS-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "f7cf606c30a7ea5ac4f62a3bbb79f2a1", "sha256": "aab849f0e4683611a8abf125eaa584cccceb59dd794c16b7efce95c67effb24e" }, "downloads": -1, "filename": "SizeFS-0.2.4.tar.gz", "has_sig": false, "md5_digest": "f7cf606c30a7ea5ac4f62a3bbb79f2a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12618, "upload_time": "2013-11-30T13:04:48", "url": "https://files.pythonhosted.org/packages/5f/69/63fab7c024174937edf202afb6654601b1c2d95b220c9c4796caee472e00/SizeFS-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "533a1b505bd496bfc5298d631c44293c", "sha256": "b58488696ab76a8db4a99f6744b3f18651404c9fe45a4dd5bd8c2b702ff6ec60" }, "downloads": -1, "filename": "SizeFS-0.2.5.tar.gz", "has_sig": false, "md5_digest": "533a1b505bd496bfc5298d631c44293c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12679, "upload_time": "2014-02-08T21:59:13", "url": "https://files.pythonhosted.org/packages/22/9d/d4179483272fa7e02b30710920152c01f00373b02fc07fcdc07793ed7062/SizeFS-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "2c24b735b9749f927fc06b6c1d572e91", "sha256": "1ab5e8b4d0173a82f3062069e8c1a5b6b40c4dfb1d72e3b634d650ff2562cb73" }, "downloads": -1, "filename": "SizeFS-0.2.6.tar.gz", "has_sig": false, "md5_digest": "2c24b735b9749f927fc06b6c1d572e91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12657, "upload_time": "2014-02-08T22:17:39", "url": "https://files.pythonhosted.org/packages/4c/bc/51be982001cac6bcae44bbbaa680401f8d0663624ded0d460510ef3b0e9c/SizeFS-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "9a8382c9ef3c317fb8a1b1db0b997afd", "sha256": "9f9da7dbbf4bf0193da897c30aeeee2fbd82cfb1d8bc11b05f75d7b7aa05ee45" }, "downloads": -1, "filename": "SizeFS-0.2.7.tar.gz", "has_sig": false, "md5_digest": "9a8382c9ef3c317fb8a1b1db0b997afd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19401, "upload_time": "2014-03-22T15:47:44", "url": "https://files.pythonhosted.org/packages/fa/ef/729f171838c5da54e040a9543bc4f670b9aa6f9b34b48155c5235d4a6fcb/SizeFS-0.2.7.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "36a1ce76bdb986f3006281699b04395c", "sha256": "ddb6455a12d371c714e03b78094fbb426d402dcf0004db6642dbe9780a051f87" }, "downloads": -1, "filename": "SizeFS-0.3.0.tar.gz", "has_sig": false, "md5_digest": "36a1ce76bdb986f3006281699b04395c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19661, "upload_time": "2014-03-28T09:14:52", "url": "https://files.pythonhosted.org/packages/63/4f/dbca789e50002edc9d2b7a5ae5b2ed14a65ebbff82ba3dbbb2f3f080b91d/SizeFS-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "df403a3a2d36557798c98ab2b6f47696", "sha256": "157dc8f8fece7045217f3e6c8ff86851af6603276ff7904ac251ee4414f236e7" }, "downloads": -1, "filename": "SizeFS-0.3.1.tar.gz", "has_sig": false, "md5_digest": "df403a3a2d36557798c98ab2b6f47696", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19643, "upload_time": "2016-12-16T18:06:16", "url": "https://files.pythonhosted.org/packages/36/44/096664a59d1452b021c324ea110b58ba6ec69b5968d0cb0a387bbd8bb04a/SizeFS-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "ad9ac9ed20b20bbf08ae0d8567adbf17", "sha256": "4667f33917ed023209442da3fbae298d231f855db2395026f9a3c3723ba9ad02" }, "downloads": -1, "filename": "SizeFS-0.4.0.tar.gz", "has_sig": false, "md5_digest": "ad9ac9ed20b20bbf08ae0d8567adbf17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21165, "upload_time": "2017-09-04T08:55:53", "url": "https://files.pythonhosted.org/packages/2a/43/501885335a12e92435b6e185431a3aa034c4a200ce11fc96b8434aa58325/SizeFS-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ad9ac9ed20b20bbf08ae0d8567adbf17", "sha256": "4667f33917ed023209442da3fbae298d231f855db2395026f9a3c3723ba9ad02" }, "downloads": -1, "filename": "SizeFS-0.4.0.tar.gz", "has_sig": false, "md5_digest": "ad9ac9ed20b20bbf08ae0d8567adbf17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21165, "upload_time": "2017-09-04T08:55:53", "url": "https://files.pythonhosted.org/packages/2a/43/501885335a12e92435b6e185431a3aa034c4a200ce11fc96b8434aa58325/SizeFS-0.4.0.tar.gz" } ] }