skillfed

requests-ntlm

This package allows for HTTP NTLM authentication using the requests library.

requests-ntlm v1.3.0 15.4M downloads/30d#1,187 on PyPI345
Permissive license ISC Active released

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-ntlm

uv

uv add requests-ntlm

poetry

poetry add requests-ntlm

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

ntlm authentication requestswindows ntlm http authrequests ntlm supporthttp ntlm credentialsdomain authentication requestswindows domain http auth
authenticationwindows-integrationenterprise

More WWW/HTTP packages