pypsrp
PowerShell Remoting Protocol and WinRM for Python
What it is and what it does
pypsrp is a Python client library for the PowerShell Remoting Protocol (PSRP) and Windows Remote Management (WinRM) service. It enables you to execute commands, run PowerShell scripts, and transfer files to and from remote Windows hosts from any machine running Python. The library provides multiple API layers: a simple client API for common tasks (command execution, file copy), a WSMan interface for low-level protocol operations, a Windows Remote Shell (WinRS) layer for cmd execution, and a PSRP layer for creating remote runspace pools and pipelines.
The package supports multiple authentication methods including Basic, Certificate, NTLM, Negotiate/Kerberos, and CredSSP (the latter two requiring optional dependencies). It handles TLS encryption and message-level encryption, with configurable timeouts, proxies, and locale settings. The library is designed around three main components: Transport (raw message handling), Shell (protocol details), and Process (execution within a shell). It currently supports only WSMan over HTTP/HTTPS but is architected to support SSH in the future.
Use it for:
- Automate Windows server administration tasks from a Linux or macOS control machine without installing Windows-specific tools.
- Execute PowerShell scripts remotely to deploy applications, configure services, or gather system information from Windows hosts.
- Transfer files between a local machine and remote Windows servers as part of deployment or backup workflows.
- Build cross-platform infrastructure-as-code tools that manage both Unix and Windows environments from a single Python codebase.
- Create interactive remote runspace pools with multiple PowerShell pipelines for complex, asynchronous Windows automation scenarios.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Execute commands, scripts, and file operations on remote Windows hosts via PowerShell Remoting Protocol (PSRP) and Windows Remote Management (WinRM) from Python.
Yes. Active maintenance, low install friction, permissive MIT license, and no known vulnerabilities make this a solid choice for Windows remote automation. Install it if you need to execute commands or manage files on Windows hosts from Python. Verify that your target Windows environment has WinRM enabled and that you have the necessary authentication credentials or certificates.
Install
pypsrp on PyPI
pip
pip install pypsrpuv
uv add pypsrppoetry
poetry add pypsrpInstalling pypsrp
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with recent commits and a stable release cycle. Requires cryptography, pyspnego, and requests as runtime dependencies, all widely maintained.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most deployment scenarios.
Quickstart
pip install pypsrp
from pypsrp.client import Client
client = Client('remote-host', username='user', password='pass')
stdout, stderr, rc = client.execute_cmd('dir')
print(stdout)
Requires CPython 3.10 or later. Target Windows host must have WinRM service enabled and accessible over HTTP/HTTPS (default ports 5985/5986). Optional: system Kerberos libraries for Kerberos auth, or requests-credssp for CredSSP auth.
Verify before relying
- Whether the library supports SSH transport as mentioned in the description excerpt as a future goal
- Performance characteristics and scalability limits for concurrent remote operations
- Compatibility with non-standard WinRM configurations or hardened Windows environments
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — cryptography, pyspnego, requests |
| Maintenance | actively maintained — 151 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,416,612/month — #2,310 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypsrp-0.9.1-py3-none-any.whl
Keywords: winrm, psrp, winrs, windows, powershell
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pypsexecRuns commands on remote Windows hosts via…
permissive · top 15,000 on PyPI
pywinrmpywinrm is a Python client for Windows Remote…
permissive · top 5,000 on PyPI
apache-airflow-providers-microsoft-psrpIntegrates Apache Airflow with PowerShell…
permissive · top 15,000 on PyPI
requests-credsspAdds CredSSP authentication support to the…
permissive · top 15,000 on PyPI
sspilibProvides Python bindings to the Windows SSPI…
permissive · top 5,000 on PyPI
smbprotocolSMBv2 and SMBv3 client library for Python that…
permissive · top 5,000 on PyPI
requests-negotiate-sspiAdds HTTP Negotiate authentication…
permissive · top 15,000 on PyPI
apache-airflow-providers-microsoft-winrmIntegrates Windows Remote Management (WinRM)…
permissive · top 15,000 on PyPI
pyspnegoHandles SPNEGO, NTLM, Kerberos, and CredSSP…
permissive · top 1,000 on PyPI
srpImplements the Secure Remote Password (SRP)…
permissive · top 15,000 on PyPI