mahiki / PrefectInterfaces.jl

Minimal Julia client for Prefect REST API for analysts and data scientists.
https://mahiki.github.io/PrefectInterfaces.jl/
MIT License
3 stars 1 forks source link

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

# 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"