Home / File/ models.py — requests Source File

models.py — requests Source File

Architecture documentation for models.py, a python file in the requests codebase. 46 imports, 3 dependents.

File python CoreAPI SessionLifecycle 46 imports 3 dependents 5 classes

Entity Profile

Dependency Diagram

graph LR
  461bc6e0_32e7_8eab_ec87_7226e7be0d13["models.py"]
  ad9103ba_2c26_1ff0_c67d_e7f70c6f108c["_internal_utils.py"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> ad9103ba_2c26_1ff0_c67d_e7f70c6f108c
  0ab29509_59a1_1f68_fae2_146376240019["to_native_string"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 0ab29509_59a1_1f68_fae2_146376240019
  388e0e62_627f_7960_2007_7582a48924d4["unicode_is_ascii"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 388e0e62_627f_7960_2007_7582a48924d4
  d7a739b0_e73b_9565_f5ed_5e8c24943504["auth.py"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> d7a739b0_e73b_9565_f5ed_5e8c24943504
  c41420c2_875d_0fc2_d80e_b4d487807e05["HTTPBasicAuth"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> c41420c2_875d_0fc2_d80e_b4d487807e05
  655589d9_9504_8132_6277_d047dcd65486["compat.py"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 655589d9_9504_8132_6277_d047dcd65486
  f73f1552_9580_2f21_8420_b9bd4ba84777["json"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> f73f1552_9580_2f21_8420_b9bd4ba84777
  270696ff_2a4f_ef5b_92e8_33a79e68a2d8["cookies.py"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 270696ff_2a4f_ef5b_92e8_33a79e68a2d8
  6ddea2af_9af3_5723_ec92_5d6215a74222["_copy_cookie_jar"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 6ddea2af_9af3_5723_ec92_5d6215a74222
  fad58eac_0316_2b83_52d3_1a1829c12c66["cookiejar_from_dict"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> fad58eac_0316_2b83_52d3_1a1829c12c66
  457cc7d3_71b7_615b_a4c8_d4a4dbccde8d["get_cookie_header"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 457cc7d3_71b7_615b_a4c8_d4a4dbccde8d
  f4a2f4ac_0336_89fc_eb3c_2c88c34f05a8["exceptions.py"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> f4a2f4ac_0336_89fc_eb3c_2c88c34f05a8
  4e7cf494_b6a8_f1fb_9ae2_b8ac7661e588["ChunkedEncodingError"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 4e7cf494_b6a8_f1fb_9ae2_b8ac7661e588
  6d0b23d4_0fe8_9017_3d1a_9c023311c6a7["ConnectionError"]
  461bc6e0_32e7_8eab_ec87_7226e7be0d13 --> 6d0b23d4_0fe8_9017_3d1a_9c023311c6a7
  style 461bc6e0_32e7_8eab_ec87_7226e7be0d13 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""
requests.models
~~~~~~~~~~~~~~~

This module contains the primary objects that power Requests.
"""

import datetime

# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/psf/requests/issues/3578.
import encodings.idna  # noqa: F401
from io import UnsupportedOperation

from urllib3.exceptions import (
    DecodeError,
    LocationParseError,
    ProtocolError,
    ReadTimeoutError,
    SSLError,
)
from urllib3.fields import RequestField
from urllib3.filepost import encode_multipart_formdata
from urllib3.util import parse_url

from ._internal_utils import to_native_string, unicode_is_ascii
from .auth import HTTPBasicAuth
from .compat import (
    Callable,
    JSONDecodeError,
    Mapping,
    basestring,
    builtin_str,
    chardet,
    cookielib,
    urlencode,
    urlsplit,
    urlunparse,
)
from .compat import json as complexjson
from .cookies import _copy_cookie_jar, cookiejar_from_dict, get_cookie_header
from .exceptions import (
    ChunkedEncodingError,
    ConnectionError,
    ContentDecodingError,
    HTTPError,
    InvalidJSONError,
    InvalidURL,
    MissingSchema,
    StreamConsumedError,
)
from .exceptions import JSONDecodeError as RequestsJSONDecodeError
from .exceptions import SSLError as RequestsSSLError
from .hooks import default_hooks
from .status_codes import codes
from .structures import CaseInsensitiveDict
from .utils import (
    check_header_validity,
    get_auth_from_url,
// ... (982 more lines)

Domain

Subdomains

Frequently Asked Questions

What does models.py do?
models.py is a source file in the requests codebase, written in python. It belongs to the CoreAPI domain, SessionLifecycle subdomain.
What does models.py depend on?
models.py imports 46 module(s): CaseInsensitiveDict, ChunkedEncodingError, ConnectionError, ContentDecodingError, HTTPBasicAuth, HTTPError, InvalidJSONError, InvalidURL, and 38 more.
What files import models.py?
models.py is imported by 3 file(s): __init__.py, adapters.py, sessions.py.
Where is models.py in the architecture?
models.py is located at src/requests/models.py (domain: CoreAPI, subdomain: SessionLifecycle, directory: src/requests).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free