Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/requests_toolbelt-0.9.1.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac | 
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| -1:000000000000 | 0:4f3585e2f14b | 
|---|---|
| 1 Metadata-Version: 2.1 | |
| 2 Name: requests-toolbelt | |
| 3 Version: 0.9.1 | |
| 4 Summary: A utility belt for advanced users of python-requests | |
| 5 Home-page: https://toolbelt.readthedocs.org | |
| 6 Author: Ian Cordasco, Cory Benfield | |
| 7 Author-email: graffatcolmingov@gmail.com | |
| 8 License: Apache 2.0 | |
| 9 Platform: UNKNOWN | |
| 10 Classifier: Development Status :: 5 - Production/Stable | |
| 11 Classifier: License :: OSI Approved :: Apache Software License | |
| 12 Classifier: Intended Audience :: Developers | |
| 13 Classifier: Programming Language :: Python | |
| 14 Classifier: Programming Language :: Python :: 2 | |
| 15 Classifier: Programming Language :: Python :: 2.7 | |
| 16 Classifier: Programming Language :: Python :: 3 | |
| 17 Classifier: Programming Language :: Python :: 3.3 | |
| 18 Classifier: Programming Language :: Python :: 3.4 | |
| 19 Classifier: Programming Language :: Python :: 3.5 | |
| 20 Classifier: Programming Language :: Python :: Implementation :: CPython | |
| 21 Requires-Dist: requests (<3.0.0,>=2.0.1) | |
| 22 | |
| 23 The Requests Toolbelt | |
| 24 ===================== | |
| 25 | |
| 26 This is just a collection of utilities for `python-requests`_, but don't | |
| 27 really belong in ``requests`` proper. The minimum tested requests version is | |
| 28 ``2.1.0``. In reality, the toolbelt should work with ``2.0.1`` as well, but | |
| 29 some idiosyncracies prevent effective or sane testing on that version. | |
| 30 | |
| 31 ``pip install requests-toolbelt`` to get started! | |
| 32 | |
| 33 | |
| 34 multipart/form-data Encoder | |
| 35 --------------------------- | |
| 36 | |
| 37 The main attraction is a streaming multipart form-data object, ``MultipartEncoder``. | |
| 38 Its API looks like this: | |
| 39 | |
| 40 .. code-block:: python | |
| 41 | |
| 42 from requests_toolbelt import MultipartEncoder | |
| 43 import requests | |
| 44 | |
| 45 m = MultipartEncoder( | |
| 46 fields={'field0': 'value', 'field1': 'value', | |
| 47 'field2': ('filename', open('file.py', 'rb'), 'text/plain')} | |
| 48 ) | |
| 49 | |
| 50 r = requests.post('http://httpbin.org/post', data=m, | |
| 51 headers={'Content-Type': m.content_type}) | |
| 52 | |
| 53 | |
| 54 You can also use ``multipart/form-data`` encoding for requests that don't | |
| 55 require files: | |
| 56 | |
| 57 .. code-block:: python | |
| 58 | |
| 59 from requests_toolbelt import MultipartEncoder | |
| 60 import requests | |
| 61 | |
| 62 m = MultipartEncoder(fields={'field0': 'value', 'field1': 'value'}) | |
| 63 | |
| 64 r = requests.post('http://httpbin.org/post', data=m, | |
| 65 headers={'Content-Type': m.content_type}) | |
| 66 | |
| 67 | |
| 68 Or, you can just create the string and examine the data: | |
| 69 | |
| 70 .. code-block:: python | |
| 71 | |
| 72 # Assuming `m` is one of the above | |
| 73 m.to_string() # Always returns unicode | |
| 74 | |
| 75 | |
| 76 User-Agent constructor | |
| 77 ---------------------- | |
| 78 | |
| 79 You can easily construct a requests-style ``User-Agent`` string:: | |
| 80 | |
| 81 from requests_toolbelt import user_agent | |
| 82 | |
| 83 headers = { | |
| 84 'User-Agent': user_agent('my_package', '0.0.1') | |
| 85 } | |
| 86 | |
| 87 r = requests.get('https://api.github.com/users', headers=headers) | |
| 88 | |
| 89 | |
| 90 SSLAdapter | |
| 91 ---------- | |
| 92 | |
| 93 The ``SSLAdapter`` was originally published on `Cory Benfield's blog`_. | |
| 94 This adapter allows the user to choose one of the SSL protocols made available | |
| 95 in Python's ``ssl`` module for outgoing HTTPS connections: | |
| 96 | |
| 97 .. code-block:: python | |
| 98 | |
| 99 from requests_toolbelt import SSLAdapter | |
| 100 import requests | |
| 101 import ssl | |
| 102 | |
| 103 s = requests.Session() | |
| 104 s.mount('https://', SSLAdapter(ssl.PROTOCOL_TLSv1)) | |
| 105 | |
| 106 cookies/ForgetfulCookieJar | |
| 107 -------------------------- | |
| 108 | |
| 109 The ``ForgetfulCookieJar`` prevents a particular requests session from storing | |
| 110 cookies: | |
| 111 | |
| 112 .. code-block:: python | |
| 113 | |
| 114 from requests_toolbelt.cookies.forgetful import ForgetfulCookieJar | |
| 115 | |
| 116 session = requests.Session() | |
| 117 session.cookies = ForgetfulCookieJar() | |
| 118 | |
| 119 Known Issues | |
| 120 ------------ | |
| 121 | |
| 122 On Python 3.3.0 and 3.3.1, the standard library's ``http`` module will fail | |
| 123 when passing an instance of the ``MultipartEncoder``. This is fixed in later | |
| 124 minor releases of Python 3.3. Please consider upgrading to a later minor | |
| 125 version or Python 3.4. *There is absolutely nothing this library can do to | |
| 126 work around that bug.* | |
| 127 | |
| 128 Contributing | |
| 129 ------------ | |
| 130 | |
| 131 Please read the `suggested workflow | |
| 132 <https://toolbelt.readthedocs.org/en/latest/contributing.html>`_ for | |
| 133 contributing to this project. | |
| 134 | |
| 135 Please report any bugs on the `issue tracker`_ | |
| 136 | |
| 137 .. _Cory Benfield's blog: https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/ | |
| 138 .. _python-requests: https://github.com/kennethreitz/requests | |
| 139 .. _issue tracker: https://github.com/requests/toolbelt/issues | |
| 140 | |
| 141 | |
| 142 History | |
| 143 ======= | |
| 144 | |
| 145 0.9.1 -- 2019-01-29 | |
| 146 ------------------- | |
| 147 | |
| 148 Fixed Bugs | |
| 149 ~~~~~~~~~~ | |
| 150 | |
| 151 - Fix import of pyOpenSSL shim from urllib3 for PKCS12 adapter | |
| 152 | |
| 153 0.9.0 -- 2019-01-29 | |
| 154 ------------------- | |
| 155 | |
| 156 New Features | |
| 157 ~~~~~~~~~~~~ | |
| 158 | |
| 159 - Add X509 Adapter that can handle PKCS12 | |
| 160 - Add stateless solution for streaming files by MultipartEncoder from one host to another (in chunks) | |
| 161 | |
| 162 Fixed Bugs | |
| 163 ~~~~~~~~~~ | |
| 164 | |
| 165 - Update link to example | |
| 166 - Move import of ``ABCs`` from collections into version-specific part of | |
| 167 _compat module | |
| 168 - Fix backwards incompatibility in ``get_encodings_from_content`` | |
| 169 - Correct callback documentation for ``MultipartEncoderMonitor`` | |
| 170 - Fix bug when ``MultipartEncoder`` is asked to encode zero parts | |
| 171 - Correct the type of non string request body dumps | |
| 172 - Removed content from being stored in MultipartDecoder | |
| 173 - Fix bug by enabling support for contenttype with capital letters. | |
| 174 - Coerce proxy URL to bytes before dumping request | |
| 175 - Avoid bailing out with exception upon empty response reason | |
| 176 - Corrected Pool documentation | |
| 177 - Corrected parentheses match in example usage | |
| 178 - Fix "oject" to "object" in ``MultipartEncoder`` | |
| 179 - Fix URL for the project after the move | |
| 180 - Add fix for OSX TCPKeepAliveAdapter | |
| 181 | |
| 182 Miscellaneous | |
| 183 ~~~~~~~~~~~~~ | |
| 184 | |
| 185 - Remove py33 from testing and add Python 3.6 and nightly testing to the travis matrix. | |
| 186 | |
| 187 0.8.0 -- 2017-05-20 | |
| 188 ------------------- | |
| 189 | |
| 190 More information about this release can be found on the `0.8.0 milestone`_. | |
| 191 | |
| 192 New Features | |
| 193 ~~~~~~~~~~~~ | |
| 194 | |
| 195 - Add ``UserAgentBuilder`` to provide more control over generated User-Agent | |
| 196 strings. | |
| 197 | |
| 198 Fixed Bugs | |
| 199 ~~~~~~~~~~ | |
| 200 | |
| 201 - Include ``_validate_certificate`` in the lits of picked attributes on the | |
| 202 ``AppEngineAdapter``. | |
| 203 - Fix backwards incompatibility in ``get_encodings_from_content`` | |
| 204 | |
| 205 .. _0.8.0 milestone: | |
| 206 https://github.com/requests/toolbelt/milestones/0.8.0 | |
| 207 | |
| 208 0.7.1 -- 2017-02-13 | |
| 209 ------------------- | |
| 210 | |
| 211 More information about this release can be found on the `0.7.1 milestone`_. | |
| 212 | |
| 213 Fixed Bugs | |
| 214 ~~~~~~~~~~ | |
| 215 | |
| 216 - Fixed monkey-patching for the AppEngineAdapter. | |
| 217 | |
| 218 - Make it easier to disable certificate verification when monkey-patching | |
| 219 AppEngine. | |
| 220 | |
| 221 - Handle ``multipart/form-data`` bodies without a trailing ``CRLF``. | |
| 222 | |
| 223 | |
| 224 .. links | |
| 225 .. _0.7.1 milestone: | |
| 226 https://github.com/requests/toolbelt/milestone/9 | |
| 227 | |
| 228 0.7.0 -- 2016-07-21 | |
| 229 ------------------- | |
| 230 | |
| 231 More information about this release can be found on the `0.7.0 milestone`_. | |
| 232 | |
| 233 New Features | |
| 234 ~~~~~~~~~~~~ | |
| 235 | |
| 236 - Add ``BaseUrlSession`` to allow developers to have a session that has a | |
| 237 "Base" URL. See the documentation for more details and examples. | |
| 238 | |
| 239 - Split the logic of ``stream_response_to_file`` into two separate functions: | |
| 240 | |
| 241 * ``get_download_file_path`` to generate the file name from the Response. | |
| 242 | |
| 243 * ``stream_response_to_file`` which will use ``get_download_file_path`` if | |
| 244 necessary | |
| 245 | |
| 246 Fixed Bugs | |
| 247 ~~~~~~~~~~ | |
| 248 | |
| 249 - Fixed the issue for people using *very* old versions of Requests where they | |
| 250 would see an ImportError from ``requests_toolbelt._compat`` when trying to | |
| 251 import ``connection``. | |
| 252 | |
| 253 | |
| 254 .. _0.7.0 milestone: | |
| 255 https://github.com/requests/toolbelt/milestones/0.7.0 | |
| 256 | |
| 257 0.6.2 -- 2016-05-10 | |
| 258 ------------------- | |
| 259 | |
| 260 Fixed Bugs | |
| 261 ~~~~~~~~~~ | |
| 262 | |
| 263 - When passing a timeout via Requests, it was not appropriately translated to | |
| 264 the timeout that the urllib3 code was expecting. | |
| 265 | |
| 266 0.6.1 -- 2016-05-05 | |
| 267 ------------------- | |
| 268 | |
| 269 Fixed Bugs | |
| 270 ~~~~~~~~~~ | |
| 271 | |
| 272 - Remove assertion about request URLs in the AppEngineAdapter. | |
| 273 | |
| 274 - Prevent pip from installing requests 3.0.0 when that is released until we | |
| 275 are ready to handle it. | |
| 276 | |
| 277 0.6.0 -- 2016-01-27 | |
| 278 ------------------- | |
| 279 | |
| 280 More information about this release can be found on the `0.6.0 milestone`_. | |
| 281 | |
| 282 New Features | |
| 283 ~~~~~~~~~~~~ | |
| 284 | |
| 285 - Add ``AppEngineAdapter`` to support developers using Google's AppEngine | |
| 286 platform with Requests. | |
| 287 | |
| 288 - Add ``GuessProxyAuth`` class to support guessing between Basic and Digest | |
| 289 Authentication for proxies. | |
| 290 | |
| 291 Fixed Bugs | |
| 292 ~~~~~~~~~~ | |
| 293 | |
| 294 - Ensure that proxies use the correct TLS version when using the | |
| 295 ``SSLAdapter``. | |
| 296 | |
| 297 - Fix an ``AttributeError`` when using the ``HTTPProxyDigestAuth`` class. | |
| 298 | |
| 299 Miscellaneous | |
| 300 ~~~~~~~~~~~~~ | |
| 301 | |
| 302 - Drop testing support for Python 3.2. virtualenv and pip have stopped | |
| 303 supporting it meaning that it is harder to test for this with our CI | |
| 304 infrastructure. Moving forward we will make a best-effort attempt to | |
| 305 support 3.2 but will not test for it. | |
| 306 | |
| 307 | |
| 308 .. _0.6.0 milestone: | |
| 309 https://github.com/requests/toolbelt/milestones/0.6.0 | |
| 310 | |
| 311 0.5.1 -- 2015-12-16 | |
| 312 ------------------- | |
| 313 | |
| 314 More information about this release can be found on the `0.5.1 milestone`_. | |
| 315 | |
| 316 Fixed Bugs | |
| 317 ~~~~~~~~~~ | |
| 318 | |
| 319 - Now papers over the differences in requests' ``super_len`` function from | |
| 320 versions prior to 2.9.0 and versions 2.9.0 and later. | |
| 321 | |
| 322 | |
| 323 .. _0.5.1 milestone: | |
| 324 https://github.com/requests/toolbelt/milestones/0.5.1 | |
| 325 | |
| 326 0.5.0 -- 2015-11-24 | |
| 327 ------------------- | |
| 328 | |
| 329 More information about this release can be found on the `milestone | |
| 330 <https://github.com/requests/toolbelt/issues?utf8=%E2%9C%93&q=is%3Aall+milestone%3A0.5+>`_ | |
| 331 for 0.5.0. | |
| 332 | |
| 333 New Features | |
| 334 ~~~~~~~~~~~~ | |
| 335 | |
| 336 - The ``tee`` submodule was added to ``requests_toolbelt.downloadutils``. It | |
| 337 allows you to iterate over the bytes of a response while also writing them | |
| 338 to a file. The ``tee.tee`` function, expects you to pass an open file | |
| 339 object, while ``tee.tee_to_file`` will use the provided file name to open | |
| 340 the file for you. | |
| 341 | |
| 342 - Added a new parameter to ``requests_toolbelt.utils.user_agent`` that allows | |
| 343 the user to specify additional items. | |
| 344 | |
| 345 - Added nested form-data helper, | |
| 346 ``requests_toolbelt.utils.formdata.urlencode``. | |
| 347 | |
| 348 - Added the ``ForgetfulCookieJar`` to ``requests_toolbelt.cookies``. | |
| 349 | |
| 350 - Added utilities for dumping the information about a request-response cycle | |
| 351 in ``requests_toolbelt.utils.dump``. | |
| 352 | |
| 353 - Implemented the API described in the ``requests_toolbelt.threaded`` module | |
| 354 docstring, i.e., added ``requests_toolbelt.threaded.map`` as an available | |
| 355 function. | |
| 356 | |
| 357 Fixed Bugs | |
| 358 ~~~~~~~~~~ | |
| 359 | |
| 360 - Now papers over the API differences in versions of requests installed from | |
| 361 system packages versus versions of requests installed from PyPI. | |
| 362 | |
| 363 - Allow string types for ``SourceAddressAdapter``. | |
| 364 | |
| 365 0.4.0 -- 2015-04-03 | |
| 366 ------------------- | |
| 367 | |
| 368 For more information about this release, please see `milestone 0.4.0 | |
| 369 <https://github.com/requests/toolbelt/issues?q=milestone%3A0.4>`_ | |
| 370 on the project's page. | |
| 371 | |
| 372 New Features | |
| 373 ~~~~~~~~~~~~ | |
| 374 | |
| 375 - A naive implemenation of a thread pool is now included in the toolbelt. See | |
| 376 the docs in ``docs/threading.rst`` or on `Read The Docs | |
| 377 <https://toolbelt.readthedocs.org>`_. | |
| 378 | |
| 379 - The ``StreamingIterator`` now accepts files (such as ``sys.stdin``) without | |
| 380 a specific length and will properly stream them. | |
| 381 | |
| 382 - The ``MultipartEncoder`` now accepts exactly the same format of fields as | |
| 383 requests' ``files`` parameter does. In other words, you can now also pass in | |
| 384 extra headers to add to a part in the body. You can also now specify a | |
| 385 custom ``Content-Type`` for a part. | |
| 386 | |
| 387 - An implementation of HTTP Digest Authentication for Proxies is now included. | |
| 388 | |
| 389 - A transport adapter that allows a user to specify a specific Certificate | |
| 390 Fingerprint is now included in the toolbelt. | |
| 391 | |
| 392 - A transport adapter that simplifies how users specify socket options is now | |
| 393 included. | |
| 394 | |
| 395 - A transport adapter that simplifies how users can specify TCP Keep-Alive | |
| 396 options is now included in the toolbelt. | |
| 397 | |
| 398 - Deprecated functions from ``requests.utils`` are now included and | |
| 399 maintained. | |
| 400 | |
| 401 - An authentication tool that allows users to specify how to authenticate to | |
| 402 several different domains at once is now included. | |
| 403 | |
| 404 - A function to save streamed responses to disk by analyzing the | |
| 405 ``Content-Disposition`` header is now included in the toolbelt. | |
| 406 | |
| 407 Fixed Bugs | |
| 408 ~~~~~~~~~~ | |
| 409 | |
| 410 - The ``MultipartEncoder`` will now allow users to upload files larger than | |
| 411 4GB on 32-bit systems. | |
| 412 | |
| 413 - The ``MultipartEncoder`` will now accept empty unicode strings for form | |
| 414 values. | |
| 415 | |
| 416 0.3.1 -- 2014-06-23 | |
| 417 ------------------- | |
| 418 | |
| 419 - Fix the fact that 0.3.0 bundle did not include the ``StreamingIterator`` | |
| 420 | |
| 421 0.3.0 -- 2014-05-21 | |
| 422 ------------------- | |
| 423 | |
| 424 Bug Fixes | |
| 425 ~~~~~~~~~ | |
| 426 | |
| 427 - Complete rewrite of ``MultipartEncoder`` fixes bug where bytes were lost in | |
| 428 uploads | |
| 429 | |
| 430 New Features | |
| 431 ~~~~~~~~~~~~ | |
| 432 | |
| 433 - ``MultipartDecoder`` to accept ``multipart/form-data`` response bodies and | |
| 434 parse them into an easy to use object. | |
| 435 | |
| 436 - ``SourceAddressAdapter`` to allow users to choose a local address to bind | |
| 437 connections to. | |
| 438 | |
| 439 - ``GuessAuth`` which accepts a username and password and uses the | |
| 440 ``WWW-Authenticate`` header to determine how to authenticate against a | |
| 441 server. | |
| 442 | |
| 443 - ``MultipartEncoderMonitor`` wraps an instance of the ``MultipartEncoder`` | |
| 444 and keeps track of how many bytes were read and will call the provided | |
| 445 callback. | |
| 446 | |
| 447 - ``StreamingIterator`` will wrap an iterator and stream the upload instead of | |
| 448 chunk it, provided you also provide the length of the content you wish to | |
| 449 upload. | |
| 450 | |
| 451 0.2.0 -- 2014-02-24 | |
| 452 ------------------- | |
| 453 | |
| 454 - Add ability to tell ``MultipartEncoder`` which encoding to use. By default | |
| 455 it uses 'utf-8'. | |
| 456 | |
| 457 - Fix #10 - allow users to install with pip | |
| 458 | |
| 459 - Fix #9 - Fix ``MultipartEncoder#to_string`` so that it properly handles file | |
| 460 objects as fields | |
| 461 | |
| 462 0.1.2 -- 2014-01-19 | |
| 463 ------------------- | |
| 464 | |
| 465 - At some point during development we broke how we handle normal file objects. | |
| 466 Thanks to @konomae this is now fixed. | |
| 467 | |
| 468 0.1.1 -- 2014-01-19 | |
| 469 ------------------- | |
| 470 | |
| 471 - Handle ``io.BytesIO``-like objects better | |
| 472 | |
| 473 0.1.0 -- 2014-01-18 | |
| 474 ------------------- | |
| 475 | |
| 476 - Add initial implementation of the streaming ``MultipartEncoder`` | |
| 477 | |
| 478 - Add initial implementation of the ``user_agent`` function | |
| 479 | |
| 480 - Add the ``SSLAdapter`` | |
| 481 | |
| 482 | 
