requests-ntlm2
The HTTP NTLM proxy and/or server authentication library.
What it is and what it does
requests-ntlm2 is an authentication plugin for the requests library that implements NTLM (NT LAN Manager) authentication, a Windows-native challenge-response protocol. It extends requests' AuthBase class to handle NTLM handshakes transparently, allowing you to authenticate against NTLM-protected servers and proxies without manual protocol handling. The package supports multiple NTLM compatibility levels (defaulting to NTLMv2 only) and integrates with requests' Session and proxy mechanisms for connection pooling and SSL tunnel creation via HTTP CONNECT.
The package depends on requests for HTTP transport, ntlm-auth for the core NTLM protocol implementation, and cryptography for cryptographic operations. It's designed for environments where NTLM is the required authentication scheme—typically corporate Windows-based infrastructure, proxies, or legacy systems. Usage is straightforward: instantiate HttpNtlmAuth with credentials and pass it to requests' auth parameter, or mount it as a session adapter for proxy tunneling.
Use it for:
- Authenticate requests to corporate intranet servers that require NTLM credentials
- Route requests through NTLM-protected corporate proxies using HTTP CONNECT tunneling
- Maintain persistent NTLM-authenticated sessions with connection pooling to reduce handshake overhead
- Integrate NTLM authentication into Python automation or data-collection scripts targeting Windows environments
- Support legacy Windows-based APIs or services that do not accept modern OAuth or token-based auth
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds NTLM authentication support to the requests library, enabling HTTP requests to servers and proxies that require NTLM challenge-response authentication.
Yes, if you need NTLM authentication for requests in a Windows or corporate environment. The package is stable (Production/Stable classifier), permissively licensed, and has low install friction. However, the 443-day gap since last release and aging maintenance status mean you should verify compatibility with your current dependency versions and be prepared to maintain a fork if critical issues arise.
Install
requests-ntlm2 on PyPI
pip
pip install requests-ntlm2uv
uv add requests-ntlm2poetry
poetry add requests-ntlm2Installing requests-ntlm2
Before you install
Low friction install with three stable runtime dependencies (requests, ntlm-auth, cryptography). Maintenance status is aging—last release was 443 days ago, though the repository remains active with a recent commit on 2025-05-28.
License in practice
Licensed under ISC (permissive), which allows commercial and private use with minimal restrictions, making it safe to adopt in most projects.
Quickstart
pip install requests-ntlm2
import requests
from requests_ntlm2 import HttpNtlmAuth
auth = HttpNtlmAuth('domain\\username', 'password')
response = requests.get('http://ntlm_protected_site.com', auth=auth)
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the 443-day gap since last release
- Current compatibility with the latest versions of requests, ntlm-auth, and cryptography
Package facts
| License | ISC (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, ntlm-auth, cryptography |
| Maintenance | aging — 443 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 206,922/month — #9,563 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: requests_ntlm2-6.6.0-py3-none-any.whl
Keywords: NTLM, requests, proxy, authorization, NTLM dance
Tags
More Git packages
A Poetry plugin that automatically derives and…
permissive · top 5,000 on PyPI
versioningitAutomatically determines your Python package's…
permissive · top 5,000 on PyPI
word2numberConverts written-out number words (like "twenty…
permissive · top 5,000 on PyPI
lefthookLefthook is a Git hooks manager that installs…
permissive · top 15,000 on PyPI
mergify-cliMergify CLI is a command-line tool for managing…
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-ntlmAdds NTLM authentication support to the…
permissive · top 5,000 on PyPI
httpx-ntlmAdds NTLM authentication support to HTTPX,…
permissive · top 15,000 on PyPI
requests-unixsocket2Extends the requests library to make HTTP calls…
permissive · top 15,000 on PyPI
requests-credsspAdds CredSSP authentication support to the…
permissive · top 15,000 on PyPI
requests-authAdds OAuth2, API key, Basic, and NTLM…
permissive · top 15,000 on PyPI
requests-negotiate-sspiAdds HTTP Negotiate authentication…
permissive · top 15,000 on PyPI
requests-unixsocketExtends the requests library to make HTTP calls…
unclear · top 5,000 on PyPI
requests-hardenedWraps the requests library to enforce security…
permissive · top 15,000 on PyPI