sessions.py — requests Source File
Architecture documentation for sessions.py, a python file in the requests codebase. 41 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR ea1101aa_233b_1206_7b38_a38f0fe92a52["sessions.py"] ad9103ba_2c26_1ff0_c67d_e7f70c6f108c["_internal_utils.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> ad9103ba_2c26_1ff0_c67d_e7f70c6f108c 0ab29509_59a1_1f68_fae2_146376240019["to_native_string"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 0ab29509_59a1_1f68_fae2_146376240019 8cafec3a_816a_3b74_357a_0167321e5d19["adapters.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 8cafec3a_816a_3b74_357a_0167321e5d19 5fdf5d52_8295_768a_e20f_c6cefb721b91["HTTPAdapter"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 5fdf5d52_8295_768a_e20f_c6cefb721b91 d7a739b0_e73b_9565_f5ed_5e8c24943504["auth.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> d7a739b0_e73b_9565_f5ed_5e8c24943504 fa72bb6a_120a_ce88_fe4e_28d8c4d3b882["_basic_auth_str"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> fa72bb6a_120a_ce88_fe4e_28d8c4d3b882 655589d9_9504_8132_6277_d047dcd65486["compat.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 655589d9_9504_8132_6277_d047dcd65486 270696ff_2a4f_ef5b_92e8_33a79e68a2d8["cookies.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 270696ff_2a4f_ef5b_92e8_33a79e68a2d8 12ccbc5f_4c31_987c_5272_7babba58a1f2["RequestsCookieJar"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 12ccbc5f_4c31_987c_5272_7babba58a1f2 fad58eac_0316_2b83_52d3_1a1829c12c66["cookiejar_from_dict"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> fad58eac_0316_2b83_52d3_1a1829c12c66 55052edd_2a43_f298_b8d3_9fb1f2641e84["extract_cookies_to_jar"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 55052edd_2a43_f298_b8d3_9fb1f2641e84 b950528f_167e_7566_bbfa_f2e1929d1939["merge_cookies"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> b950528f_167e_7566_bbfa_f2e1929d1939 f4a2f4ac_0336_89fc_eb3c_2c88c34f05a8["exceptions.py"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> f4a2f4ac_0336_89fc_eb3c_2c88c34f05a8 4e7cf494_b6a8_f1fb_9ae2_b8ac7661e588["ChunkedEncodingError"] ea1101aa_233b_1206_7b38_a38f0fe92a52 --> 4e7cf494_b6a8_f1fb_9ae2_b8ac7661e588 style ea1101aa_233b_1206_7b38_a38f0fe92a52 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"""
requests.sessions
~~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
import sys
import time
from collections import OrderedDict
from datetime import timedelta
from ._internal_utils import to_native_string
from .adapters import HTTPAdapter
from .auth import _basic_auth_str
from .compat import Mapping, cookielib, urljoin, urlparse
from .cookies import (
RequestsCookieJar,
cookiejar_from_dict,
extract_cookies_to_jar,
merge_cookies,
)
from .exceptions import (
ChunkedEncodingError,
ContentDecodingError,
InvalidSchema,
TooManyRedirects,
)
from .hooks import default_hooks, dispatch_hook
# formerly defined here, reexposed here for backward compatibility
from .models import ( # noqa: F401
DEFAULT_REDIRECT_LIMIT,
REDIRECT_STATI,
PreparedRequest,
Request,
)
from .status_codes import codes
from .structures import CaseInsensitiveDict
from .utils import ( # noqa: F401
DEFAULT_PORTS,
default_headers,
get_auth_from_url,
get_environ_proxies,
get_netrc_auth,
requote_uri,
resolve_proxies,
rewind_body,
should_bypass_proxies,
to_key_val_list,
)
# Preferred clock, based on which one is more accurate on a given system.
if sys.platform == "win32":
preferred_clock = time.perf_counter
else:
preferred_clock = time.time
// ... (773 more lines)
Domain
Subdomains
Classes
Dependencies
- CaseInsensitiveDict
- ChunkedEncodingError
- ContentDecodingError
- HTTPAdapter
- InvalidSchema
- PreparedRequest
- Request
- RequestsCookieJar
- TooManyRedirects
- _basic_auth_str
- _internal_utils.py
- adapters.py
- auth.py
- collections
- compat.py
- cookiejar_from_dict
- cookies.py
- datetime
- default_headers
- default_hooks
- dispatch_hook
- exceptions.py
- extract_cookies_to_jar
- get_auth_from_url
- get_environ_proxies
- get_netrc_auth
- hooks.py
- merge_cookies
- models.py
- os
- requote_uri
- resolve_proxies
- rewind_body
- should_bypass_proxies
- status_codes.py
- structures.py
- sys
- time
- to_key_val_list
- to_native_string
- utils.py
Imported By
Source
Frequently Asked Questions
What does sessions.py do?
sessions.py is a source file in the requests codebase, written in python. It belongs to the CoreAPI domain, VerbHandlers subdomain.
What functions are defined in sessions.py?
sessions.py defines 4 function(s): merge_hooks, merge_setting, preferred_clock, session.
What does sessions.py depend on?
sessions.py imports 41 module(s): CaseInsensitiveDict, ChunkedEncodingError, ContentDecodingError, HTTPAdapter, InvalidSchema, PreparedRequest, Request, RequestsCookieJar, and 33 more.
What files import sessions.py?
sessions.py is imported by 1 file(s): __init__.py.
Where is sessions.py in the architecture?
sessions.py is located at src/requests/sessions.py (domain: CoreAPI, subdomain: VerbHandlers, directory: src/requests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free