Skip to main content

Pure-stdlib Tier-1 sugar for writing Workflow Canvas (wfc) methods

Project description

wfc-client

Pure-stdlib Tier-1 sugar for writing Workflow Canvas (wfc) methods.

wfc-client is the opt-in ergonomic way to write a wfc method. The canonical interface is the Tier-2 env-var + file contract — wfc-client is a thin, zero-dependency wrapper over it. It never installs wfc, pandas, or any third-party package into your environment, and it never copies, reads, or serializes your data bytes: it is a metadata recorder.

import wfc_client as wfc

@wfc.method
def qc(ctx):
    clean_path = ctx.workdir / "clean.csv"
    # ... write your file with whatever library you like ...
    ctx.save_artifact("clean", clean_path)
    ctx.log_metric("kept_rows", 100)

if __name__ == "__main__":
    wfc.run()

The ctx surface

Member Purpose
ctx.input(slot) Resolved input paths (list[Path]) for an input slot.
ctx.params Parsed params dict.
ctx.workdir Scratch dir at WFC_RUN_DIR/_workdir/ (auto-created).
ctx.run_dir WFC_RUN_DIR (advanced).
ctx.save_artifact(name, path) Record that path is the declared output name. Path only.
ctx.log_metric(name, value) Record a scalar metric.

At wfc.run() exit, wfc-client writes one _wfc_results.json manifest of {outputs, metrics} with run-dir-relative paths. The host reads it.

Exactly one @wfc.method per method module is required.

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

wfc_client-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wfc_client-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file wfc_client-0.1.0.tar.gz.

File metadata

  • Download URL: wfc_client-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for wfc_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df40076af648e5facf564ea0068e2cb058d2547eccdfde5b116cdbbf96403db2
MD5 fd56baef38d3d8cc8e5850c886d57684
BLAKE2b-256 fdcd5c6cec89c8c023c3116f8b12855bfeaa1e6047933773295792d174bae8ff

See more details on using hashes here.

File details

Details for the file wfc_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wfc_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for wfc_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06b7058ce1e27952bb035ad7d4de56afc15e390a826ef4f4804d0c8e872f0de5
MD5 4c74eff5da2e2857df08483b0308018a
BLAKE2b-256 ced93eac5b617869cfcca9c3fdf499e4589fe433442d2cae41118ce75e19abfe

See more details on using hashes here.

Supported by

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