skillfed

pypsrp

PowerShell Remoting Protocol and WinRM for Python

pypsrp v0.9.1 4.4M downloads/30d#2,310 on PyPI379
Permissive license MIT Active released

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 pypsrp

uv

uv add pypsrp

poetry

poetry add pypsrp

Installing 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

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

windows remote execution pythonpowershell remoting protocol clientwinrm python libraryremote command execution windowspsrp python clientwindows host automationremote powershell scripts
windows-automationremote-executionsystem-administration

More Networking packages