Skip to main content

fethr

The Python package for Fethr: a client for the whole Fethr API, and the helpers Python script steps use to send outputs, metrics and logs back to their run.

pip install fethr

Calling the Fethr API

Create an API key in Fethr under Settings › Developer. Scripts always use an API key (or a service account's key); a username and password does not work against Fethr.

from fethr import FethrClient

fethr = FethrClient("https://fethr.example.org", token="fethr_usr_...")
# or set FETHR_URL and FETHR_API_TOKEN and call FethrClient()

fethr.me()                                            # who the key belongs to

run = fethr.run_flow("avmc", "adt_to_ehr", {"mrn": "12345"})   # start a flow and wait
print(run["state"]["current"])
print(fethr.run_logs(run["id"]))

fethr.connectors.list_connectors()
fethr.connectors.start_connector(id="...")
fethr.tables.list_table_rows(namespace="avmc", name="locations", size=100)
fethr.staging.publish_staged_changes(body={"items": [{"kind": "FLOW", "key": "avmc/adt_to_ehr"}]})

Every operation in the engine's API is there, grouped by area (fethr.groups() lists them, dir(fethr.tables) lists one group's operations, and help(fethr.tables.create_table) shows its path and parameters). Any operation can also be called by its id:

fethr.call("getExecution", execution_id="7Yf3...")
fethr.describe("createTable")
  • Keyword arguments are the operation's path, query and header parameters; execution_id works for executionId, from_ for from.
  • body= takes a dict or list (sent as JSON), a string (sent as YAML for flows, text otherwise) or bytes. files= / data= send multipart forms.
  • Errors raise FethrApiError with .status and .body. GET requests retry on 429/502/503/504.
  • verify=False or verify="ca.pem" for servers with a private certificate.

The full list of operations with their parameters is the engine's OpenAPI spec at /swagger/fethr.yml.

Inside a Python script step

from fethr import Fethr

Fethr.outputs({"patients": 12})
Fethr.counter("rows", 120, {"table": "adt"})
Fethr.logger().info("done")

The Fethr engine image ships this package, so script steps import it without installing anything.

To start another flow from a script and wait for it:

from fethr import Flow

Flow().execute("avmc", "nightly_export", {"date": "2026-11-20"})

Flow reads FETHR_URL and FETHR_API_TOKEN (store the key as a Fethr secret and pass it in the step's env).

Metadata

Release files for fethr 1.4.2

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

Source distribution (sdist)

Source distribution for fethr 1.4.2
File Size Uploaded Provenance Actions
fethr-1.4.2.tar.gz 41.1 kB With provenance Details for fethr-1.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 81.0 kB

Release files / fethr-1.4.2.tar.gz

Download URL fethr-1.4.2.tar.gz
Size 41.1 kB
Tags Source
SHA-256 checksum
How to use checksums
026bc87efd5307dae8b647668d65cc709f84076e90779af40f4eb32d55870873
BLAKE2b-256 checksum
How to use checksums
0bf518e3241af539c668da0c4b1b680d1af53fb39fb1cf58b9cea3b4f8f29975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / fethr-1.4.2-py3-none-any.whl

Download URL fethr-1.4.2-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53f076271d64da89a2dd4ee9bbfb93a19156c47abbc2d1480bd23ed4ac32d33d
BLAKE2b-256 checksum
How to use checksums
bb213628d25b6afa1d01f5dcc2f040a3d54e8aa4dba8f8f493ba17d75cc7e9c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for fethr 1.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fethr-1.4.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 release files Full provenance

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