# Requests vs HTTPX: source lines of code compared

The Requests vs HTTPX comparison on OctoCounts shows side-by-side source line counts for psf/requests and encode/httpx, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, psf/requests contains 8,942 total lines (5,288 code) across 29 files, while encode/httpx contains 10,443 total lines (7,552 code) across 36 files as of 2026-08-26. encode/httpx is about 1.4x the size of psf/requests by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [psf/requests](https://octocounts.com/github/psf/requests) | [encode/httpx](https://octocounts.com/github/encode/httpx) |
| --- | ---: | ---: |
| Files | 29 | 36 |
| Total lines | 8,942 | 10,443 |
| Code lines | 5,288 | 7,552 |
| Comment lines | 2,041 | 1,223 |
| Blank lines | 1,613 | 1,668 |
| Languages counted | 9 | 6 |

Top languages in psf/requests: Python (93.6% of code), ReStructuredText (3.6% of code), TOML (2.0% of code). Top languages in encode/httpx: Python (96.8% of code), TOML (1.5% of code), Shell (1.0% of code). Python, TOML appear in both top language lists; ReStructuredText, Makefile, INI appear only in psf/requests's top languages; Shell, YAML, Markdown appear only in encode/httpx's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. psf/requests was counted at ref dae7ef63b4df6eded86637f251fc4e3a06c3b479 (commit dae7ef63b4df) on 2026-09-16; encode/httpx was counted at ref master (commit b5addb64f016) on 2026-08-26. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

psf/requests counts the Requests repository: the Python HTTP client library, its documentation, and tests. encode/httpx counts the HTTPX repository — a Python HTTP client library with both synchronous and asynchronous APIs, plus its docs and tests. Both are single-purpose client-library trees in the Python ecosystem, counted on the dates shown above; HTTPX's lower-level transport dependency lives in a separate repository and is not part of either count.

Both per-language tables are nearly single-row: overwhelmingly Python in each case, with small shares for documentation and configuration files, which makes this one of the more like-for-like comparisons on this site.

Both counts are dominated by library source and tests, with no second implementation language or generated-code mass distorting the totals, so the raw numbers are a fairly direct reading of each library's maintenance surface.

_Line count does not map to API coverage: differences between the libraries (for example sync- and async-style usage) are design properties that a source count cannot express, so read the totals as size, not capability._

Sources: [psf/requests repository](https://github.com/psf/requests) · [encode/httpx repository](https://github.com/encode/httpx). Statements verified 2026-09-16.

Evidence and next steps:

- [psf/requests SLOC report](https://octocounts.com/github/psf/requests)
- [encode/httpx SLOC report](https://octocounts.com/github/encode/httpx)
- [Compare psf/requests and encode/httpx interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fpsf%2Frequests&right=https%3A%2F%2Fgithub.com%2Fencode%2Fhttpx)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, psf/requests or encode/httpx?

encode/httpx has more code: 7,552 code lines versus 5,288 for psf/requests, about 1.4x as much, based on cached OctoCounts reports as of 2026-09-16.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for psf/requests, encode/httpx, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. psf/requests was counted at ref dae7ef63b4df6eded86637f251fc4e3a06c3b479 (commit dae7ef63b4df) on 2026-09-16; encode/httpx was counted at ref master (commit b5addb64f016) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
