skillfed

smbprotocol

Interact with a server using the SMB 2/3 Protocol

smbprotocol v1.17.0 12.5M downloads/30d#1,315 on PyPI401
Permissive license MIT Active released

What it is and what it does

smbprotocol is a Python client library that implements the SMBv2 and SMBv3 network protocols, allowing your code to connect to and interact with Windows file shares, network printers, and other SMB-enabled resources. It negotiates protocol versions from SMB 2.0.2 up to SMB 3.1.1 (Windows 10/Server 2016 level) and handles authentication via NTLM or Kerberos, message signing, and encryption for SMBv3 connections.

The library offers two interfaces: a low-level protocol API for fine-grained control and a higher-level interface that mirrors Python's built-in os and os.path functions for simpler file operations. Connections are pooled and DFS referrals are cached, making it suitable for everyday file-sharing tasks without verbose boilerplate.

Use it for:

  • Access and manage files on Windows network shares from Linux or macOS without mounting SMB volumes.
  • Automate backup or synchronization of files from remote SMB servers in Python scripts.
  • Build cross-platform file management tools that work with network-shared files using the higher-level interface.
  • Authenticate to corporate SMB servers using Kerberos in domain environments.
  • Read or write files on network printers and other SMB-enabled devices programmatically.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SMBv2 and SMBv3 client library for Python that enables reading, writing, and managing files on remote SMB/CIFS network shares with support for NTLM and Kerberos authentication.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It fills a genuine need for SMB protocol support in Python with both simple and advanced interfaces. Install it if you need to interact with Windows file shares or other SMB resources from Python; the main gotcha is the Python 3.10+ requirement and optional Kerberos setup on Linux.

Install

smbprotocol on PyPI

pip

pip install smbprotocol

uv

uv add smbprotocol

poetry

poetry add smbprotocol

Installing smbprotocol

Before you install

Low install friction with a pure-Python wheel and only two runtime dependencies (cryptography and pyspnego). Actively maintained with last commit 2026-07-07. Kerberos support on Linux requires optional system libraries, but basic NTLM authentication works without them.

License in practice

MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install smbprotocol

from smbprotocol.connection import Connection, Dialects
import uuid

connection = Connection(uuid.uuid4(), "server", 445)
connection.connect(Dialects.SMB_3_0_2)

Requires Python 3.10 or later. Kerberos authentication on Linux requires additional system packages (libkrb5-dev) and python-gssapi; Windows Kerberos works out of the box via pyspnego.

Verify before relying

  • Whether DFS (Distributed File System) support is production-ready or still experimental as described in the excerpt.
  • Performance characteristics and scalability limits for concurrent connections or large file transfers.
  • Whether all SMB 3.1.1 features are fully implemented or if there are known gaps beyond the backlog mentioned.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — cryptography, pyspnego
Maintenance actively maintained — 38 days since the last release
Last repo commit
First released
Downloads 12,507,553/month — #1,315 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: smbprotocol-1.17.0-py3-none-any.whl

Keywords: smb, smb2, smb3, cifs, python

Development Status :: 4 - BetaProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

smb client pythonsmb2 smb3 protocolnetwork file sharingcifs share accesswindows file sharingntlm kerberos authremote file operations
smb-cifsnetwork-protocolsfile-sharing

More Networking packages