Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | :mod:`pprint` --- Data pretty printer |
| 2 | ===================================== |
| 3 | |
| 4 | .. module:: pprint |
| 5 | :synopsis: Data pretty printer. |
| 6 | .. moduleauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 7 | .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 8 | |
Raymond Hettinger | 1048094 | 2011-01-10 03:26:08 +0000 | [diff] [blame] | 9 | **Source code:** :source:`Lib/pprint.py` |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 10 | |
Raymond Hettinger | 4f707fd | 2011-01-10 19:54:11 +0000 | [diff] [blame] | 11 | -------------- |
| 12 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 13 | The :mod:`pprint` module provides a capability to "pretty-print" arbitrary |
| 14 | Python data structures in a form which can be used as input to the interpreter. |
| 15 | If the formatted structures include objects which are not fundamental Python |
| 16 | types, the representation may not be loadable. This may be the case if objects |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 17 | such as files, sockets or classes are included, as well as many other |
| 18 | objects which are not representable as Python literals. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 19 | |
| 20 | The formatted representation keeps objects on a single line if it can, and |
| 21 | breaks them onto multiple lines if they don't fit within the allowed width. |
| 22 | Construct :class:`PrettyPrinter` objects explicitly if you need to adjust the |
| 23 | width constraint. |
| 24 | |
Georg Brandl | 55ac8f0 | 2007-09-01 13:51:09 +0000 | [diff] [blame] | 25 | Dictionaries are sorted by key before the display is computed. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 26 | |
| 27 | The :mod:`pprint` module defines one class: |
| 28 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 29 | .. First the implementation class: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 30 | |
| 31 | |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 32 | .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ |
| 33 | compact=False) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 34 | |
| 35 | Construct a :class:`PrettyPrinter` instance. This constructor understands |
| 36 | several keyword parameters. An output stream may be set using the *stream* |
| 37 | keyword; the only method used on the stream object is the file protocol's |
| 38 | :meth:`write` method. If not specified, the :class:`PrettyPrinter` adopts |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 39 | ``sys.stdout``. The |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 40 | amount of indentation added for each recursive level is specified by *indent*; |
| 41 | the default is one. Other values can cause output to look a little odd, but can |
| 42 | make nesting easier to spot. The number of levels which may be printed is |
| 43 | controlled by *depth*; if the data structure being printed is too deep, the next |
| 44 | contained level is replaced by ``...``. By default, there is no constraint on |
| 45 | the depth of the objects being formatted. The desired output width is |
| 46 | constrained using the *width* parameter; the default is 80 characters. If a |
| 47 | structure cannot be formatted within the constrained width, a best effort will |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 48 | be made. If *compact* is false (the default) each item of a long sequence |
| 49 | will be formatted on a separate line. If *compact* is true, as many items |
| 50 | as will fit within the *width* will be formatted on each output line. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 51 | |
Serhiy Storchaka | 09bb846 | 2013-10-02 21:40:21 +0300 | [diff] [blame] | 52 | .. versionchanged:: 3.4 |
| 53 | Added the *compact* parameter. |
| 54 | |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 55 | >>> import pprint |
| 56 | >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 57 | >>> stuff.insert(0, stuff[:]) |
| 58 | >>> pp = pprint.PrettyPrinter(indent=4) |
| 59 | >>> pp.pprint(stuff) |
Georg Brandl | 3ccb787 | 2008-07-16 03:00:45 +0000 | [diff] [blame] | 60 | [ ['spam', 'eggs', 'lumberjack', 'knights', 'ni'], |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 61 | 'spam', |
| 62 | 'eggs', |
| 63 | 'lumberjack', |
| 64 | 'knights', |
| 65 | 'ni'] |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 66 | >>> pp = pprint.PrettyPrinter(width=41, compact=True) |
| 67 | >>> pp.pprint(stuff) |
| 68 | [['spam', 'eggs', 'lumberjack', |
| 69 | 'knights', 'ni'], |
| 70 | 'spam', 'eggs', 'lumberjack', 'knights', |
| 71 | 'ni'] |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 72 | >>> tup = ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', |
| 73 | ... ('parrot', ('fresh fruit',)))))))) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 74 | >>> pp = pprint.PrettyPrinter(depth=6) |
| 75 | >>> pp.pprint(tup) |
Alexandre Vassalotti | eca20b6 | 2008-05-16 02:54:33 +0000 | [diff] [blame] | 76 | ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', (...))))))) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 77 | |
Georg Brandl | 1824415 | 2009-09-02 20:34:52 +0000 | [diff] [blame] | 78 | |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 79 | The :mod:`pprint` module also provides several shortcut functions: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 80 | |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 81 | .. function:: pformat(object, indent=1, width=80, depth=None, *, compact=False) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 82 | |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 83 | Return the formatted representation of *object* as a string. *indent*, |
| 84 | *width*, *depth* and *compact* will be passed to the :class:`PrettyPrinter` |
| 85 | constructor as formatting parameters. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 86 | |
Serhiy Storchaka | 09bb846 | 2013-10-02 21:40:21 +0300 | [diff] [blame] | 87 | .. versionchanged:: 3.4 |
| 88 | Added the *compact* parameter. |
| 89 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 90 | |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 91 | .. function:: pprint(object, stream=None, indent=1, width=80, depth=None, *, \ |
| 92 | compact=False) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 93 | |
| 94 | Prints the formatted representation of *object* on *stream*, followed by a |
Georg Brandl | 1824415 | 2009-09-02 20:34:52 +0000 | [diff] [blame] | 95 | newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used |
Georg Brandl | 6911e3c | 2007-09-04 07:15:32 +0000 | [diff] [blame] | 96 | in the interactive interpreter instead of the :func:`print` function for |
| 97 | inspecting values (you can even reassign ``print = pprint.pprint`` for use |
Serhiy Storchaka | 7c411a4 | 2013-10-02 11:56:18 +0300 | [diff] [blame] | 98 | within a scope). *indent*, *width*, *depth* and *compact* will be passed |
| 99 | to the :class:`PrettyPrinter` constructor as formatting parameters. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 100 | |
Serhiy Storchaka | 09bb846 | 2013-10-02 21:40:21 +0300 | [diff] [blame] | 101 | .. versionchanged:: 3.4 |
| 102 | Added the *compact* parameter. |
| 103 | |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 104 | >>> import pprint |
| 105 | >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 106 | >>> stuff.insert(0, stuff) |
| 107 | >>> pprint.pprint(stuff) |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 108 | [<Recursion on list with id=...>, |
| 109 | 'spam', |
| 110 | 'eggs', |
| 111 | 'lumberjack', |
| 112 | 'knights', |
| 113 | 'ni'] |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 114 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 115 | |
| 116 | .. function:: isreadable(object) |
| 117 | |
| 118 | .. index:: builtin: eval |
| 119 | |
| 120 | Determine if the formatted representation of *object* is "readable," or can be |
| 121 | used to reconstruct the value using :func:`eval`. This always returns ``False`` |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 122 | for recursive objects. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 123 | |
| 124 | >>> pprint.isreadable(stuff) |
| 125 | False |
| 126 | |
| 127 | |
| 128 | .. function:: isrecursive(object) |
| 129 | |
| 130 | Determine if *object* requires a recursive representation. |
| 131 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 132 | |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 133 | One more support function is also defined: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 134 | |
| 135 | .. function:: saferepr(object) |
| 136 | |
| 137 | Return a string representation of *object*, protected against recursive data |
| 138 | structures. If the representation of *object* exposes a recursive entry, the |
| 139 | recursive reference will be represented as ``<Recursion on typename with |
| 140 | id=number>``. The representation is not otherwise formatted. |
| 141 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 142 | >>> pprint.saferepr(stuff) |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 143 | "[<Recursion on list with id=...>, 'spam', 'eggs', 'lumberjack', 'knights', 'ni']" |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 144 | |
| 145 | |
| 146 | .. _prettyprinter-objects: |
| 147 | |
| 148 | PrettyPrinter Objects |
| 149 | --------------------- |
| 150 | |
| 151 | :class:`PrettyPrinter` instances have the following methods: |
| 152 | |
| 153 | |
| 154 | .. method:: PrettyPrinter.pformat(object) |
| 155 | |
| 156 | Return the formatted representation of *object*. This takes into account the |
| 157 | options passed to the :class:`PrettyPrinter` constructor. |
| 158 | |
| 159 | |
| 160 | .. method:: PrettyPrinter.pprint(object) |
| 161 | |
| 162 | Print the formatted representation of *object* on the configured stream, |
| 163 | followed by a newline. |
| 164 | |
| 165 | The following methods provide the implementations for the corresponding |
| 166 | functions of the same names. Using these methods on an instance is slightly |
| 167 | more efficient since new :class:`PrettyPrinter` objects don't need to be |
| 168 | created. |
| 169 | |
| 170 | |
| 171 | .. method:: PrettyPrinter.isreadable(object) |
| 172 | |
| 173 | .. index:: builtin: eval |
| 174 | |
| 175 | Determine if the formatted representation of the object is "readable," or can be |
| 176 | used to reconstruct the value using :func:`eval`. Note that this returns |
| 177 | ``False`` for recursive objects. If the *depth* parameter of the |
| 178 | :class:`PrettyPrinter` is set and the object is deeper than allowed, this |
| 179 | returns ``False``. |
| 180 | |
| 181 | |
| 182 | .. method:: PrettyPrinter.isrecursive(object) |
| 183 | |
| 184 | Determine if the object requires a recursive representation. |
| 185 | |
| 186 | This method is provided as a hook to allow subclasses to modify the way objects |
| 187 | are converted to strings. The default implementation uses the internals of the |
| 188 | :func:`saferepr` implementation. |
| 189 | |
| 190 | |
| 191 | .. method:: PrettyPrinter.format(object, context, maxlevels, level) |
| 192 | |
| 193 | Returns three values: the formatted version of *object* as a string, a flag |
| 194 | indicating whether the result is readable, and a flag indicating whether |
| 195 | recursion was detected. The first argument is the object to be presented. The |
| 196 | second is a dictionary which contains the :func:`id` of objects that are part of |
| 197 | the current presentation context (direct and indirect containers for *object* |
| 198 | that are affecting the presentation) as the keys; if an object needs to be |
| 199 | presented which is already represented in *context*, the third return value |
| 200 | should be ``True``. Recursive calls to the :meth:`format` method should add |
| 201 | additional entries for containers to this dictionary. The third argument, |
| 202 | *maxlevels*, gives the requested limit to recursion; this will be ``0`` if there |
| 203 | is no requested limit. This argument should be passed unmodified to recursive |
| 204 | calls. The fourth argument, *level*, gives the current level; recursive calls |
| 205 | should be passed a value less than that of the current call. |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 206 | |
| 207 | |
| 208 | .. _pprint-example: |
| 209 | |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 210 | Example |
| 211 | ------- |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 212 | |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 213 | To demonstrate several uses of the :func:`pprint` function and its parameters, |
Georg Brandl | 525d355 | 2014-10-29 10:26:56 +0100 | [diff] [blame] | 214 | let's fetch information about a project from `PyPI <https://pypi.python.org/pypi>`_:: |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 215 | |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 216 | >>> import json |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 217 | >>> import pprint |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 218 | >>> from urllib.request import urlopen |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 219 | >>> with urlopen('http://pypi.python.org/pypi/Twisted/json') as url: |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 220 | ... http_info = url.info() |
| 221 | ... raw_data = url.read().decode(http_info.get_content_charset()) |
Éric Araujo | 6a21f55 | 2011-05-29 03:46:31 +0200 | [diff] [blame] | 222 | >>> project_info = json.loads(raw_data) |
Christian Heimes | b9eccbf | 2007-12-05 20:18:38 +0000 | [diff] [blame] | 223 | |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 224 | In its basic form, :func:`pprint` shows the whole object:: |
| 225 | |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 226 | >>> pprint.pprint(project_info) |
| 227 | {'info': {'_pypi_hidden': False, |
| 228 | '_pypi_ordering': 125, |
| 229 | 'author': 'Glyph Lefkowitz', |
| 230 | 'author_email': 'glyph@twistedmatrix.com', |
| 231 | 'bugtrack_url': '', |
| 232 | 'cheesecake_code_kwalitee_id': None, |
| 233 | 'cheesecake_documentation_id': None, |
| 234 | 'cheesecake_installability_id': None, |
| 235 | 'classifiers': ['Programming Language :: Python :: 2.6', |
| 236 | 'Programming Language :: Python :: 2.7', |
| 237 | 'Programming Language :: Python :: 2 :: Only'], |
| 238 | 'description': 'An extensible framework for Python programming, ' |
| 239 | 'with special focus\r\n' |
| 240 | 'on event-based network programming and ' |
| 241 | 'multiprotocol integration.', |
| 242 | 'docs_url': '', |
| 243 | 'download_url': 'UNKNOWN', |
| 244 | 'home_page': 'http://twistedmatrix.com/', |
| 245 | 'keywords': '', |
| 246 | 'license': 'MIT', |
| 247 | 'maintainer': '', |
| 248 | 'maintainer_email': '', |
| 249 | 'name': 'Twisted', |
| 250 | 'package_url': 'http://pypi.python.org/pypi/Twisted', |
| 251 | 'platform': 'UNKNOWN', |
| 252 | 'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0', |
| 253 | 'requires_python': None, |
| 254 | 'stable_version': None, |
| 255 | 'summary': 'An asynchronous networking framework written in Python', |
| 256 | 'version': '12.3.0'}, |
| 257 | 'urls': [{'comment_text': '', |
| 258 | 'downloads': 71844, |
| 259 | 'filename': 'Twisted-12.3.0.tar.bz2', |
| 260 | 'has_sig': False, |
| 261 | 'md5_digest': '6e289825f3bf5591cfd670874cc0862d', |
| 262 | 'packagetype': 'sdist', |
| 263 | 'python_version': 'source', |
| 264 | 'size': 2615733, |
| 265 | 'upload_time': '2012-12-26T12:47:03', |
| 266 | 'url': 'https://pypi.python.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2'}, |
| 267 | {'comment_text': '', |
| 268 | 'downloads': 5224, |
| 269 | 'filename': 'Twisted-12.3.0.win32-py2.7.msi', |
| 270 | 'has_sig': False, |
| 271 | 'md5_digest': '6b778f5201b622a5519a2aca1a2fe512', |
| 272 | 'packagetype': 'bdist_msi', |
| 273 | 'python_version': '2.7', |
| 274 | 'size': 2916352, |
| 275 | 'upload_time': '2012-12-26T12:48:15', |
| 276 | 'url': 'https://pypi.python.org/packages/2.7/T/Twisted/Twisted-12.3.0.win32-py2.7.msi'}]} |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 277 | |
| 278 | The result can be limited to a certain *depth* (ellipsis is used for deeper |
| 279 | contents):: |
| 280 | |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 281 | >>> pprint.pprint(project_info, depth=2) |
| 282 | {'info': {'_pypi_hidden': False, |
| 283 | '_pypi_ordering': 125, |
| 284 | 'author': 'Glyph Lefkowitz', |
| 285 | 'author_email': 'glyph@twistedmatrix.com', |
| 286 | 'bugtrack_url': '', |
| 287 | 'cheesecake_code_kwalitee_id': None, |
| 288 | 'cheesecake_documentation_id': None, |
| 289 | 'cheesecake_installability_id': None, |
| 290 | 'classifiers': [...], |
| 291 | 'description': 'An extensible framework for Python programming, ' |
| 292 | 'with special focus\r\n' |
| 293 | 'on event-based network programming and ' |
| 294 | 'multiprotocol integration.', |
| 295 | 'docs_url': '', |
| 296 | 'download_url': 'UNKNOWN', |
| 297 | 'home_page': 'http://twistedmatrix.com/', |
| 298 | 'keywords': '', |
| 299 | 'license': 'MIT', |
| 300 | 'maintainer': '', |
| 301 | 'maintainer_email': '', |
| 302 | 'name': 'Twisted', |
| 303 | 'package_url': 'http://pypi.python.org/pypi/Twisted', |
| 304 | 'platform': 'UNKNOWN', |
| 305 | 'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0', |
| 306 | 'requires_python': None, |
| 307 | 'stable_version': None, |
| 308 | 'summary': 'An asynchronous networking framework written in Python', |
| 309 | 'version': '12.3.0'}, |
| 310 | 'urls': [{...}, {...}]} |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 311 | |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 312 | Additionally, maximum character *width* can be suggested. If a long object |
| 313 | cannot be split, the specified width will be exceeded:: |
Łukasz Langa | 4ad78ab | 2011-05-14 22:43:44 +0200 | [diff] [blame] | 314 | |
Antoine Pitrou | 64c16c3 | 2013-03-23 20:30:39 +0100 | [diff] [blame] | 315 | >>> pprint.pprint(project_info, depth=2, width=50) |
| 316 | {'info': {'_pypi_hidden': False, |
| 317 | '_pypi_ordering': 125, |
| 318 | 'author': 'Glyph Lefkowitz', |
| 319 | 'author_email': 'glyph@twistedmatrix.com', |
| 320 | 'bugtrack_url': '', |
| 321 | 'cheesecake_code_kwalitee_id': None, |
| 322 | 'cheesecake_documentation_id': None, |
| 323 | 'cheesecake_installability_id': None, |
| 324 | 'classifiers': [...], |
| 325 | 'description': 'An extensible ' |
| 326 | 'framework for ' |
| 327 | 'Python programming, ' |
| 328 | 'with special ' |
| 329 | 'focus\r\n' |
| 330 | 'on event-based ' |
| 331 | 'network programming ' |
| 332 | 'and multiprotocol ' |
| 333 | 'integration.', |
| 334 | 'docs_url': '', |
| 335 | 'download_url': 'UNKNOWN', |
| 336 | 'home_page': 'http://twistedmatrix.com/', |
| 337 | 'keywords': '', |
| 338 | 'license': 'MIT', |
| 339 | 'maintainer': '', |
| 340 | 'maintainer_email': '', |
| 341 | 'name': 'Twisted', |
| 342 | 'package_url': 'http://pypi.python.org/pypi/Twisted', |
| 343 | 'platform': 'UNKNOWN', |
| 344 | 'release_url': 'http://pypi.python.org/pypi/Twisted/12.3.0', |
| 345 | 'requires_python': None, |
| 346 | 'stable_version': None, |
| 347 | 'summary': 'An asynchronous ' |
| 348 | 'networking framework ' |
| 349 | 'written in Python', |
| 350 | 'version': '12.3.0'}, |
| 351 | 'urls': [{...}, {...}]} |