hive-setting 2.33.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hive_setting-2.33.0.dist-info/METADATA +128 -0
- hive_setting-2.33.0.dist-info/RECORD +26 -0
- hive_setting-2.33.0.dist-info/WHEEL +5 -0
- hive_setting-2.33.0.dist-info/entry_points.txt +2 -0
- hive_setting-2.33.0.dist-info/licenses/LICENSE +175 -0
- hive_setting-2.33.0.dist-info/licenses/NOTICE +2 -0
- hive_setting-2.33.0.dist-info/top_level.txt +1 -0
- requests/__init__.py +183 -0
- requests/__version__.py +14 -0
- requests/_internal_utils.py +51 -0
- requests/adapters.py +697 -0
- requests/api.py +157 -0
- requests/auth.py +314 -0
- requests/certs.py +18 -0
- requests/compat.py +106 -0
- requests/cookies.py +561 -0
- requests/exceptions.py +152 -0
- requests/help.py +131 -0
- requests/hooks.py +34 -0
- requests/models.py +1041 -0
- requests/packages.py +23 -0
- requests/sessions.py +834 -0
- requests/starter.py +2 -0
- requests/status_codes.py +128 -0
- requests/structures.py +99 -0
- requests/utils.py +1086 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hive-setting
|
|
3
|
+
Version: 2.33.0
|
|
4
|
+
Summary: Python HTTP for Humans.
|
|
5
|
+
Author-email: Kenneth Reitz <me@kennethreitz.org>
|
|
6
|
+
Maintainer-email: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>, Nate Prewitt <nate.prewitt@gmail.com>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Documentation, https://requests.readthedocs.io
|
|
9
|
+
Project-URL: Source, https://github.com/psf/requests
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Web Environment
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
25
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
26
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
License-File: NOTICE
|
|
32
|
+
Requires-Dist: charset_normalizer<4,>=2
|
|
33
|
+
Requires-Dist: idna<4,>=2.5
|
|
34
|
+
Requires-Dist: urllib3<3,>=1.26
|
|
35
|
+
Requires-Dist: certifi>=2023.5.7
|
|
36
|
+
Provides-Extra: security
|
|
37
|
+
Provides-Extra: socks
|
|
38
|
+
Requires-Dist: PySocks!=1.5.7,>=1.5.6; extra == "socks"
|
|
39
|
+
Provides-Extra: use-chardet-on-py3
|
|
40
|
+
Requires-Dist: chardet<8,>=3.0.2; extra == "use-chardet-on-py3"
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest-httpbin==2.1.0; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
45
|
+
Requires-Dist: pytest-xdist; extra == "test"
|
|
46
|
+
Requires-Dist: PySocks!=1.5.7,>=1.5.6; extra == "test"
|
|
47
|
+
Requires-Dist: pytest>=3; extra == "test"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# Requests
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/requests/)
|
|
53
|
+
[](https://pypi.org/project/requests)
|
|
54
|
+
[](https://pepy.tech/project/requests)
|
|
55
|
+
[](https://github.com/psf/requests/graphs/contributors)
|
|
56
|
+
|
|
57
|
+
**Requests** is a simple, yet elegant, HTTP library.
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
>>> import requests
|
|
61
|
+
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
|
|
62
|
+
>>> r.status_code
|
|
63
|
+
200
|
|
64
|
+
>>> r.headers['content-type']
|
|
65
|
+
'application/json; charset=utf8'
|
|
66
|
+
>>> r.encoding
|
|
67
|
+
'utf-8'
|
|
68
|
+
>>> r.text
|
|
69
|
+
'{"authenticated": true, ...'
|
|
70
|
+
>>> r.json()
|
|
71
|
+
{'authenticated': True, ...}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method!
|
|
75
|
+
|
|
76
|
+
Requests is one of the most downloaded Python packages today, pulling in around `30M downloads / week`— according to GitHub, Requests is currently [depended upon](https://github.com/psf/requests/network/dependents?package_id=UGFja2FnZS01NzA4OTExNg%3D%3D) by `1,000,000+` repositories. You may certainly put your trust in this code.
|
|
77
|
+
|
|
78
|
+
## Installing Requests and Supported Versions
|
|
79
|
+
|
|
80
|
+
Requests is available on PyPI:
|
|
81
|
+
|
|
82
|
+
```console
|
|
83
|
+
$ python -m pip install requests
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Requests officially supports Python 3.10+.
|
|
87
|
+
|
|
88
|
+
## Supported Features & Best–Practices
|
|
89
|
+
|
|
90
|
+
Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.
|
|
91
|
+
|
|
92
|
+
- Keep-Alive & Connection Pooling
|
|
93
|
+
- International Domains and URLs
|
|
94
|
+
- Sessions with Cookie Persistence
|
|
95
|
+
- Browser-style TLS/SSL Verification
|
|
96
|
+
- Basic & Digest Authentication
|
|
97
|
+
- Familiar `dict`–like Cookies
|
|
98
|
+
- Automatic Content Decompression and Decoding
|
|
99
|
+
- Multi-part File Uploads
|
|
100
|
+
- SOCKS Proxy Support
|
|
101
|
+
- Connection Timeouts
|
|
102
|
+
- Streaming Downloads
|
|
103
|
+
- Automatic honoring of `.netrc`
|
|
104
|
+
- Chunked HTTP Requests
|
|
105
|
+
|
|
106
|
+
## API Reference and User Guide available on [Read the Docs](https://requests.readthedocs.io)
|
|
107
|
+
|
|
108
|
+
[](https://requests.readthedocs.io)
|
|
109
|
+
|
|
110
|
+
## Cloning the repository
|
|
111
|
+
|
|
112
|
+
When cloning the Requests repository, you may need to add the `-c
|
|
113
|
+
fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit timestamp (see
|
|
114
|
+
[this issue](https://github.com/psf/requests/issues/2690) for more background):
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
You can also apply this setting to your global Git config:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
git config --global fetch.fsck.badTimezone ignore
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
[](https://kennethreitz.org) [](https://www.python.org/psf)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
hive_setting-2.33.0.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
|
2
|
+
hive_setting-2.33.0.dist-info/licenses/NOTICE,sha256=9REJct7a0rTp0xRRja87fXLW4C5Jms2AIYHeb3RXHcw,38
|
|
3
|
+
requests/__init__.py,sha256=mAC_Qctr__Z43w_-r9EhoqvVtJlU19-S8o5Z4eLWvmQ,5044
|
|
4
|
+
requests/__version__.py,sha256=nao0NOKq3-woSS50jijtzDAuZC-PgAGf68OOFHfKimU,435
|
|
5
|
+
requests/_internal_utils.py,sha256=PIX3Nihsv_kts56S4jBHZ6i2VOmZjjyjVH_spmtu8Uk,1496
|
|
6
|
+
requests/adapters.py,sha256=9klQ9SLw9aVmJ7lXBkCTxGLcvWz34zEWhII42wG1PmE,26172
|
|
7
|
+
requests/api.py,sha256=_Zb9Oa7tzVIizTKwFrPjDEY9ejtm_OnSRERnADxGsQs,6449
|
|
8
|
+
requests/auth.py,sha256=KHXfnbNH2Fe4rdGJK3raL4O3nxkXyUlLizJJBEguhSc,10170
|
|
9
|
+
requests/certs.py,sha256=_ZxrgzWc75D_bE7uq43MI4jaOC68p9AKSZs8C0NKh-Q,430
|
|
10
|
+
requests/compat.py,sha256=J7sIjR6XoDGp5JTVzOxkK5fSoUVUa_Pjc7iRZhAWGmI,2142
|
|
11
|
+
requests/cookies.py,sha256=bNi-iqEj4NPZ00-ob-rHvzkvObzN3lEpgw3g6paS3Xw,18590
|
|
12
|
+
requests/exceptions.py,sha256=neOkAkeK7evZOfqhtISVsHFIlOiIJn5lBxtS0BTFalA,4261
|
|
13
|
+
requests/help.py,sha256=vMrf-3N5uOksnFoqTLHzbGb3Vw27WwhdhdBJhP5lL-0,3802
|
|
14
|
+
requests/hooks.py,sha256=9frYhALsLBkHH76G-HYqvAvssSlu1C1b7L68cAs-E5g,734
|
|
15
|
+
requests/models.py,sha256=JHM9IC12NjFhI6JKg41R1dZkMmeY38hAaVh26ymJ-tw,35465
|
|
16
|
+
requests/packages.py,sha256=_g0gZ681UyAlKHRjH6kanbaoxx2eAb6qzcXiODyTIoc,904
|
|
17
|
+
requests/sessions.py,sha256=gbmlsNSi96sIig0mrtHzZAZT_fOIWToe-YnW7v5ptKI,30645
|
|
18
|
+
requests/starter.py,sha256=aRUNDSaYOUo9Mcg6B_4su-7-a2od4LYn5nDBnjZdp1I,116
|
|
19
|
+
requests/status_codes.py,sha256=iJUAeA25baTdw-6PfD0eF4qhpINDJRJI-yaMqxs4LEI,4322
|
|
20
|
+
requests/structures.py,sha256=-IbmhVz06S-5aPSZuUthZ6-6D9XOjRuTXHOabY041XM,2912
|
|
21
|
+
requests/utils.py,sha256=xDMVThT3jebVDqf-dTgluLuzyUWUaN7gUvi2jtwlctw,33091
|
|
22
|
+
hive_setting-2.33.0.dist-info/METADATA,sha256=1FPmp6DiS47QLoQFhOUZ4dauLNfWpLKAYbat0bgYy0c,5258
|
|
23
|
+
hive_setting-2.33.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
24
|
+
hive_setting-2.33.0.dist-info/entry_points.txt,sha256=bb0i56x0Arj0sQJHrwXZJemYtSZiwEwfRNz2EUh1DEk,51
|
|
25
|
+
hive_setting-2.33.0.dist-info/top_level.txt,sha256=fMSVmHfb5rbGOo6xv-O_tUX6j-WyixssE-SnwcDRxNQ,9
|
|
26
|
+
hive_setting-2.33.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
requests/__init__.py
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# __
|
|
2
|
+
# /__) _ _ _ _ _/ _
|
|
3
|
+
# / ( (- (/ (/ (- _) / _)
|
|
4
|
+
# /
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
Requests HTTP Library
|
|
8
|
+
~~~~~~~~~~~~~~~~~~~~~
|
|
9
|
+
|
|
10
|
+
Requests is an HTTP library, written in Python, for human beings.
|
|
11
|
+
Basic GET usage:
|
|
12
|
+
|
|
13
|
+
>>> import requests
|
|
14
|
+
>>> r = requests.get('https://www.python.org')
|
|
15
|
+
>>> r.status_code
|
|
16
|
+
200
|
|
17
|
+
>>> b'Python is a programming language' in r.content
|
|
18
|
+
True
|
|
19
|
+
|
|
20
|
+
... or POST:
|
|
21
|
+
|
|
22
|
+
>>> payload = dict(key1='value1', key2='value2')
|
|
23
|
+
>>> r = requests.post('https://httpbin.org/post', data=payload)
|
|
24
|
+
>>> print(r.text)
|
|
25
|
+
{
|
|
26
|
+
...
|
|
27
|
+
"form": {
|
|
28
|
+
"key1": "value1",
|
|
29
|
+
"key2": "value2"
|
|
30
|
+
},
|
|
31
|
+
...
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
The other HTTP methods are supported - see `requests.api`. Full documentation
|
|
35
|
+
is at <https://requests.readthedocs.io>.
|
|
36
|
+
|
|
37
|
+
:copyright: (c) 2017 by Kenneth Reitz.
|
|
38
|
+
:license: Apache 2.0, see LICENSE for more details.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
import warnings
|
|
42
|
+
|
|
43
|
+
import urllib3
|
|
44
|
+
|
|
45
|
+
from .exceptions import RequestsDependencyWarning
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
from charset_normalizer import __version__ as charset_normalizer_version
|
|
49
|
+
except ImportError:
|
|
50
|
+
charset_normalizer_version = None
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
from chardet import __version__ as chardet_version
|
|
54
|
+
except ImportError:
|
|
55
|
+
chardet_version = None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def check_compatibility(urllib3_version, chardet_version, charset_normalizer_version):
|
|
59
|
+
urllib3_version = urllib3_version.split(".")
|
|
60
|
+
assert urllib3_version != ["dev"] # Verify urllib3 isn't installed from git.
|
|
61
|
+
|
|
62
|
+
# Sometimes, urllib3 only reports its version as 16.1.
|
|
63
|
+
if len(urllib3_version) == 2:
|
|
64
|
+
urllib3_version.append("0")
|
|
65
|
+
|
|
66
|
+
# Check urllib3 for compatibility.
|
|
67
|
+
major, minor, patch = urllib3_version # noqa: F811
|
|
68
|
+
major, minor, patch = int(major), int(minor), int(patch)
|
|
69
|
+
# urllib3 >= 1.21.1
|
|
70
|
+
assert major >= 1
|
|
71
|
+
if major == 1:
|
|
72
|
+
assert minor >= 21
|
|
73
|
+
|
|
74
|
+
# Check charset_normalizer for compatibility.
|
|
75
|
+
if chardet_version:
|
|
76
|
+
major, minor, patch = chardet_version.split(".")[:3]
|
|
77
|
+
major, minor, patch = int(major), int(minor), int(patch)
|
|
78
|
+
# chardet_version >= 3.0.2, < 8.0.0
|
|
79
|
+
assert (3, 0, 2) <= (major, minor, patch) < (8, 0, 0)
|
|
80
|
+
elif charset_normalizer_version:
|
|
81
|
+
major, minor, patch = charset_normalizer_version.split(".")[:3]
|
|
82
|
+
major, minor, patch = int(major), int(minor), int(patch)
|
|
83
|
+
# charset_normalizer >= 2.0.0 < 4.0.0
|
|
84
|
+
assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0)
|
|
85
|
+
else:
|
|
86
|
+
warnings.warn(
|
|
87
|
+
"Unable to find acceptable character detection dependency "
|
|
88
|
+
"(chardet or charset_normalizer).",
|
|
89
|
+
RequestsDependencyWarning,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _check_cryptography(cryptography_version):
|
|
94
|
+
# cryptography < 1.3.4
|
|
95
|
+
try:
|
|
96
|
+
cryptography_version = list(map(int, cryptography_version.split(".")))
|
|
97
|
+
except ValueError:
|
|
98
|
+
return
|
|
99
|
+
|
|
100
|
+
if cryptography_version < [1, 3, 4]:
|
|
101
|
+
warning = (
|
|
102
|
+
f"Old version of cryptography ({cryptography_version}) may cause slowdown."
|
|
103
|
+
)
|
|
104
|
+
warnings.warn(warning, RequestsDependencyWarning)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# Check imported dependencies for compatibility.
|
|
108
|
+
try:
|
|
109
|
+
check_compatibility(
|
|
110
|
+
urllib3.__version__, chardet_version, charset_normalizer_version
|
|
111
|
+
)
|
|
112
|
+
except (AssertionError, ValueError):
|
|
113
|
+
warnings.warn(
|
|
114
|
+
f"urllib3 ({urllib3.__version__}) or chardet "
|
|
115
|
+
f"({chardet_version})/charset_normalizer ({charset_normalizer_version}) "
|
|
116
|
+
"doesn't match a supported version!",
|
|
117
|
+
RequestsDependencyWarning,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
# Attempt to enable urllib3's fallback for SNI support
|
|
121
|
+
# if the standard library doesn't support SNI or the
|
|
122
|
+
# 'ssl' library isn't available.
|
|
123
|
+
try:
|
|
124
|
+
try:
|
|
125
|
+
import ssl
|
|
126
|
+
except ImportError:
|
|
127
|
+
ssl = None
|
|
128
|
+
|
|
129
|
+
if not getattr(ssl, "HAS_SNI", False):
|
|
130
|
+
from urllib3.contrib import pyopenssl
|
|
131
|
+
|
|
132
|
+
pyopenssl.inject_into_urllib3()
|
|
133
|
+
|
|
134
|
+
# Check cryptography version
|
|
135
|
+
from cryptography import __version__ as cryptography_version
|
|
136
|
+
|
|
137
|
+
_check_cryptography(cryptography_version)
|
|
138
|
+
except ImportError:
|
|
139
|
+
pass
|
|
140
|
+
|
|
141
|
+
# urllib3's DependencyWarnings should be silenced.
|
|
142
|
+
from urllib3.exceptions import DependencyWarning
|
|
143
|
+
|
|
144
|
+
warnings.simplefilter("ignore", DependencyWarning)
|
|
145
|
+
|
|
146
|
+
# Set default logging handler to avoid "No handler found" warnings.
|
|
147
|
+
import logging
|
|
148
|
+
from logging import NullHandler
|
|
149
|
+
|
|
150
|
+
from . import packages, utils
|
|
151
|
+
from .__version__ import (
|
|
152
|
+
__author__,
|
|
153
|
+
__author_email__,
|
|
154
|
+
__build__,
|
|
155
|
+
__cake__,
|
|
156
|
+
__copyright__,
|
|
157
|
+
__description__,
|
|
158
|
+
__license__,
|
|
159
|
+
__title__,
|
|
160
|
+
__url__,
|
|
161
|
+
__version__,
|
|
162
|
+
)
|
|
163
|
+
from .api import delete, get, head, options, patch, post, put, request
|
|
164
|
+
from .exceptions import (
|
|
165
|
+
ConnectionError,
|
|
166
|
+
ConnectTimeout,
|
|
167
|
+
FileModeWarning,
|
|
168
|
+
HTTPError,
|
|
169
|
+
JSONDecodeError,
|
|
170
|
+
ReadTimeout,
|
|
171
|
+
RequestException,
|
|
172
|
+
Timeout,
|
|
173
|
+
TooManyRedirects,
|
|
174
|
+
URLRequired,
|
|
175
|
+
)
|
|
176
|
+
from .models import PreparedRequest, Request, Response
|
|
177
|
+
from .sessions import Session, session
|
|
178
|
+
from .status_codes import codes
|
|
179
|
+
|
|
180
|
+
logging.getLogger(__name__).addHandler(NullHandler())
|
|
181
|
+
|
|
182
|
+
# FileModeWarnings go off per the default.
|
|
183
|
+
warnings.simplefilter("default", FileModeWarning, append=True)
|
requests/__version__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# .-. .-. .-. . . .-. .-. .-. .-.
|
|
2
|
+
# |( |- |.| | | |- `-. | `-.
|
|
3
|
+
# ' ' `-' `-`.`-' `-' `-' ' `-'
|
|
4
|
+
|
|
5
|
+
__title__ = "requests"
|
|
6
|
+
__description__ = "Python HTTP for Humans."
|
|
7
|
+
__url__ = "https://requests.readthedocs.io"
|
|
8
|
+
__version__ = "2.33.0"
|
|
9
|
+
__build__ = 0x023300
|
|
10
|
+
__author__ = "Kenneth Reitz"
|
|
11
|
+
__author_email__ = "me@kennethreitz.org"
|
|
12
|
+
__license__ = "Apache-2.0"
|
|
13
|
+
__copyright__ = "Copyright Kenneth Reitz"
|
|
14
|
+
__cake__ = "\u2728 \U0001f370 \u2728"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
requests._internal_utils
|
|
3
|
+
~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
Provides utility functions that are consumed internally by Requests
|
|
6
|
+
which depend on extremely few external helpers (such as compat)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import re
|
|
10
|
+
|
|
11
|
+
from .compat import builtin_str
|
|
12
|
+
|
|
13
|
+
_VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$")
|
|
14
|
+
_VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*$")
|
|
15
|
+
_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*$|^$")
|
|
16
|
+
_VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*$|^$")
|
|
17
|
+
|
|
18
|
+
_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR)
|
|
19
|
+
_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE)
|
|
20
|
+
HEADER_VALIDATORS = {
|
|
21
|
+
bytes: _HEADER_VALIDATORS_BYTE,
|
|
22
|
+
str: _HEADER_VALIDATORS_STR,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def to_native_string(string, encoding="ascii"):
|
|
27
|
+
"""Given a string object, regardless of type, returns a representation of
|
|
28
|
+
that string in the native string type, encoding and decoding where
|
|
29
|
+
necessary. This assumes ASCII unless told otherwise.
|
|
30
|
+
"""
|
|
31
|
+
if isinstance(string, builtin_str):
|
|
32
|
+
out = string
|
|
33
|
+
else:
|
|
34
|
+
out = string.decode(encoding)
|
|
35
|
+
|
|
36
|
+
return out
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def unicode_is_ascii(u_string):
|
|
40
|
+
"""Determine if unicode string only contains ASCII characters.
|
|
41
|
+
|
|
42
|
+
:param str u_string: unicode string to check. Must be unicode
|
|
43
|
+
and not Python 2 `str`.
|
|
44
|
+
:rtype: bool
|
|
45
|
+
"""
|
|
46
|
+
assert isinstance(u_string, str)
|
|
47
|
+
try:
|
|
48
|
+
u_string.encode("ascii")
|
|
49
|
+
return True
|
|
50
|
+
except UnicodeEncodeError:
|
|
51
|
+
return False
|