PrefectInterfaces.jl

Minimal Julia client for Prefect REST API for analysts and data scientists.
Author mahiki
Popularity
3 Stars
Updated Last
10 Months Ago
Started In
August 2023

PrefectInterfaces.jl

Stable dev Build Status Coverage

May the official Prefect Julia SDK arrive soon.

This is a small package that helps you connect to a Prefect instance from a Julia process. This enables integrating your Julia code into your existing workflow orchestration managed by Prefect. Included in the package is a bootstrapped installation of a local Prefect instance, and an example Dataset type to demonstrate a concrete use-case.

Installation

julia> Pkg.add("PrefectInterfaces")

Usage

  • A Prefect server/cloud instance must be available via API URL to use these functions, the examples below are hypothetical and require a running Prefect server with blocks registered in the names below.
  • See Prefect local installation instructions.
# provide a reference to the running Prefect REST API
julia> ENV["PREFECT_API_URL"] = "http://127.0.0.1:4300/api"

using PrefectInterfaces

# retrieve the names of blocks from your running Prefect instance
db = ls();
db.blocks
    # 3-element Vector{String}:
    #  "local-file-system/willowdata"
    #  "secret/necromancer"
    #  "string/syrinx"

secret_block = PrefectBlock("secret/necromancer")
# PrefectBlock("secret/necromancer", Main.PrefectInterfaces.SecretBlock("secret/necromancer", "secret", ####Secret####))

secret_block.block.value.secret
    # "abcd1234"

Used By Packages

No packages found.