{ "info": { "author": "Joshua Richardson (contact on github)", "author_email": "joshuarbox-junk1@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "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 :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries" ], "description": "Dumper.py\n=========\n\nCode to dump out any Python object to text in a way that aids debugging /\nuseful logging.\n\n Dump Python data structures (including class instances) in a nicely-\n nested, easy-to-read form. Handles recursive data structures properly,\n and has sensible options for limiting the extent of the dump both by\n simple depth and by some rules for how to handle contained instances.\n\n Copyright (c) 2009 Python Software Foundation\n Copyright (c) 2014 Joshua Richardson, Chegg Inc.\n\n Dumping is generally accessed through the 'dump()' function:\n\n dump (any_python_object)\n\n and is controlled by setting module-level global variables:\n\n import dumper\n\n dumper.max_depth = 10 # default is 5\n dumper.dump (really_deep_object)\n\n 'dump()' is nearly equivalent to 'print' with backquotes for\n non-aggregate values (ie. anything *except* lists, tuples, dictionaries,\n and class instances). That is, strings, integers, floats, and other\n numeric types are printed out \"as-is\", and funkier things like class\n objects, function objects, and type objects are also dumped using their\n traditional Python string representation. For example:\n\n >>> dump (\"Hello\" + \"world\")\n 'Helloworld'\n >>> class Foo: pass\n >>> dump (Foo)\n \n\n 'dump()' is slightly more interesting than 'print' for \"short\" lists,\n tuples, and dictionaries. (Lists and tuples are \"short\" when they have\n no more than 10 elements and all elements are strings or numbers;\n dictionaries are short when they have no more than 5 key/value pairs and\n all keys and values are strings or numbers.)\n\n For \"short\" lists and tuples, you get the 'id()' of the object and its\n contents on one line:\n\n >>> dump (['foo', 3])\n ['foo', 3]\n >>> dump ((3+4j, 'blah', 2L**50))\n ((3+4j), 'blah', 1125899906842624L)\n\n \"Short\" dictionaries are similar:\n\n >>> d = {'foo': 5, 'bar': 3, 'bonk': 4-3j}\n >>> dump (d)\n {'foo': 5, 'bonk': (4-3j), 'bar': 3}\n\n 'dump()' is considerably more interesting than 'print' for lists,\n tuples, and dictionaries that include more complex objects or are longer\n than the 10-element/5-pair limit. A long but simple list:\n\n >>> f = open ('/usr/dict/words')\n >>> dump (f.readlines())\n \n 0: '10th\\012'\n 1: '1st\\012'\n 2: '2nd\\012'\n ...\n 25138: 'zounds\\012'\n 25139: \"z's\\012\"\n 25140: 'zucchini\\012'\n 25141: 'Zurich\\012'\n 25142: 'zygote\\012'\n\n (Ellipsis added: 'dump()' just dumps the whole thing.) Nested lists\n also get multiline formatting, no matter how short and simple:\n\n >>> dump (['nested', ['list']])\n \n 0: 'nested'\n 1: ['list']\n\n Note that since the inner list is \"short\" it is formatted on one line.\n Deeply nested lists and tuples are more fun:\n\n >>> l = [\"top\", ('tuple', 'depth', 1), \n ... \"top again\", [\"level 1\", [\"level\", 2, ('deep', 'tuple')]]]\n >>> dump (l)\n \n 0: 'top'\n 1: ('tuple', 'depth', 1)\n 2: 'top again'\n 3: \n 0: 'level 1'\n 1: \n 0: 'level'\n 1: 2\n 2: ('deep', 'tuple')\n\n Obviously, this is very handy for debugging complicated data structures.\n Recursive data structures are not a problem:\n\n >>> l = [1, 2, 3]\n >>> l.append (l)\n >>> dump (l)\n \n 0: 1\n 1: 2\n 2: 3\n 3: : already seen\n\n which is bulkier, but somewhat more informative than \"[1, 2, 3, [...]]\".\n\n Dictionaries with aggregate keys or values also get multiline displays:\n\n >>> dump ({(1,0): 'keys', (0,1): 'fun'})\n \n (0, 1): 'fun'\n (1, 0): 'keys'\n\n Note that when dictionaries are dumped in multiline format, they are\n sorted by key. In single-line format, 'dump()' just uses 'repr()', so\n \"short\" dictionaries come out in hash order. Also, no matter how\n complicated dictionary *keys* are, they come out all on one line before\n the colon. (Using deeply nested dictionary keys requires a special kind\n of madness, though, so you probably know what you're doing if you're\n into that.) Dictionary *values* are treated much like list/tuple\n elements (one line if short, indented multiline display if not).\n\n 'dump()' is *much* more interesting than 'print' for class instances.\n Simple example:\n\n >>> class Foo:\n ... def __init__ (self):\n ... self.a = 37; self.b = None; self.c = self\n ... \n >>> f = Foo ()\n >>> dump (f)\n \n a: 37\n b: None\n c: : already seen\n\n A more interesting example using a contained instance and more recursion:\n\n >>> g = Foo ()\n >>> g.a = 42; g.b = [3, 5, 6, f]\n >>> dump (g)\n \n a: 42\n b: \n 0: 3\n 1: 5\n 2: 6\n 3: \n a: 37\n b: None\n c: : already seen\n c: : already seen\n\n Dumping a large instance that contains several other large instance gets\n out of control pretty quickly. 'dump()' has a couple of options to help\n you get a handle on this; normally, these are set by assigning to module\n globals, but there's a nicer OO way of doing it if you like. For\n example, if you don't want 'dump()' to descend more than 3 levels into\n your nested data structure:\n\n >>> import dumper\n >>> dumper.max_depth = 3\n >>> dumper.dump ([0, [1, [2, [3, [4]]]]])\n \n 0: 0\n 1: \n 0: 1\n 1: \n 0: 2\n 1: : suppressed (too deep)\n\n But note that max_depth does not apply to \"short\" lists (or tuples or\n dictionaries):\n\n >>> dumper.dump ([0, [1, [2, [3, '3b', '3c']]]])\n \n 0: 0\n 1: \n 0: 1\n 1: \n 0: 2\n 1: [3, '3b', '3c']\n\n Since \"short\" lists (etc.) can't contain other aggregate objects, this\n only bends the \"max_depth\" limit by one level, though, and it doesn't\n increase the amount of output (but it does increase the amount of useful\n information in the dump).\n\n 'max_depth' is a pretty blunt tool, though; as soon as you set it to N,\n you'll find a structure of depth N+1 that you want to see all of. And\n anyways, dumps usually get out of control as a result of dumping large\n contained class instances: hence, the more useful control is to tell\n 'dump()' when to dump contained instances.\n\n The default is to dump contained instances when the two classes (that of\n the parent and that of the child) are from the same module. This\n applies to classes defined in the main module or an interactive session\n as well, hence:\n\n >>> class Foo: pass\n >>> class Bar: pass\n >>> f = Foo() ; b = Bar ()\n >>> f.b = b\n >>> f.a = 37\n >>> b.a = 42\n >>> dumper.dump (f)\n \n a: 37\n b: \n a: 42\n\n Note that we have dumped f.b, the contained instance of Bar. We can\n control dumping of contained instances using the 'instance_dump' global;\n for example, to completely disable dumping contained instances, set it\n to 'none':\n\n >>> dumper.instance_dump = 'none'\n >>> dumper.dump (f)\n \n a: 37\n b: : suppressed (contained instance)\n\n This is the most restrictive mode for contained instance dumping. The\n default mode is 'module', meaning that 'dump()' will only dump contained\n instances if both classes (parent and child) were defined in the same\n module. If the two classes were defined in different modules, e.g.\n\n >>> from foo import Foo\n >>> from bar import Bar\n >>> f = Foo () ; f.a = 42 \n >>> b = Bar () ; b.s = \"hello\"\n >>> f.child = b\n\n then dumping the container ('f') results in something like\n\n >>> dumper.dump (f)\n \n a: 42\n child: : suppressed (contained instance from different module)\n\n Of course, you can always explicitly dump the contained instance:\n\n >>> dumper.dump (f.child)\n \n s: 'hello'\n\n The next most permissive level is to dump contained instances as long as\n their respective classes were defined in the same package. Continuing\n the above example:\n\n >>> dumper.instance_dump = 'package'\n >>> dumper.dump (f)\n \n a: 42\n child: \n s: 'hello'\n\n But if the Foo and Bar classes had come from modules in different\n packages, then dumping 'f' would look like:\n\n >>> dumper.dump (f)\n \n a: 42\n child: : suppressed (contained instance from different package)\n\n Only if you set 'instance_dump' to its most permissive setting, 'all',\n will 'dump()' dump contained instances of classes in completely\n different packages:\n\n >>> dumper.instance_dump = 'all'\n >>> dumper.dump (f)\n \n a: 42\n child: \n s: 'hello'\n\n===\n\nCHANGELOG:\n\n1.2.0: Added multi-argument support in dumps()\n1.1.0: Added more supported versions of python and a test framework.\n1.0.4: Fixed problem in Python 2 when using io.StringIO with dumper.\n1.0.3: Fixed problems in Python 3 related to trying to use decode as member of str.\n1.0.2: Include README.md and MANIFEST.in in the distribution.\n1.0.1: Include the package in the distribution.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jric/Dumper.py", "keywords": "development", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Dumper", "package_url": "https://pypi.org/project/Dumper/", "platform": "", "project_url": "https://pypi.org/project/Dumper/", "project_urls": { "Homepage": "https://github.com/jric/Dumper.py" }, "release_url": "https://pypi.org/project/Dumper/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Tool to conveniently describe any Python datastructure", "version": "1.2.0" }, "last_serial": 4780378, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f7be526bd68964f287de22d92eee569d", "sha256": "94a78903079db11f148272999ded22c7b991781f9ad6e3eca1f57ce24d70dd18" }, "downloads": -1, "filename": "Dumper-1.0.0-cp27-none-macosx_10_8_intel.whl", "has_sig": false, "md5_digest": "f7be526bd68964f287de22d92eee569d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8898, "upload_time": "2014-06-18T01:20:48", "url": "https://files.pythonhosted.org/packages/27/46/7f08fcb14cf620ba6e9a3feb19ea977ec40a50d57a84571eead6d7c7fa76/Dumper-1.0.0-cp27-none-macosx_10_8_intel.whl" }, { "comment_text": "", "digests": { "md5": "5abf2bedeb45b173200172f13a8585e5", "sha256": "c17fa8b305110527a7d52b9f78be629e13dc43807fd3f66578fdfdaf2e744fd6" }, "downloads": -1, "filename": "Dumper-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5abf2bedeb45b173200172f13a8585e5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16257, "upload_time": "2014-07-16T01:59:25", "url": "https://files.pythonhosted.org/packages/57/73/f1f3c732556076b34792b6940180a63c54521381a6070e79a0b3ba0a571e/Dumper-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ceca0656690e25d10989d01e720e81ae", "sha256": "a037aefe2360df35a3f204b4c36ddd0cce6c5580d2606447313ea9a666609555" }, "downloads": -1, "filename": "Dumper-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ceca0656690e25d10989d01e720e81ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5766, "upload_time": "2014-06-18T01:20:46", "url": "https://files.pythonhosted.org/packages/b8/ca/d0aa751a972eab8a68aa76698197c67c3b6d6d12807a5760cec45d080546/Dumper-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f5d49e87ffe3d57c7133e9179e64d0f2", "sha256": "4014311dee3b20a42c8ebed5512d72b94e933d89dd66584030cb3bd20637c8e3" }, "downloads": -1, "filename": "Dumper-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f5d49e87ffe3d57c7133e9179e64d0f2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16339, "upload_time": "2014-07-16T02:01:38", "url": "https://files.pythonhosted.org/packages/d9/22/c67b5df7dbe1bb5a4da68a7065e32c51b08a7ca9d3e345548bc043ab2ade/Dumper-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "568089be840c3ec764715de845298905", "sha256": "f4416fa0666e33f3f849dd977b044ed7151e9b995612fd3e8a76165f674d5538" }, "downloads": -1, "filename": "Dumper-1.0.1.tar.gz", "has_sig": false, "md5_digest": "568089be840c3ec764715de845298905", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10820, "upload_time": "2014-07-16T02:01:35", "url": "https://files.pythonhosted.org/packages/7c/6c/26f227c2d2f4d243c86b304fd0fcbc688c32ac4615be716c1b55328ec677/Dumper-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "51aa1c055ca894290d9c88729e89212e", "sha256": "1a0d37005716f453db142ca56da5362f8b69230e4d362712cfe15a281e0e0c15" }, "downloads": -1, "filename": "Dumper-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "51aa1c055ca894290d9c88729e89212e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16394, "upload_time": "2014-07-16T20:35:26", "url": "https://files.pythonhosted.org/packages/d1/30/082dd5b8b78a0549c64d058e79475b2b3a9f1efe41412fb7844fefe53edc/Dumper-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17a519431fa78c73a974e32ffe34c9a8", "sha256": "588659874d49441c0563803bafed7ead84fa9074b2fdefa486f28bcfae577e95" }, "downloads": -1, "filename": "Dumper-1.0.2.tar.gz", "has_sig": false, "md5_digest": "17a519431fa78c73a974e32ffe34c9a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11758, "upload_time": "2014-07-16T20:35:24", "url": "https://files.pythonhosted.org/packages/a8/aa/23521abc8daf1332aebf120d25f6924f5076afb663f5d0bdac6ccb0af225/Dumper-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "276e4700c3724985b5ea62c4d53b01f5", "sha256": "7c6623f24a892116ad5c2d845c3b714a4ef017a31e48fcfd535affd83f79b2b6" }, "downloads": -1, "filename": "Dumper-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "276e4700c3724985b5ea62c4d53b01f5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16588, "upload_time": "2014-09-17T23:42:33", "url": "https://files.pythonhosted.org/packages/99/5f/7c5fdf737534dacf780da62b17ab58918ecce459ba97ebf90ff13a4059a5/Dumper-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "361ba4e9e23556f9d034e2de30633765", "sha256": "1f655d949eb8696c7254452a288e61632a33aafcd5f014d9b619cf1832ae63c3" }, "downloads": -1, "filename": "Dumper-1.0.3.tar.gz", "has_sig": false, "md5_digest": "361ba4e9e23556f9d034e2de30633765", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11894, "upload_time": "2014-09-17T23:42:30", "url": "https://files.pythonhosted.org/packages/eb/73/b29eb42227e49708a6ffdaa55ffff81b50b87ccda910436a6a5ac71aa277/Dumper-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "287c13ec5fd7bd1e6d4b48c68460bbea", "sha256": "d118a285d9066052bc6dc6b140e1a6d0735e6c8d63d08ac5eaf058283ee07164" }, "downloads": -1, "filename": "Dumper-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "287c13ec5fd7bd1e6d4b48c68460bbea", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16663, "upload_time": "2014-09-19T22:53:33", "url": "https://files.pythonhosted.org/packages/5a/ab/949e60f93b73f720a26aac3b30c0acd638176e2759cfd7456efa601635ea/Dumper-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91af7da4e1b319fe4c639bc7f72b1795", "sha256": "2629c27b66707c6767b126b7fd17d2a0d78e0c1850adf16faf5ecdba12512389" }, "downloads": -1, "filename": "Dumper-1.0.4.tar.gz", "has_sig": false, "md5_digest": "91af7da4e1b319fe4c639bc7f72b1795", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11935, "upload_time": "2014-09-19T22:53:31", "url": "https://files.pythonhosted.org/packages/fa/fe/274331b2177c5115d2bbcd7e0246c4436b5fb553bfb6d44fb0deefb2d6df/Dumper-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "0d5d761f888a68382e602d51c17e626b", "sha256": "daea310a2645b82e5756472f7e38bdbe3c235cdde32e09309601ac07411d694d" }, "downloads": -1, "filename": "Dumper-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d5d761f888a68382e602d51c17e626b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13261, "upload_time": "2018-12-14T22:57:30", "url": "https://files.pythonhosted.org/packages/1b/21/f04d1641ccd38697c4a5b194cbedfbb096135e8cb81bcf6959e36b9da8ea/Dumper-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "18405aebce12402f3cf1190f56ee5001", "sha256": "46f203d59e0c30d71cbe9b160433d77fabf68bd1c2d94246aae8f104c4a708cc" }, "downloads": -1, "filename": "Dumper-1.1.0.tar.gz", "has_sig": false, "md5_digest": "18405aebce12402f3cf1190f56ee5001", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11865, "upload_time": "2018-12-14T22:57:32", "url": "https://files.pythonhosted.org/packages/05/7e/f001c116214ef1b969ccd4524f4a79080179e9ff2d4e589e658b492819b4/Dumper-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "98638ac20600150eb8f70f3da1203bd1", "sha256": "eeea825dbe84f9869478b3bcd9f1b47d8f0e71cee41d129c73ecec3e20a6d47c" }, "downloads": -1, "filename": "Dumper-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "98638ac20600150eb8f70f3da1203bd1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13303, "upload_time": "2019-02-05T02:09:32", "url": "https://files.pythonhosted.org/packages/54/74/99188ad91edbdf45db3b95a3fe648fa5d61e340beef13bc119a06b6033e8/Dumper-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f998029d42091ac29aceb2dd2f1a74aa", "sha256": "36a0e517138626691b3c9c3baa0577b49c3eba07620bf6ee0437def9715b5c89" }, "downloads": -1, "filename": "Dumper-1.2.0.tar.gz", "has_sig": false, "md5_digest": "f998029d42091ac29aceb2dd2f1a74aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11915, "upload_time": "2019-02-05T02:09:34", "url": "https://files.pythonhosted.org/packages/4e/0c/2b5a4e34eda55856a7adeb4e11f768d2beb190b7c2abafc3aac13dc816c9/Dumper-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "98638ac20600150eb8f70f3da1203bd1", "sha256": "eeea825dbe84f9869478b3bcd9f1b47d8f0e71cee41d129c73ecec3e20a6d47c" }, "downloads": -1, "filename": "Dumper-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "98638ac20600150eb8f70f3da1203bd1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13303, "upload_time": "2019-02-05T02:09:32", "url": "https://files.pythonhosted.org/packages/54/74/99188ad91edbdf45db3b95a3fe648fa5d61e340beef13bc119a06b6033e8/Dumper-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f998029d42091ac29aceb2dd2f1a74aa", "sha256": "36a0e517138626691b3c9c3baa0577b49c3eba07620bf6ee0437def9715b5c89" }, "downloads": -1, "filename": "Dumper-1.2.0.tar.gz", "has_sig": false, "md5_digest": "f998029d42091ac29aceb2dd2f1a74aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11915, "upload_time": "2019-02-05T02:09:34", "url": "https://files.pythonhosted.org/packages/4e/0c/2b5a4e34eda55856a7adeb4e11f768d2beb190b7c2abafc3aac13dc816c9/Dumper-1.2.0.tar.gz" } ] }