Are Python requests deprecated?

Oct 22, 2023 ยท 3 min read

Introduction

The Python Requests module is one of the most popular Python libraries for making HTTP requests. With over 50,000 stars on GitHub and millions of downloads per week, Requests allows Python developers to interact with web services and APIs with minimal code.

Despite its popularity, some confusion has emerged in the past few years over whether Requests is deprecated, primarily stemming from how Amazon Web Services (AWS) bundled the library. This article will provide a comprehensive overview explaining why Requests remains an actively maintained library.

Requests Status

The current stable version of Requests is 2.28.1, released in June 2022. The project sees new releases quite frequently - there were 5 minor releases made just in 2022.

On GitHub, Requests has over 50,000 stars and 9,000 forks, indicating its popularity among developers. It is downloaded over 30 million times per week from PyPI.

Requests is actively maintained by Kenneth Reitz, original author of the library, along with Lukasa and nateprewitt. The development team continuously adds new features, improvements, and bug fixes.

Confusion with AWS botocore

In the past, AWS bundled the Requests library with its botocore Python package. This vendored version of Requests was old and showed deprecation warnings, causing confusion that Requests itself was deprecated.

To clarify, the vendored version of Requests in botocore was deprecated by AWS, not Requests as a library. AWS later removed their bundled version entirely and advised users to install Requests directly. But this caused many developers to mistakenly believe Requests was deprecated.

Supported Python Versions

Requests originally supported Python 2.6 through 3.5. In June 2022, Requests dropped support for Python 2.7 and 3.6 with the 2.28.0 release.

Currently, Requests supports Python 3.7 and above. There are no plans to drop support for Python 3.7+.

# Python 2.7 no longer supported
import requests

# Python 3.7+ supported
import requests

Release History

Requests follows semantic versioning. Recent major releases were 2.28.0 in June 2022 and 2.27.0 in January 2022. The project aims for a major release every 6-12 months.

Minor releases with bug fixes and improvements are much more frequent, averaging 5-6 per year. For example, 2.28.1 fixed proxy URL parsing bugs while 2.27.1 improved error messages.

The release history shows active maintenance of the project. The development team is responsive to issues reported and proactively fixes bugs.

License and Governance

Requests is licensed under the Apache 2.0 license, allowing it to be used in both open source and commercial projects.

As Requests is a Python Software Foundation project, it follows a meritocratic governance model. Active contributors gain more influence and can eventually become core maintainers.

On GitHub, Requests has 200+ contributors. The main decision makers are the 3 lead maintainers, with input from other contributors.

Alternatives

Some alternatives to Requests include:

  • httpx - More recent, supports HTTP/2
  • aiohttp - Asynchronous HTTP client for asyncio
  • urllib3 - Lower-level HTTP library that Requests is built on
  • httpie - User-friendly terminal HTTP client
  • Requests compares favorably to most alternatives in terms of features, documentation quality, performance, and ease of use.

    Conclusion

    In summary, Python's Requests module remains an actively maintained library with frequent releases supporting the latest Python versions. The confusion around its deprecation stemmed from incorrect warnings caused by AWS bundling an outdated vendored copy. Requests itself is not deprecated and continues to be one of the most popular and recommended ways to make HTTP requests from Python.

    References

  • Requests Documentation: https://docs.python-requests.org
  • Requests GitHub Repo: https://github.com/psf/requests
  • Requests Release Notes: https://requests.readthedocs.io/en/latest/community/release-process/
  • Browse by tags:

    Browse by language:

    The easiest way to do Web Scraping

    Get HTML from any page with a simple API call. We handle proxy rotation, browser identities, automatic retries, CAPTCHAs, JavaScript rendering, etc automatically for you


    Try ProxiesAPI for free

    curl "http://api.proxiesapi.com/?key=API_KEY&url=https://example.com"

    <!doctype html>
    <html>
    <head>
        <title>Example Domain</title>
        <meta charset="utf-8" />
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
    ...

    X

    Don't leave just yet!

    Enter your email below to claim your free API key: