HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
kennethreitz
requests
Python2011–2019
kennethreitz / requests

requests

A simple, yet elegant HTTP library.

30Distinct people
31Mentions
0Explicit recommenders
314GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A simple, yet elegant HTTP library.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year31 dated mentions

Observed mentions: 2011-08-04 15:56:11 UTC to 2019-03-18 17:22:40 UTC.

0123452011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC505
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC413
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC211
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC404
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC514
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC514
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC505
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Requests Requests is a simple, yet elegant, HTTP library. >>> import requests >>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf8' >>> r.encoding 'utf-8' >>> r.text '{"authenticated": true, ...' >>> r.json() {'authenticated': True, ...} Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method! Requests is one of the most downloaded Python packages today, pulling in around 30M downloads / week— according to GitHub, Requests is currently depended upon by 1,000,000+ repositories. You may certainly put your trust in this code. Installing Requests and Supported Versions Requests is available on PyPI: $ python -m pip install requests Requests officially supports Python 3.8+. Supported Features & Best–Practices Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today. Keep-Alive & Connection Pooling International Domains and URLs Sessions with Cookie Persistence Browser-style TLS/SSL Verification Basic & Digest Authentication Familiar dict–like Cookies Automatic Content Decompression and Decoding Multi-part File Uploads SOCKS Proxy Support Connection Timeouts Streaming Downloads Automatic honoring of .netrc Chunked HTTP Requests API Reference and User Guide available on Read the Docs Cloning the repository When cloning the Requests repository, you may need to add the -c fetch.fsck.badTimezone=ignore flag to avoid an error about a bad commit (see this issue for more background): git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git You can also apply this setting to your global Git config: git config --global fetch.fsck.badTimezone ignore
Read the full README on GitHub

What Hacker News says

31 sources
"wouldn't this be a bit more useful if it printed a diff of the old-vs-new?" I like the idea. If I had to do this quickly, I'd be tempted to use cron, diff and wget as a script. I can't see any handling of HTTP response codes [0] so lots of things could happen that need handling. Does Go have equivalent to the fabulous python ^Requests^ by Kenneth Reitz? [1] Page diffs is a nice feature I might add to a page size tool I hacked up. [2] Reference [0] https://tools.ietf.org/html/rfc2616#section-6 [1] https://github.com/kennethreitz/requests [2] https://github.com/peterrenshaw/pageglut
In Monitor web page changes with Go
I don't agree with allowing characters to go over 80 - there is rarely a time the code can't be broken down to fit. 80 characters helps a lot since you can count on all code to fit within a certain area - so you can run three side/side text buffers in your text editor, instead of two with lots of useless white space because a few lines might be too long. Doing a simple overview of the requests library, most of the lines over 80 characters are just laziness such as: https://github.com/kennethreitz/requests/blob/master/tests/t... And a few of the actual potential cases for going over 80 characters can still be broken down without losing any readability: https://github.com/kennethreitz/requests/blob/master/request... r.headers['Proxy-Authorization'] = _basic_auth_str(self.username,
Read the rest
self.password)
In If I could amend PEP 8
For Python, I really like reading Kenneth Reitz' code. For example the Requests library is pretty good reading [0]. When reading code, I like to have the documentation handy as well [1]. The Django project is also good reading. [2], [3] [0] - Requests code: https://github.com/kennethreitz/requests [1] - Requests documentation: http://docs.python-requests.org/en/master/ [2] - Django code: https://github.com/django/django [3] - Django documentation: https://docs.djangoproject.com/en/1.10/
In One Way to Improve Your Coding
Nice post as alway from Kenneth. However, this workflow has a little drawback. If you have a dependency not from pipy, e.g. `pip install git+ssh://github.com/kennethreitz/requests.git@master`, it won't work.
In A Better Pip Workflow
Yeah, so this is an interesting feature because in my experience it doesn't work. [We added one](https://github.com/kennethreitz/requests/blob/master/CONTRIB...) for the Requests module a little while ago because we kept getting bug reports that contained incomplete tracebacks or vague problem statements, or questions that were better suited to Stack Overflow. However, we still get plenty of issues opened that suggest that the user hasn't read the CONTRIBUTING.md. We still get questions on the tracker, we still get people not telling us what version they're using or what platform they're running on. What I want to know is: is this our fault? Is our text bad? Or does GitHub's UI not accentuate the need to read this document firmly enough?
In Starters and Maintainers
Jumping on the Kenneth Reitz train, you might check out The Hitchhiker's Guide to Python: http://docs.python-guide.org/en/latest/ He recommends the following Python projects for reading: * Howdoi (https://github.com/gleitz/howdoi) * Flask (https://github.com/mitsuhiko/flask) * Werkzeug (https://github.com/mitsuhiko/werkzeug) * Requests (https://github.com/kennethreitz/requests) * Tablib (https://github.com/kennethreitz/tablib) Hope that helps---good luck!
In Ask HN: Good Python codebases to read?

Showing the 15 most recent of 31 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.