Skip to main content

A Python 3.8.10+ wrapper to add in SCP functionality for file transfer in Fabric.

Project description

PyPI - Version PyPI - Python Version PyPI - License GitHub Actions Workflow Status

FabricPlus

A drop-in expansion of features in the Fabric library.

As of version 0.1.0, those include:

  • Jumphost connectivity support
    • jump_run command to run commands from the intermediate jumphost
  • SCP Transfer support (including via a jumphost)
  • su command support

See the API documentation on the FabricPlus Website for more information, as well as "Getting Started" guide.

See fabric for more details on the base fabric library, if interested in the underlying behaviors. Some have been changed: see Important Changes and the documentation for more information.

Note On Changelogs

v1.0.1

  • Bugfix: su command had an invalid argument when processing subcommands. Fixed.

Installation

pip (via PyPI)

As of version 0.1.0, FabricPlus is available via pip and is on the Python Package Index.

To install, simply install fabricplus.

pip install fabricplus

Building From Source

You can also build fabricplus from source, especially if you want features or updates released outside of a tagged release on PyPI.

To do so, you'll need poetry, and an environment with a version of Python greater than or equal to 3.8.

Step 1: Install Poetry

To install poetry, simply run:

pip install poetry

For more information on poetry, see the Poetry Website.

Step 2: Clone Repo and Run poetry build

Once you have that installed, clone the repo, then run poetry build from the root directory:

# Clone
git clone https://github.com/prokopto-dev/fabric-plus
# Move into fabric-plus
cd fabric-plus
# Run poetry build
poetry build
# install with pip the newly build wheel file (file name may vary)
pip install dist/fabricplus-0.1.0-py3-none-any.whl

Quick-Start

The following is all the basic new features in one small block.

# importing as Connection
from fabricplus.connection import ConnectionPlus as Connection

# Creating a basic connection
conn_1: Connection = Connection("host1.example.com")

# Creating a jumphost connection, and then a host connection via that jumphost
jumphost_1: Connection = Connection("jumphost.example.com")
conn_via_jh: Connection = Connection("host2.example.com", jump_target=jumphost_1)

# Creating a host that uses SCP for transfers by default
conn_2: Connection("host3.example.com", scp=True)

# Running a get via SCP on the host1/conn_1, which doesn't use SCP by default
conn_1.get("/path/to/some/remote/file", scp=True)

# Running a command as some other user via su
conn_1.su("date", user="someotheruser", password="someuserspasswd")

License Addendum

  • scp.py is used by import under the LGPL v2.1 license, and this notice is in accordance with that license.
  • paramiko-jump used under Apache License 2.0, see fabricplus/paramiko_modifications/client.py for license details.
  • fabric is used, and falls under a BSD-2-Clause license, which doesn't restrict its use as an imported library, but is noted here anyways.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabricplus-1.0.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

fabricplus-1.0.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file fabricplus-1.0.1.tar.gz.

File metadata

  • Download URL: fabricplus-1.0.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1021-azure

File hashes

Hashes for fabricplus-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cc2d30b43efddd8a5c5d1cdb2c1dfbf32d49cbf9e9fa8bc2c97843c599ab1d2e
MD5 69292e860a14419876f8d988a20ca469
BLAKE2b-256 1d754a784ee1868a14ab7b42b80f3a91be004e662baa755cdf764662fc119f66

See more details on using hashes here.

File details

Details for the file fabricplus-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: fabricplus-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1021-azure

File hashes

Hashes for fabricplus-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb0150c9620e7b44a57897cc0407ca815e107f0b5d107335a6b23af58a28e7bb
MD5 6098419ac2ca98012d033c43c8262f92
BLAKE2b-256 3a89a7962c8fd1e1d3963f51d0ae31f55d884a16289f8d9739b49df8701ca8d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page