Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.requests Namespace Reference

Namespaces

namespace  __version__
 
namespace  _internal_utils
 
namespace  adapters
 
namespace  api
 
namespace  auth
 
namespace  certs
 
namespace  compat
 
namespace  cookies
 
namespace  exceptions
 
namespace  help
 
namespace  hooks
 
namespace  models
 
namespace  packages
 
namespace  sessions
 
namespace  status_codes
 
namespace  structures
 
namespace  utils
 

Functions

 check_compatibility (urllib3_version, chardet_version, charset_normalizer_version)
 
 _check_cryptography (cryptography_version)
 

Variables

 charset_normalizer_version = None
 
 chardet_version = None
 
 ssl = None
 
 FileModeWarning
 
 append
 

Detailed Description

Requests HTTP Library
~~~~~~~~~~~~~~~~~~~~~

Requests is an HTTP library, written in Python, for human beings.
Basic GET usage:

   >>> import requests
   >>> r = requests.get('https://www.python.org')
   >>> r.status_code
   200
   >>> b'Python is a programming language' in r.content
   True

... or POST:

   >>> payload = dict(key1='value1', key2='value2')
   >>> r = requests.post('https://httpbin.org/post', data=payload)
   >>> print(r.text)
   {
     ...
     "form": {
       "key1": "value1",
       "key2": "value2"
     },
     ...
   }

The other HTTP methods are supported - see `requests.api`. Full documentation
is at <https://requests.readthedocs.io>.

:copyright: (c) 2017 by Kenneth Reitz.
:license: Apache 2.0, see LICENSE for more details.

Function Documentation

◆ _check_cryptography()

_check_cryptography (   cryptography_version)
protected

Definition at line 86 of file __init__.py.

86def _check_cryptography(cryptography_version):
87 # cryptography < 1.3.4
88 try:
89 cryptography_version = list(map(int, cryptography_version.split(".")))
90 except ValueError:
91 return
92
93 if cryptography_version < [1, 3, 4]:
94 warning = "Old version of cryptography ({}) may cause slowdown.".format(
95 cryptography_version
96 )
97 warnings.warn(warning, RequestsDependencyWarning)
98
99
100# Check imported dependencies for compatibility.
for i

References pip._vendor.requests.check_compatibility(), and i.

Here is the call graph for this function:

◆ check_compatibility()

check_compatibility (   urllib3_version,
  chardet_version,
  charset_normalizer_version 
)

Definition at line 55 of file __init__.py.

55def check_compatibility(urllib3_version, chardet_version, charset_normalizer_version):
56 urllib3_version = urllib3_version.split(".")
57 assert urllib3_version != ["dev"] # Verify urllib3 isn't installed from git.
58
59 # Sometimes, urllib3 only reports its version as 16.1.
60 if len(urllib3_version) == 2:
62
63 # Check urllib3 for compatibility.
64 major, minor, patch = urllib3_version # noqa: F811
65 major, minor, patch = int(major), int(minor), int(patch)
66 # urllib3 >= 1.21.1
67 assert major >= 1
68 if major == 1:
69 assert minor >= 21
70
71 # Check charset_normalizer for compatibility.
72 if chardet_version:
73 major, minor, patch = chardet_version.split(".")[:3]
74 major, minor, patch = int(major), int(minor), int(patch)
75 # chardet_version >= 3.0.2, < 6.0.0
76 assert (3, 0, 2) <= (major, minor, patch) < (6, 0, 0)
77 elif charset_normalizer_version:
78 major, minor, patch = charset_normalizer_version.split(".")[:3]
79 major, minor, patch = int(major), int(minor), int(patch)
80 # charset_normalizer >= 2.0.0 < 4.0.0
81 assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0)
82 else:
83 raise Exception("You need either charset_normalizer or chardet installed")
84
85

References i.

Referenced by pip._vendor.requests._check_cryptography().

Here is the caller graph for this function:

Variable Documentation

◆ append

append

Definition at line 182 of file __init__.py.

Referenced by RequestHooksMixin.register_hook().

◆ chardet_version

chardet_version = None

Definition at line 52 of file __init__.py.

◆ charset_normalizer_version

charset_normalizer_version = None

Definition at line 47 of file __init__.py.

◆ FileModeWarning

Definition at line 182 of file __init__.py.

◆ ssl

ssl = None

Definition at line 126 of file __init__.py.