Skip to main content

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.

Metadata

Release files for fabricity 1.16.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fabricity 1.16.1
File Size Uploaded
fabricity-1.16.1.tar.gz 239.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fabricity 1.16.1
File Interpreter ABI Platform
fabricity-1.16.1-py3-none-any.whl Python 3 none any Details

Total release size: 335.6 kB

Release files / fabricity-1.16.1.tar.gz

Download URL fabricity-1.16.1.tar.gz
Size 239.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e34d186f6320045a1ec2b84f2a30190ff81dea32567653fde3fcb882de4ff918
BLAKE2b-256 checksum
How to use checksums
4af78cc1933cdb43d1cd2bd5918717a063aee64766a9f6b8c953507ebc697bac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / fabricity-1.16.1-py3-none-any.whl

Download URL fabricity-1.16.1-py3-none-any.whl
Size 96.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be17f98aea7112b316fb65969f71d20c9a63948dc1b3ebfbb5e499509b8d5f3
BLAKE2b-256 checksum
How to use checksums
ee61eb3f8d08088b6a2afeae5df5fcd255d4355c9728677ecec53ed47ec246d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

1.16.1 This release

2 release files

1.16.0

2 release files

1.15.2

2 release files

1.15.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page