跳转到主要内容

libssh2 C库的绑定

项目描述

超级快速的SSH2协议库。 ssh2-python 提供了 libssh2 的Python绑定。

License Latest Version https://circleci.com/gh/ParallelSSH/ssh2-python/tree/master.svg?style=svg https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python?svg=true&branch=master https://img.shields.io/pypi/wheel/ssh2-python.svg https://img.shields.io/pypi/pyversions/ssh2-python.svg Latest documentation

安装

提供了Linux、OSX和Windows的二进制wheel包,所有Python版本。Wheel包没有依赖项。

pip 可能需要更新才能安装二进制wheel包 - pip install -U pip

pip install ssh2-python

有关从源安装的说明,包括针对系统提供的libssh2进行构建,请参阅文档

谁应该使用这个

大多数开发者会希望使用基于这个库的 高级客户端,在 parallel-ssh 中。

此库提供了对低级libssh2 C-API的绑定。它不是高级的,也不容易使用。要使用这个库,需要编写大量的代码,而这些代码已经由 parallel-ssh 提供。

除非确实需要使用C-API,否则请使用 parallel-ssh

API功能集

目前,所有libssh2 API 已实现至仓库中的 libssh2 版本。请报告任何缺失的实现。

各种操作的完整示例脚本可以在示例目录中找到。

此外,由于 ssh2-python 是具有 Python 语法的 libssh2 精简包装,因此 其代码示例 可以直接移植到 Python,只需进行最小更改。

示例

完整示例请参阅示例目录

再次强调,大多数开发者将希望使用 parallel-ssh 而不是直接使用此库。

与其他 Python SSH 库的比较

以下示例与 Paramiko 的性能比较。

time python examples/example_echo.py
time python examples/paramiko_comparison.py
输出:

ssh2-python:

real       0m0.141s
user       0m0.037s
sys        0m0.008s

paramiko:

real       0m0.592s
user       0m0.351s
sys        0m0.021s

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源代码发行版

此版本没有可用的源代码发行版文件。请参阅生成发行版存档的教程。

构建发行版

ssh2_python312-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB 查看哈希值)

上传时间 CPython 3.12 manylinux: glibc 2.17+ x86-64

ssh2_python312-0.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (4.5 MB 查看哈希值)

上传时间 CPython 3.12 manylinux: glibc 2.17+ i686

ssh2_python312-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB 查看哈希值)

上传时间 CPython 3.12 macOS 11.0+ ARM64

ssh2_python312-0.1.1-cp312-cp312-macosx_10_9_x86_64.whl (2.8 MB 查看哈希值)

上传时间 CPython 3.12 macOS 10.9+ x86-64

ssh2_python312-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ x86-64

ssh2_python312-0.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (4.4 MB 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ i686

ssh2_python312-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (3.0 MB 查看哈希值)

上传时间 CPython 3.11 macOS 11.0+ ARM64

ssh2_python312-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl (2.8 MB 查看哈希值)

上传时间 CPython 3.11 macOS 10.9+ x86-64

ssh2_python312-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ x86-64

ssh2_python312-0.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ i686

ssh2_python312-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB 查看哈希值)

上传时间 CPython 3.10 macOS 11.0+ ARM64

ssh2_python312-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl (2.8 MB 查看哈希值)

上传时间 CPython 3.10 macOS 10.9+ x86-64

由以下支持

AWSAWS 云计算和安全赞助商 DatadogDatadog 监控 FastlyFastly CDN GoogleGoogle 下载分析 MicrosoftMicrosoft PSF赞助商 PingdomPingdom 监控 SentrySentry 错误日志 StatusPageStatusPage 状态页面