Repository guide · architecture · v1
psf / requests · Architecture
A Python repository of 130 files organized into docs, src and tests subsystems. Two verified script entrypoints live in src/requests (certs.py, help.py) plus a heuristic test-server entrypoint. Static analysis resolved 501 local relations against 2,579 unresolved, and every listed execution path ends at an unresolved boundary. Module roles are inferred from static call degrees.
- Original repository
- psf/requests
- License
- Apache-2.0 · open-source license
- Analyzed revision · last verified
- dae7ef63b4df6eded86637f251fc4e3a06c3b479 ·
Newer revision observed; the code this guide cites is unchanged. The default branch moved to 611c6162cbc4, checked 2026-10-03. A revision diff of 1 changed files found no change in the code regions this guide cites. The guide still describes revision dae7ef63b4df; repository-wide counts (files, calls and so on) refer to that revision.
psf/requests: Architecture and Control Flow
Terms used on this page
- Entrypoint record
- A file the analyzer marks as a place where execution can start. When it carries a __main__ guard excerpt, the file contains an if __name__ == "__main__": block and the excerpt shows what that block calls; without an excerpt, the file was flagged by its name only.
- Bounded static execution path
- A call chain reconstructed from the source code without running it, stopped after a fixed number of steps. It shows how far the code can be followed on paper, not what happens at run time.
- Unresolved boundary
- Where a static path stops because the next call goes into an external library or cannot be resolved without running the code. It marks the edge of this analysis, not a defect in the repository.
- Static relations
- Calls and imports found in the source. "External or unresolved" relations point outside the analyzed files.
- Module role
- The analyzer's label for a file, inferred from how many calls go in and out (for example core, entry/orchestration, leaf). It describes a position in the call graph, not the authors' design.
- Test-like files
- Files whose names or locations look like tests. This analysis counts them; it does not run them.
- Observed · inferred · author-claimed · unresolved
- How each statement is supported: read directly from the analyzed files; derived by the analyzer from them; stated by the repository's authors (metadata, README); or not established by this analysis.
- Verified
- Two uses on these pages. In an analyzer record ("verified provenance", "a verified entrypoint") it means the record was read directly from the analyzed files, which these guides call observed; for an entrypoint, the __main__ guard text is present. Since the analyzer fix of 2026-10-04, a file that only has an entrypoint-like name such as cli.py or main.py is recorded as inferred; guides analyzed before that still call such a file verified, and it is still only a guess about how the file is used. It does not mean the code was run or tested. "Last verified" is the date the guide last passed the lab's checks against the analysis record of the stated revision; it is not a review of the repository itself.
Shape at a glance
GitHub metadata records Python as the primary language, with topics including http, client and cookies. The analyzer treats docs, src and tests as subsystems. It processed 130 files: 42 in tests, 26 in docs, 20 in src, 19 in .github, 7 in ext, and 16 at the repository root.
- src holds the requests package with modules such as certs.py, help.py, api.py, sessions.py, models.py, adapters.py, cookies.py, auth.py, exceptions.py, compat.py, _types.py, _internal_utils.py, structures.py and __init__.py.
- tests holds 42 files, including test_requests.py, test_lowlevel.py, test_adapters.py and conftest.py.
- Root-level project files are README.md, pyproject.toml, setup.py and LICENSE.
The GitHub description calls the project a simple, elegant HTTP library.
Entrypoints and control flow
The reconstruction overview counts three entrypoints, 310 resolved static call relations and 25 bounded execution paths. Two entrypoints are verified __main__ guards: running src/requests/certs.py or src/requests/help.py as a script starts there. The guards are one-liners — certs.py runs print(where()) and help.py runs main(). The third, tests/testserver/server.py, is a likely entrypoint by filename heuristic only.
Of the ten listed paths, two start at certs.py and end at once on an unresolved call to print or where. The other eight start at help.py and walk through main: two stop at json.dumps or print; two continue through info to platform.system or platform.release; four continue through info and _implementation to platform.python_implementation, platform.python_version or join. All ten end with terminal_reason unresolved_boundary; none shows a cycle or truncation, and help.py's __main__ → main → info → _implementation chain is the deepest local flow.
Core modules and inferred roles
Every role below is inferred by the analyzer from static resolved call degree and entrypoint membership, not from observed execution.
- src/requests/utils.py is the most connected in the cited records: 52 incoming and 44 outgoing calls, labeled a service/core candidate.
- sessions.py (11 in, 57 out), models.py (5 in, 54 out) and adapters.py (3 in, 38 out) are service/core candidates dominated by outgoing calls.
- compat.py (52 in, 1 out) and exceptions.py (37 in, 2 out) absorb many calls and emit few.
- _types.py (13 in, 0 out) and _internal_utils.py (9 in, 0 out) look like leaves.
- In tests, testserver/server.py is an entry/orchestration candidate (52 in, 2 out) and test_lowlevel.py an orchestration candidate (0 in, 32 out).
- cookies.py, api.py, auth.py, structures.py, help.py and __init__.py fill out the cited set with moderate or small degrees.
Where static paths stop: boundaries
Static relations split sharply: 2,579 of 3,080 are external or unresolved, 501 are local, and the edges are 2,566 calls plus 514 imports. Every one of the ten listed execution paths ends at an unresolved call instead of returning into analyzed code. The stopping points are names the analyzer could not resolve: print, where, json.dumps, platform.system, platform.release, platform.python_implementation, platform.python_version and join. No listed path reaches tests/testserver/server.py or any module outside certs.py and help.py, so the test server's boot and shutdown are not traced. In effect, the packet's execution picture covers the two script modules only.
Dependencies between parts
The only parsed dependency record pins Sphinx 7.2.6 at line 3 of docs/requirements.txt, with scope recorded as runtime — documentation-side tooling for the docs subsystem. Manifest coverage is narrow: only requirements-style files are parsed, and pyproject.toml dependency tables are ignored.
Inside tests, testserver/server.py is recorded as an entry/orchestration candidate with 52 incoming calls (widely called from tests), while tests/utils.py is a leaf with 7 incoming calls. tests/test_lowlevel.py is recorded as an orchestration candidate with 0 incoming and 32 outgoing calls; tests/test_requests.py shows 1 incoming and 18 outgoing. Overall, 501 local relations were resolved against 2,579 unresolved ones, so the cross-part dependency picture is sparse.
What static analysis cannot show
The static analysis does not resolve reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring or dynamic dispatch. Install, run and build inference is partial, and no installation command has been verified. README-derived claims are line-based captures that may include code lines, so they stand only as author claims. The analyzer's capability fields describe the tooling, not this repository, and were excluded from evidence. How sessions.py, models.py and adapters.py cooperate at runtime — wiring, configuration, dispatch — is not established by this packet. 42 test-like files are recorded, but tests as behavior lie outside the static record.
A reading order for the architecture
The packet's teaching path recommends manifests and important files first, then tracing a bounded execution path, then the unresolved boundaries before changing code. A concrete order: pyproject.toml and setup.py, then src/requests/__init__.py, then compat.py and utils.py where calls concentrate, then sessions.py, models.py and adapters.py for the core, and finally the test fixtures. Close by walking help.py's local chain to its unresolved endpoints and reading tests/testserver/server.py as the shared test server.
What this analysis could not establish
The writing model's own notes on the analysis record. Identifiers such as lim_3, exec_* or claim_… name records of that analysis; the claims table cites the same records.
- 2,579 of 3,080 static relations remain external or unresolved; the analyzer preserves textual targets instead of fabricating local destinations.
- The ten listed execution paths cover only certs.py and help.py; no listed path traces the test server or any request-handling module.
- Runtime wiring, configuration, dynamic imports, monkey-patching, generated code and dynamic dispatch are not resolved by this static analysis.
- Dependency parsing covered only requirements-style manifests; the full dependency set is unknown.
- important_2 (readme.md) was excluded as a case-variant path not present in the analyzed file inventory.
- Install, run and build inference is partial and unverified.
Claims and evidence — 39 claims, 39 supported by an independent verifier
Every substantive statement above is a claim bound to grounding IDs of the analyzed revision. Global grounding IDs are namespaced by the analysis run.
| Claim | Epistemic status | Verifier | Grounding (global IDs) |
|---|---|---|---|
| c1 The analyzer processed 130 files: 42 in tests, 26 in docs, 20 in src, 19 in .github, 7 in ext, and 16 at the repository root. | inferred | supported | analysis_763ffe82876dd8ff:summary_repository |
| c2 The analyzer marks the top-level directories docs, src and tests as likely subsystems. | observed | supported | analysis_763ffe82876dd8ff:subsys_1, analysis_763ffe82876dd8ff:subsys_2, analysis_763ffe82876dd8ff:subsys_3 |
| c3 Platform metadata records Python as the primary language; observed topics include http, client, cookies and python. | observed | supported | analysis_763ffe82876dd8ff:meta_primary_language, analysis_763ffe82876dd8ff:meta_topics |
| c4 The src/requests package includes certs.py, help.py, api.py, sessions.py, models.py, adapters.py, cookies.py, auth.py, exceptions.py, compat.py, _types.py, _internal_utils.py, structures.py and __init__.py. | inferred | supported | analysis_763ffe82876dd8ff:important_6, analysis_763ffe82876dd8ff:important_7, analysis_763ffe82876dd8ff:role_5, analysis_763ffe82876dd8ff:role_14, analysis_763ffe82876dd8ff:role_13, analysis_763ffe82876dd8ff:role_4, analysis_763ffe82876dd8ff:role_9, analysis_763ffe82876dd8ff:role_6, analysis_763ffe82876dd8ff:role_10, analysis_763ffe82876dd8ff:role_8, analysis_763ffe82876dd8ff:role_3, analysis_763ffe82876dd8ff:role_2, analysis_763ffe82876dd8ff:role_16, analysis_763ffe82876dd8ff:role_1 |
| c5 Project-level root files include README.md, pyproject.toml, setup.py and LICENSE. | observed | supported | analysis_763ffe82876dd8ff:important_1, analysis_763ffe82876dd8ff:important_3, analysis_763ffe82876dd8ff:important_4, analysis_763ffe82876dd8ff:important_5 |
| c6 The tests directory holds 42 files; the packet samples compat.py, conftest.py, test_adapters.py, test_help.py, test_hooks.py, test_lowlevel.py, test_packages.py and test_requests.py. | inferred | supported | analysis_763ffe82876dd8ff:summary_repository |
| c7 The repository's GitHub description calls it a simple, elegant HTTP library. | author_claimed | supported | analysis_763ffe82876dd8ff:meta_description |
| c8 Verified __main__ execution guards exist in src/requests/certs.py and src/requests/help.py. | observed | supported | analysis_763ffe82876dd8ff:py_entry_c4353d3e17f2, analysis_763ffe82876dd8ff:py_entry_427794f1977b |
| c9 tests/testserver/server.py is flagged as a likely executable entrypoint by filename heuristic only. | observed | supported | analysis_763ffe82876dd8ff:entry_1 |
| c10 The reconstruction overview reports 3 entrypoints, 310 resolved static call relations and 25 bounded execution paths across 130 analyzed files. | inferred | supported | analysis_763ffe82876dd8ff:architecture_reconstruction |
| c11 Of the ten listed paths, the two starting at certs.py's __main__ make a single unresolved call, to print or to where, and stop with terminal_reason unresolved_boundary. | inferred | supported | analysis_763ffe82876dd8ff:exec_93f8c1e20c5d, analysis_763ffe82876dd8ff:exec_2086333cc0b6 |
| c12 Of the ten listed paths, eight start at help.py's __main__ and descend through main: two end at json.dumps or print; two continue through info to platform.system or platform.release; four continue through info and _implementation to platform.python_implementation, platform.python_version or join. | inferred | supported | analysis_763ffe82876dd8ff:exec_ddf141e463b8, analysis_763ffe82876dd8ff:exec_9fd360c8e6bc, analysis_763ffe82876dd8ff:exec_284f54e6d357, analysis_763ffe82876dd8ff:exec_40ecf947a80f, analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_78baa37788a3, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:exec_649814620a4d |
| c13 All ten listed paths terminate with terminal_reason unresolved_boundary, none reports a cycle or truncation, and the deepest local chain is __main__ → main → info → _implementation in help.py. | inferred | supported | analysis_763ffe82876dd8ff:exec_93f8c1e20c5d, analysis_763ffe82876dd8ff:exec_2086333cc0b6, analysis_763ffe82876dd8ff:exec_ddf141e463b8, analysis_763ffe82876dd8ff:exec_9fd360c8e6bc, analysis_763ffe82876dd8ff:exec_284f54e6d357, analysis_763ffe82876dd8ff:exec_40ecf947a80f, analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_78baa37788a3, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:exec_649814620a4d |
| c14 The guards are one-liners: the certs.py guard runs print(where()); the help.py guard runs main(). | observed | supported | analysis_763ffe82876dd8ff:py_entry_c4353d3e17f2, analysis_763ffe82876dd8ff:py_entry_427794f1977b |
| c15 Each role record cited in this section states its evidence basis as static resolved call degree and entrypoint membership; the roles are inferred, not observed behavior. | inferred | supported | analysis_763ffe82876dd8ff:role_17, analysis_763ffe82876dd8ff:role_14, analysis_763ffe82876dd8ff:role_13, analysis_763ffe82876dd8ff:role_4, analysis_763ffe82876dd8ff:role_8, analysis_763ffe82876dd8ff:role_10, analysis_763ffe82876dd8ff:role_3, analysis_763ffe82876dd8ff:role_2, analysis_763ffe82876dd8ff:role_25, analysis_763ffe82876dd8ff:role_21, analysis_763ffe82876dd8ff:role_9, analysis_763ffe82876dd8ff:role_5, analysis_763ffe82876dd8ff:role_6, analysis_763ffe82876dd8ff:role_16, analysis_763ffe82876dd8ff:role_11, analysis_763ffe82876dd8ff:role_1 |
| c16 src/requests/utils.py is the most connected in the cited records: 52 incoming and 44 outgoing resolved calls, labeled a service/core candidate. | inferred | supported | analysis_763ffe82876dd8ff:role_17 |
| c17 sessions.py (11 in, 57 out), models.py (5 in, 54 out) and adapters.py (3 in, 38 out) are service/core candidates dominated by outgoing calls. | inferred | supported | analysis_763ffe82876dd8ff:role_14, analysis_763ffe82876dd8ff:role_13, analysis_763ffe82876dd8ff:role_4 |
| c18 compat.py (52 in, 1 out) and exceptions.py (37 in, 2 out) are service/core candidates that absorb many calls and emit few. | inferred | supported | analysis_763ffe82876dd8ff:role_8, analysis_763ffe82876dd8ff:role_10 |
| c19 _types.py (13 in, 0 out) and _internal_utils.py (9 in, 0 out) are leaf/data-boundary candidates. | inferred | supported | analysis_763ffe82876dd8ff:role_3, analysis_763ffe82876dd8ff:role_2 |
| c20 tests/testserver/server.py is an entry/orchestration candidate (52 in, 2 out) and tests/test_lowlevel.py an orchestration candidate (0 in, 32 out). | inferred | supported | analysis_763ffe82876dd8ff:role_25, analysis_763ffe82876dd8ff:role_21 |
| c21 cookies.py (30 in, 20 out), api.py (7 in, 8 out), auth.py (5 in, 9 out), structures.py (7 in, 2 out), help.py (3 in, 3 out) and __init__.py (2 in, 2 out) fill out the cited set. | inferred | supported | analysis_763ffe82876dd8ff:role_9, analysis_763ffe82876dd8ff:role_5, analysis_763ffe82876dd8ff:role_6, analysis_763ffe82876dd8ff:role_16, analysis_763ffe82876dd8ff:role_11, analysis_763ffe82876dd8ff:role_1 |
| c22 Of 3,080 recorded static relations, 2,579 are external_or_unresolved and 501 local; by type there are 2,566 calls and 514 imports. | observed | supported | analysis_763ffe82876dd8ff:relation_counts |
| c23 All ten listed execution paths stop at an external or unresolved target rather than returning into analyzed code. | inferred | supported | analysis_763ffe82876dd8ff:exec_93f8c1e20c5d, analysis_763ffe82876dd8ff:exec_2086333cc0b6, analysis_763ffe82876dd8ff:exec_ddf141e463b8, analysis_763ffe82876dd8ff:exec_9fd360c8e6bc, analysis_763ffe82876dd8ff:exec_284f54e6d357, analysis_763ffe82876dd8ff:exec_40ecf947a80f, analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_78baa37788a3, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:exec_649814620a4d |
| c24 Unresolved targets reached at path ends include print, where, json.dumps, platform.system, platform.release, platform.python_implementation, platform.python_version and join. | inferred | supported | analysis_763ffe82876dd8ff:exec_93f8c1e20c5d, analysis_763ffe82876dd8ff:exec_2086333cc0b6, analysis_763ffe82876dd8ff:exec_ddf141e463b8, analysis_763ffe82876dd8ff:exec_9fd360c8e6bc, analysis_763ffe82876dd8ff:exec_284f54e6d357, analysis_763ffe82876dd8ff:exec_40ecf947a80f, analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_78baa37788a3, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:exec_649814620a4d |
| c25 None of the ten listed paths reaches tests/testserver/server.py or any module outside certs.py and help.py; the test server's boot and shutdown are not traced by these paths. | inferred | supported | analysis_763ffe82876dd8ff:exec_93f8c1e20c5d, analysis_763ffe82876dd8ff:exec_2086333cc0b6, analysis_763ffe82876dd8ff:exec_ddf141e463b8, analysis_763ffe82876dd8ff:exec_9fd360c8e6bc, analysis_763ffe82876dd8ff:exec_284f54e6d357, analysis_763ffe82876dd8ff:exec_40ecf947a80f, analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_78baa37788a3, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:exec_649814620a4d, analysis_763ffe82876dd8ff:entry_1 |
| c26 The only parsed dependency record pins Sphinx 7.2.6 at line 3 of docs/requirements.txt, with scope recorded as runtime — documentation-side tooling for the docs subsystem. | inferred | supported | analysis_763ffe82876dd8ff:dep_1 |
| c27 Dependency extraction covers requirements-style manifests only; pyproject.toml dependency tables are not parsed. | observed | supported | analysis_763ffe82876dd8ff:lim_3 |
| c28 Among the cited role records, tests/testserver/server.py is recorded as an entry/orchestration candidate with 52 incoming calls (widely called from tests), while tests/utils.py is a leaf candidate with 7 incoming calls. | inferred | supported | analysis_763ffe82876dd8ff:role_25, analysis_763ffe82876dd8ff:role_26 |
| c29 tests/test_lowlevel.py is recorded as an orchestration candidate with 0 incoming and 32 outgoing calls; tests/test_requests.py shows 1 incoming and 18 outgoing. | inferred | supported | analysis_763ffe82876dd8ff:role_21, analysis_763ffe82876dd8ff:role_22 |
| c30 With 501 local relations resolved against 2,579 unresolved, the resolved dependency map covers only a fraction of the code's references. | inferred | supported | analysis_763ffe82876dd8ff:relation_counts |
| c31 The analyzer does not resolve reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring or dynamic dispatch. | observed | supported | analysis_763ffe82876dd8ff:lim_1 |
| c32 Install, run and build inference is partial, and installation commands are not verified. | observed | supported | analysis_763ffe82876dd8ff:lim_2 |
| c33 README claim extraction is line-based and may capture code lines instead of prose; README-derived text is author-claimed at best. | observed | supported | analysis_763ffe82876dd8ff:lim_4 |
| c34 The manifest's capability fields describe the analyzer, not the analyzed repository, and are excluded from evidence. | observed | supported | analysis_763ffe82876dd8ff:lim_5 |
| c35 How sessions.py, models.py and adapters.py cooperate at runtime — wiring, configuration, dispatch — is not established by this packet. | unresolved | supported | analysis_763ffe82876dd8ff:lim_1 |
| c36 The record lists 42 test-like files, but tests as behavior — what actually happens at run time — is outside the static record. | inferred | supported | analysis_763ffe82876dd8ff:summary_repository, analysis_763ffe82876dd8ff:lim_1 |
| c37 The packet's teaching path suggests starting with manifests and important files, tracing a bounded execution path, and inspecting unresolved boundaries before changing code. | inferred | supported | analysis_763ffe82876dd8ff:claim_e56db45165bf, analysis_763ffe82876dd8ff:important_1 |
| c38 A grounded order: pyproject.toml and setup.py for packaging, then src/requests/__init__.py, then compat.py and utils.py where incoming calls concentrate, then sessions.py, models.py and adapters.py, then the test fixtures. | inferred | supported | analysis_763ffe82876dd8ff:important_3, analysis_763ffe82876dd8ff:important_4, analysis_763ffe82876dd8ff:role_1, analysis_763ffe82876dd8ff:role_8, analysis_763ffe82876dd8ff:role_17, analysis_763ffe82876dd8ff:role_14, analysis_763ffe82876dd8ff:role_13, analysis_763ffe82876dd8ff:role_4, analysis_763ffe82876dd8ff:role_25 |
| c39 Finish by walking help.py's local chain to its unresolved endpoints and reading tests/testserver/server.py as the shared test-server fixture and heuristic entrypoint. | inferred | supported | analysis_763ffe82876dd8ff:exec_3e8a0a88354b, analysis_763ffe82876dd8ff:exec_29cc47356282, analysis_763ffe82876dd8ff:entry_1, analysis_763ffe82876dd8ff:role_25 |
Sources, rights and disclosure · attribution-license-templates/v0.1
Rights notice. Original repository hosted on GitHub. Repository source code, documentation, names, media, and related project materials remain subject to the rights of their respective authors, contributors, and other rights holders and to applicable repository license terms.
Platform notice. GitHub is the source hosting platform for the linked repository. GitHub and related marks are trademarks of GitHub, Inc. EVEMISS Technology is not affiliated with or endorsed by GitHub unless explicitly stated otherwise.
How this page is produced. This page was produced using revision-aware repository analysis and AI-assisted editorial tooling. Technical claims are tied to the analyzed repository revision and may be revalidated when the source repository changes.
AI-assisted analysis. Reviewed by EVEMISS Technology through human–AI collaborative review. · Report a rights concern · Back to the overview