Pipedream adapter for eons
Project description
Pipedream Adapter for eons
This library allows you to call "fittings" from your Pipdream (or compatible) workflow.
Usage
Using Pipe Adapter is pretty easy:
from pipeadapter import connect
input = {}
input["key"] = "value"
return connect('fitting', input)
You need to know:
- What Fitting you want to use
- The inputs to pass to that Fitting
- What values to provide to those inputs.
Fittings
The modules used by Pipeadapter are functors based on the eons library.
Among other features, Fittings support:
#All necessary args that *this cannot function without.
this.requiredKWArgs = []
#For optional args, supply the arg name as well as a default value.
this.optionalKWArgs = {}
Each of these "KWArgs" will become a member in the Fitting. For example this.requiredKWArgs.append("my_arg")
sets this.my_arg
to the value of this.Fetch("my_arg")
. This system allows users to provide inputs in multiple ways while allowing developers to code in a standard format.
Developers also have access to all the eons.UserFunctor utilities.
Example Fitting
import os
import logging
from datetime import datetime
from pipeadapter import Fitting
class timestamp_to_date(Fitting):
def __init__(this, name="Timestamp to Date"):
super().__init__(name)
this.requiredKWArgs.append("timestamp")
this.optionalKWArgs["output_format"] = '%m/%d/%Y'
# Required Fitting method. See that class for details.
def Run(this):
dt = datetime.fromtimestamp(this.timestamp)
this.output["date"] = dt.strftime(this.output_format)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pipeadapter-0.0.2.tar.gz
.
File metadata
- Download URL: pipeadapter-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d46ea97549da479d30078dd202cfa19a78714e1212bf84241a78b0df5ee6810 |
|
MD5 | a7e9c0bf9c7f239650dcd984f325a002 |
|
BLAKE2b-256 | 208dfc3176134783a90d2f2e52225657751dd0180cd4d802deffdb7fdee4428c |
File details
Details for the file pipeadapter-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pipeadapter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1316a150245ad215ad2d1543dee8dd6b8c651cb9477107ce09230bbdc8f4cbf |
|
MD5 | 78c0658d4801f34f95fd77e5910d0404 |
|
BLAKE2b-256 | 12d42c5fbfc1e13adc5224b0eac942cb26636405922985e510bbcc5cb7f3e1ef |