Fabricity
Fabricity is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It keeps the Fabric 1.x API working on current Python releases.
It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.
Typical use involves creating a Python module containing one or more functions, then executing them via the fab command-line tool. Below is a small but complete “fabfile” containing a single task:
from fabric.api import run
def host_type():
run('uname -s')
If you save the above as fabfile.py (the default module that fab loads), you can run the tasks defined in it on one or more servers, like so:
$ fab -H localhost,linuxbox host_type [localhost] run: uname -s [localhost] out: Darwin [linuxbox] run: uname -s [linuxbox] out: Linux Done. Disconnecting from localhost... done. Disconnecting from linuxbox... done.
In addition to use via the fab tool, Fabricity’s components may be imported into other Python code, providing a Pythonic interface to the SSH protocol suite at a higher level than that provided by e.g. the Paramiko library (which Fabricity itself uses).
Where it comes from
Fabricity is a fork of Fabric3, which in turn forked Fabric 1.x to add Python 3 support. Fabric3 was retired once mainline Fabric shipped Python 3 support, but mainline Fabric 2+ is a different tool with an incompatible API, so a codebase with an existing Fabric 1.x fabfile has nowhere to move to. Fabricity is that place: the same API, kept working on current Python and Paramiko releases.
Installation
Fabricity installs the same fabric package and fab command as Fabric, so any other Fabric distribution has to go first — uninstalling one afterwards deletes the files Fabricity has since taken over:
pip uninstall Fabric Fabric3 pip install fabricity
Requires Python 3.9 or later.
Differences with Fabric 1.x
Fabricity aims to be a drop-in replacement for Fabric 1.x. Known differences:
Python 2 is no longer supported.
fabric.utils.RingBuffer is removed; use collections.deque from the standard library instead.
On Python 3 the contextlib.nested replacement is implemented with contextlib.ExitStack. It was removed from the standard library for good reason; using it is not encouraged.
DSS/DSA keys are not supported. Paramiko 4 removed paramiko.dsskey; env.key accepts Ed25519, ECDSA and RSA keys.
The 3des-cbc cipher is not offered by default. Set env.disabled_algorithms to override.
Documentation
The Fabric 1.x usage and API documentation at docs.fabfile.org/en/1.14 applies to Fabricity, apart from the differences listed above. The sources for the same documentation live in sites/ in this repository. Note that the current fabfile.org covers mainline Fabric 2+, which is a different API.
Development
Dependencies are managed with uv:
uv sync uv run pytest
AGENTS.md in this repository carries the full set of development commands.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabricity-1.16.1.tar.gz.
File metadata
- Download URL: fabricity-1.16.1.tar.gz
- Upload date:
- Size: 239.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e34d186f6320045a1ec2b84f2a30190ff81dea32567653fde3fcb882de4ff918
|
|
| MD5 |
9421d87ea139aabdc8355c3c9d0eaedc
|
|
| BLAKE2b-256 |
4af78cc1933cdb43d1cd2bd5918717a063aee64766a9f6b8c953507ebc697bac
|
File details
Details for the file fabricity-1.16.1-py3-none-any.whl.
File metadata
- Download URL: fabricity-1.16.1-py3-none-any.whl
- Upload date:
- Size: 96.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be17f98aea7112b316fb65969f71d20c9a63948dc1b3ebfbb5e499509b8d5f3
|
|
| MD5 |
19291c6c4250078a637af349458b77bf
|
|
| BLAKE2b-256 |
ee61eb3f8d08088b6a2afeae5df5fcd255d4355c9728677ecec53ed47ec246d3
|