Mercurial > repos > bcclaywell > argo_navis
comparison venv/lib/python2.7/site-packages/requests_toolbelt-0.4.0.dist-info/METADATA @ 0:d67268158946 draft
planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
| author | bcclaywell |
|---|---|
| date | Mon, 12 Oct 2015 17:43:33 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d67268158946 |
|---|---|
| 1 Metadata-Version: 2.0 | |
| 2 Name: requests-toolbelt | |
| 3 Version: 0.4.0 | |
| 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: Copyright 2014 Ian Cordasco, Cory Benfield | |
| 9 Requires-Dist: requests (>=2.0.1,<=3.0.0) | |
| 10 | |
| 11 Licensed under the Apache License, Version 2.0 (the "License"); | |
| 12 you may not use this file except in compliance with the License. | |
| 13 You may obtain a copy of the License at | |
| 14 | |
| 15 http://www.apache.org/licenses/LICENSE-2.0 | |
| 16 | |
| 17 Unless required by applicable law or agreed to in writing, software | |
| 18 distributed under the License is distributed on an "AS IS" BASIS, | |
| 19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 20 See the License for the specific language governing permissions and | |
| 21 limitations under the License. | |
| 22 | |
| 23 Description: 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 | |
| 32 multipart/form-data Encoder | |
| 33 --------------------------- | |
| 34 | |
| 35 The main attraction is a streaming multipart form-data object, ``MultipartEncoder``. | |
| 36 Its API looks like this: | |
| 37 | |
| 38 .. code-block:: python | |
| 39 | |
| 40 from requests_toolbelt import MultipartEncoder | |
| 41 import requests | |
| 42 | |
| 43 m = MultipartEncoder( | |
| 44 fields={'field0': 'value', 'field1': 'value', | |
| 45 'field2': ('filename', open('file.py', 'rb'), 'text/plain')} | |
| 46 ) | |
| 47 | |
| 48 r = requests.post('http://httpbin.org/post', data=m, | |
| 49 headers={'Content-Type': m.content_type}) | |
| 50 | |
| 51 | |
| 52 You can also use ``multipart/form-data`` encoding for requests that don't | |
| 53 require files: | |
| 54 | |
| 55 .. code-block:: python | |
| 56 | |
| 57 from requests_toolbelt import MultipartEncoder | |
| 58 import requests | |
| 59 | |
| 60 m = MultipartEncoder(fields={'field0': 'value', 'field1': 'value'}) | |
| 61 | |
| 62 r = requests.post('http://httpbin.org/post', data=m, | |
| 63 headers={'Content-Type': m.content_type}) | |
| 64 | |
| 65 | |
| 66 Or, you can just create the string and examine the data: | |
| 67 | |
| 68 .. code-block:: python | |
| 69 | |
| 70 # Assuming `m` is one of the above | |
| 71 m.to_string() # Always returns unicode | |
| 72 | |
| 73 | |
| 74 User-Agent constructor | |
| 75 ---------------------- | |
| 76 | |
| 77 You can easily construct a requests-style ``User-Agent`` string:: | |
| 78 | |
| 79 from requests_toolbelt import user_agent | |
| 80 | |
| 81 headers = { | |
| 82 'User-Agent': user_agent('my_package', '0.0.1') | |
| 83 } | |
| 84 | |
| 85 r = requests.get('https://api.github.com/users', headers=headers) | |
| 86 | |
| 87 | |
| 88 SSLAdapter | |
| 89 ---------- | |
| 90 | |
| 91 The ``SSLAdapter`` was originally published on `Cory Benfield's blog`_. | |
| 92 This adapter allows the user to choose one of the SSL protocols made available | |
| 93 in Python's ``ssl`` module for outgoing HTTPS connections: | |
| 94 | |
| 95 .. code-block:: python | |
| 96 | |
| 97 from requests_toolbelt import SSLAdapter | |
| 98 import requests | |
| 99 import ssl | |
| 100 | |
| 101 s = requests.Session() | |
| 102 s.mount('https://', SSLAdapter(ssl.PROTOCOL_TLSv1)) | |
| 103 | |
| 104 | |
| 105 Known Issues | |
| 106 ------------ | |
| 107 | |
| 108 On Python 3.3.0 and 3.3.1, the standard library's ``http`` module will fail | |
| 109 when passing an instance of the ``MultipartEncoder``. This is fixed in later | |
| 110 minor releases of Python 3.3. Please consider upgrading to a later minor | |
| 111 version or Python 3.4. *There is absolutely nothing this library can do to | |
| 112 work around that bug.* | |
| 113 | |
| 114 .. _Cory Benfield's blog: https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/ | |
| 115 .. _python-requests: https://github.com/kennethreitz/requests | |
| 116 | |
| 117 | |
| 118 History | |
| 119 ======= | |
| 120 | |
| 121 0.4.0 -- 2015-04-03 | |
| 122 ------------------- | |
| 123 | |
| 124 For more information about this release, please see `milestone 0.4.0 | |
| 125 <https://github.com/sigmavirus24/requests-toolbelt/issues/46>`_ on the | |
| 126 project's page. | |
| 127 | |
| 128 New Features | |
| 129 ~~~~~~~~~~~~ | |
| 130 | |
| 131 - A naive implemenation of a thread pool is now included in the toolbelt. See | |
| 132 the docs in ``docs/threading.rst`` or on `Read The Docs | |
| 133 <https://toolbelt.readthedocs.org>`_. | |
| 134 | |
| 135 - The ``StreamingIterator`` now accepts files (such as ``sys.stdin``) without | |
| 136 a specific length and will properly stream them. | |
| 137 | |
| 138 - The ``MultipartEncoder`` now accepts exactly the same format of fields as | |
| 139 requests' ``files`` parameter does. In other words, you can now also pass in | |
| 140 extra headers to add to a part in the body. You can also now specify a | |
| 141 custom ``Content-Type`` for a part. | |
| 142 | |
| 143 - An implementation of HTTP Digest Authentication for Proxies is now included. | |
| 144 | |
| 145 - A transport adapter that allows a user to specify a specific Certificate | |
| 146 Fingerprint is now included in the toolbelt. | |
| 147 | |
| 148 - A transport adapter that simplifies how users specify socket options is now | |
| 149 included. | |
| 150 | |
| 151 - A transport adapter that simplifies how users can specify TCP Keep-Alive | |
| 152 options is now included in the toolbelt. | |
| 153 | |
| 154 - Deprecated functions from ``requests.utils`` are now included and | |
| 155 maintained. | |
| 156 | |
| 157 - An authentication tool that allows users to specify how to authenticate to | |
| 158 several different domains at once is now included. | |
| 159 | |
| 160 - A function to save streamed responses to disk by analyzing the | |
| 161 ``Content-Disposition`` header is now included in the toolbelt. | |
| 162 | |
| 163 Fixed Bugs | |
| 164 ~~~~~~~~~~ | |
| 165 | |
| 166 - The ``MultipartEncoder`` will now allow users to upload files larger than | |
| 167 4GB on 32-bit systems. | |
| 168 | |
| 169 - The ``MultipartEncoder`` will now accept empty unicode strings for form | |
| 170 values. | |
| 171 | |
| 172 0.3.1 -- 2014-06-23 | |
| 173 ------------------- | |
| 174 | |
| 175 - Fix the fact that 0.3.0 bundle did not include the ``StreamingIterator`` | |
| 176 | |
| 177 0.3.0 -- 2014-05-21 | |
| 178 ------------------- | |
| 179 | |
| 180 Bug Fixes | |
| 181 ~~~~~~~~~ | |
| 182 | |
| 183 - Complete rewrite of ``MultipartEncoder`` fixes bug where bytes were lost in | |
| 184 uploads | |
| 185 | |
| 186 New Features | |
| 187 ~~~~~~~~~~~~ | |
| 188 | |
| 189 - ``MultipartDecoder`` to accept ``multipart/form-data`` response bodies and | |
| 190 parse them into an easy to use object. | |
| 191 | |
| 192 - ``SourceAddressAdapter`` to allow users to choose a local address to bind | |
| 193 connections to. | |
| 194 | |
| 195 - ``GuessAuth`` which accepts a username and password and uses the | |
| 196 ``WWW-Authenticate`` header to determine how to authenticate against a | |
| 197 server. | |
| 198 | |
| 199 - ``MultipartEncoderMonitor`` wraps an instance of the ``MultipartEncoder`` | |
| 200 and keeps track of how many bytes were read and will call the provided | |
| 201 callback. | |
| 202 | |
| 203 - ``StreamingIterator`` will wrap an iterator and stream the upload instead of | |
| 204 chunk it, provided you also provide the length of the content you wish to | |
| 205 upload. | |
| 206 | |
| 207 0.2.0 -- 2014-02-24 | |
| 208 ------------------- | |
| 209 | |
| 210 - Add ability to tell ``MultipartEncoder`` which encoding to use. By default | |
| 211 it uses 'utf-8'. | |
| 212 | |
| 213 - Fix #10 - allow users to install with pip | |
| 214 | |
| 215 - Fix #9 - Fix ``MultipartEncoder#to_string`` so that it properly handles file | |
| 216 objects as fields | |
| 217 | |
| 218 0.1.2 -- 2014-01-19 | |
| 219 ------------------- | |
| 220 | |
| 221 - At some point during development we broke how we handle normal file objects. | |
| 222 Thanks to @konomae this is now fixed. | |
| 223 | |
| 224 0.1.1 -- 2014-01-19 | |
| 225 ------------------- | |
| 226 | |
| 227 - Handle ``io.BytesIO``-like objects better | |
| 228 | |
| 229 0.1.0 -- 2014-01-18 | |
| 230 ------------------- | |
| 231 | |
| 232 - Add initial implementation of the streaming ``MultipartEncoder`` | |
| 233 | |
| 234 - Add initial implementation of the ``user_agent`` function | |
| 235 | |
| 236 - Add the ``SSLAdapter`` | |
| 237 | |
| 238 Platform: UNKNOWN | |
| 239 Classifier: Development Status :: 5 - Production/Stable | |
| 240 Classifier: License :: OSI Approved | |
| 241 Classifier: Intended Audience :: Developers | |
| 242 Classifier: Programming Language :: Python | |
| 243 Classifier: Programming Language :: Python :: 2 | |
| 244 Classifier: Programming Language :: Python :: 2.6 | |
| 245 Classifier: Programming Language :: Python :: 2.7 | |
| 246 Classifier: Programming Language :: Python :: 3 | |
| 247 Classifier: Programming Language :: Python :: 3.2 | |
| 248 Classifier: Programming Language :: Python :: 3.3 | |
| 249 Classifier: Programming Language :: Python :: Implementation :: CPython |
