How to Add a New Module?

This topic was automatically generated from Slack. You can find the original thread here.

How do I add a new module

To add a new module in Pipedream, you can create a new component. Components in Pipedream are written in Node.js and can be published via the CLI. Here’s a step-by-step guide to help you create a new module: 1. Install the Pipedream CLI: If you haven’t already, you’ll need to install the Pipedream CLI. You can do this by running the following command: sh npm install -g @pipedream/cli 2. Initialize a new component: Use the Pipedream CLI to initialize a new component. Run the following command and follow the prompts: sh pd init 3. Write your component code: Open the generated file in your preferred code editor. Here’s an example of a basic component that makes an HTTP request using axios: import { axios } from "@pipedream/platform" export default defineComponent({ props: { openai: { type: "app", app: "openai", } }, async run({steps, $}) { return await axios($, { url: "https://api.openai.com/v1/models", headers: { Authorization: `Bearer ${this.openai.$auth.api_key}`, }, }) }, }) 4. Publish your component: Once you’ve written your component, you can publish it using the Pipedream CLI: ```
sh pd publish

No module named ‘google.cloud’

: is this node or Python?

Python

Specifically:

# pipedream add-package python-telegram-bot
import telegram

yeah, thanks. I’ll give it a try

ValueError: This method requires pyarrow to be installed

It looks like you’re encountering a ValueError indicating that pyarrow needs to be installed. This error typically occurs when you’re trying to use a method that relies on the pyarrow library, but the library isn’t installed in your environment. To resolve this issue, you need to install the pyarrow library. You can do this by adding the following line to your Python code in a Pipedream step: !pip install pyarrow Here’s an example of how you might include this in a Pipedream Python step: ```
def handler(pd: “pipedream”): # Install pyarrow !pip install pyarrow # Your code that requires pyarrow import pyarrow as pa # Example usage of pyarrow data = pa.array([1, 2, 3, 4, 5]) print(data)