requests-ntlm
This package allows for HTTP NTLM authentication using the requests library.
What it is and what it does
requests-ntlm bridges the gap between the requests library and Windows NTLM authentication, a protocol commonly required by corporate and legacy HTTP servers. It provides an HttpNtlmAuth class that integrates directly with requests' authentication framework, handling the NTLM challenge-response handshake transparently. The package depends on pyspnego for protocol handling and cryptography for cryptographic operations.
Typical usage involves passing HttpNtlmAuth to a request's auth parameter with domain-qualified credentials. For efficiency, the documentation recommends using requests.Session to enable connection pooling, since NTLM authenticates at the connection level rather than per-request. The package supports Python 3.8 through 3.12 and is classified as Beta, reflecting its mature but still-evolving status.
Use it for:
- Authenticate requests to corporate intranet servers that require NTLM credentials instead of basic HTTP auth.
- Build automation scripts that interact with Windows-protected APIs or file shares over HTTP.
- Integrate with legacy enterprise systems that mandate NTLM for HTTP access.
- Establish persistent sessions to NTLM-protected endpoints using connection pooling for efficiency.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds NTLM authentication support to the requests library, allowing HTTP requests to servers that require Windows NTLM credentials.
Yes, if you need to authenticate against NTLM-protected servers. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is the standard solution for this specific use case within the requests ecosystem. Not needed if your HTTP targets use standard authentication schemes.
Install
requests-ntlm on PyPI
pip
pip install requests-ntlmuv
uv add requests-ntlmpoetry
poetry add requests-ntlmInstalling requests-ntlm
Before you install
Low friction installation with three straightforward dependencies (requests, pyspnego, cryptography). Actively maintained with recent commits and a stable release history since 2013.
License in practice
ISC license is permissive, allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install requests-ntlm
import requests
from requests_ntlm import HttpNtlmAuth
requests.get('http://ntlm_protected_site.com', auth=HttpNtlmAuth('domain\\username', 'password'))
Verify before relying
- Whether connection pooling with sessions provides measurable performance gains for repeated NTLM-authenticated requests in typical workloads.
- Support for NTLM v2 and other protocol variants beyond basic NTLM authentication.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — cryptography, pyspnego, requests |
| Maintenance | actively maintained — 796 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,442,318/month — #1,187 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: requests_ntlm-1.3.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
httpx-ntlmAdds NTLM authentication support to HTTPX,…
permissive · top 15,000 on PyPI
requests-ntlm2Adds NTLM authentication support to the…
permissive · top 15,000 on PyPI
requests-ntlm3Provides HTTP NTLM authentication for the…
permissive · top 15,000 on PyPI
ntlm-authConstructs and parses NTLM authentication…
permissive · top 5,000 on PyPI
requests-credsspAdds CredSSP authentication support to the…
permissive · top 15,000 on PyPI
pyspnegoHandles SPNEGO, NTLM, Kerberos, and CredSSP…
permissive · top 1,000 on PyPI
requests-negotiate-sspiAdds HTTP Negotiate authentication…
permissive · top 15,000 on PyPI
requests-kerberosAdds Kerberos/GSSAPI authentication support to…
permissive · top 5,000 on PyPI
requests-authAdds OAuth2, API key, Basic, and NTLM…
permissive · top 15,000 on PyPI
msldapmsldap is a Python library for querying and…
permissive · top 15,000 on PyPI