with Unleashed Software and Python?
Write Python and use any of the 350k+ PyPi packages available. Refer to the Pipedream Python docs to learn more.
import { axios } from "@pipedream/platform";
import crypto from "crypto";
export default defineComponent({
props: {
unleashed_software: {
type: "app",
app: "unleashed_software",
}
},
async run({ steps, $ }) {
const baseUrl = "https://api.unleashedsoftware.com";
const resource = "Accounts";
// The queryString is used in calculating signature, add your query string parameters
// e.g. for the Customers resource customerCode=FRANCK&includeObsolete=true
// or just pass an empty string
const queryString = "";
const uri = `${baseUrl}/${resource}${queryString ? `?${queryString}` : ""}`
// Generate HMAC-SHA256 signature
const signature = crypto
.createHmac("sha256", this.unleashed_software.$auth.api_key)
.update(queryString)
.digest("base64")
// Make the request
return await axios($, {
method: "GET",
url: uri,
headers: {
"api-auth-id": this.unleashed_software.$auth.api_id,
"api-auth-signature": signature,
"Accept": "application/json",
"Content-Type": "application/json; charset=utf-8",
},
});
},
})
Develop, run and deploy your Python code in Pipedream workflows. Integrate seamlessly between no-code steps, with connected accounts, or integrate Data Stores and manipulate files within a workflow
This includes installing PyPI packages, within your code without having to manage a requirements.txt
file or running pip
.
Below is an example of using Python to access data from the trigger of the workflow, and sharing it with subsequent workflow steps:
def handler(pd: "pipedream"):
# Reference data from previous steps
print(pd.steps["trigger"]["context"]["id"])
# Return data for use in future steps
return {"foo": {"test":True}}