pysmb
pysmb is an experimental SMB/CIFS library written in Python to support file sharing between Windows and Linux machines
What it is and what it does
pysmb is a pure-Python SMB/CIFS client library that lets you connect to and interact with Windows file shares and Samba folders from Python code. It handles the protocol negotiation and file operations needed to list directories, read files, write files, and manage shares on remote SMB servers—useful for cross-platform automation, backup scripts, and applications that need to integrate with Windows network infrastructure.
The library depends on pyasn1 for ASN.1 encoding and tqdm for progress indication. It is classified as Production/Stable and has been maintained since 2011, though it is labeled experimental in its description. The package supports both Windows and POSIX systems and carries no known security vulnerabilities.
Use it for:
- Automate file transfers to and from Windows network shares in Python scripts or applications.
- Build cross-platform backup or synchronization tools that access Samba or Windows file servers.
- List and inspect remote SMB share contents programmatically without mounting the share locally.
- Integrate Windows file sharing into headless Linux or cloud-based Python applications.
- Test SMB/CIFS client behavior in CI/CD pipelines against mock or real SMB servers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pysmb implements the SMB/CIFS protocol to let Python applications read, write, and transfer files to and from Windows file shares and Samba folders.
Yes, if you need SMB/CIFS file access from Python and can tolerate the experimental label. Low install friction, permissive license, active maintenance, and no known vulnerabilities make it a reasonable choice. Verify that the protocol coverage and Python version support match your requirements before committing to production use.
Install
pysmb on PyPI
pip
pip install pysmbuv
uv add pysmbpoetry
poetry add pysmbInstalling pysmb
Before you install
Low install friction with only 2 runtime dependencies (pyasn1, tqdm). Active maintenance with a release 6 days ago signals ongoing support.
License in practice
Licensed under zlib/libpng, a permissive license that allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install pysmb
import pysmb
# Connect to an SMB server with credentials and client name
# then list or transfer files on the remote share
Requires network access to an SMB/CIFS server; valid credentials and firewall rules are prerequisites for file operations.
Verify before relying
- Whether Python 2 support (classifiers list 2.4–2.7) is still functional or merely legacy metadata.
- Current test coverage and whether experimental status reflects incomplete protocol implementation.
- Performance characteristics and suitability for high-throughput or large-file scenarios.
- Specific API surface and which SMB/CIFS operations are fully implemented versus partial.
Package facts
| License | zlib/libpng (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pyasn1, tqdm |
| Maintenance | actively maintained — 6 days since the last release |
| First released | |
| Downloads | 2,863,617/month — #2,856 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pysmb-1.2.15-py3-none-any.whl
Keywords: windows, samba, cifs, sharing, ftp, smb, linux
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
smbprotocolSMBv2 and SMBv3 client library for Python that…
permissive · top 5,000 on PyPI
apache-airflow-providers-sambaIntegrates Samba file-sharing protocol with…
permissive · top 15,000 on PyPI
azure-storage-file-shareInteract with Azure File Share storage—create,…
permissive · top 5,000 on PyPI
magic-wormholeMagic Wormhole transfers files, directories,…
permissive · top 15,000 on PyPI
pypsexecRuns commands on remote Windows hosts via…
permissive · top 15,000 on PyPI
impacketImpacket provides low-level Python classes for…
permissive · top 15,000 on PyPI
pyminizipCreates password-encrypted ZIP files that can…
permissive · top 15,000 on PyPI
WMIWMI wraps Windows Management Instrumentation to…
permissive · top 5,000 on PyPI
pyftpdlibBuilds asynchronous FTP servers in Python with…
unclear · top 15,000 on PyPI
bacpypesBACpypes implements the BACnet protocol stack…
permissive · top 15,000 on PyPI