Skip to content
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@

The Pipedream Python library provides convenient access to the Pipedream APIs from Python.

## Table of Contents

- [Installation](#installation)
- [Reference](#reference)
- [Usage](#usage)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Advanced](#advanced)
- [Access Raw Response Data](#access-raw-response-data)
- [Retries](#retries)
- [Timeouts](#timeouts)
- [Custom Client](#custom-client)
- [Contributing](#contributing)

## Installation

```sh
Expand Down Expand Up @@ -89,14 +104,7 @@ client = Pipedream(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
response = client.apps.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "pipedream"

[tool.poetry]
name = "pipedream"
version = "1.0.11"
version = "1.0.12"
description = ""
readme = "README.md"
authors = []
Expand Down
26 changes: 2 additions & 24 deletions src/pipedream/accounts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,7 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
response = client.accounts.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down Expand Up @@ -160,8 +152,6 @@ def create(
client_secret="YOUR_CLIENT_SECRET",
)
client.accounts.create(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
app_slug="app_slug",
cfmap_json="cfmap_json",
connect_token="connect_token",
Expand Down Expand Up @@ -215,7 +205,6 @@ def retrieve(
)
client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)
"""
_response = self._raw_client.retrieve(
Expand Down Expand Up @@ -363,15 +352,7 @@ async def list(


async def main() -> None:
response = await client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
response = await client.accounts.list()
async for item in response:
yield item

Expand Down Expand Up @@ -450,8 +431,6 @@ async def create(

async def main() -> None:
await client.accounts.create(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
app_slug="app_slug",
cfmap_json="cfmap_json",
connect_token="connect_token",
Expand Down Expand Up @@ -513,7 +492,6 @@ async def retrieve(
async def main() -> None:
await client.accounts.retrieve(
account_id="account_id",
include_credentials=True,
)


Expand Down
16 changes: 2 additions & 14 deletions src/pipedream/actions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.actions.list(
after="after",
before="before",
limit=1,
q="q",
app="app",
)
response = client.actions.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down Expand Up @@ -431,13 +425,7 @@ async def list(


async def main() -> None:
response = await client.actions.list(
after="after",
before="before",
limit=1,
q="q",
app="app",
)
response = await client.actions.list()
async for item in response:
yield item

Expand Down
4 changes: 2 additions & 2 deletions src/pipedream/actions/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def run(
),
"dynamic_props_id": dynamic_props_id,
"stash_id": convert_and_respect_annotation_metadata(
object_=stash_id, annotation=RunActionOptsStashId, direction="write"
object_=stash_id, annotation=typing.Optional[RunActionOptsStashId], direction="write"
),
},
headers={
Expand Down Expand Up @@ -866,7 +866,7 @@ async def run(
),
"dynamic_props_id": dynamic_props_id,
"stash_id": convert_and_respect_annotation_metadata(
object_=stash_id, annotation=RunActionOptsStashId, direction="write"
object_=stash_id, annotation=typing.Optional[RunActionOptsStashId], direction="write"
),
},
headers={
Expand Down
18 changes: 2 additions & 16 deletions src/pipedream/apps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
response = client.apps.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down Expand Up @@ -219,14 +212,7 @@ async def list(


async def main() -> None:
response = await client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
response = await client.apps.list()
async for item in response:
yield item

Expand Down
18 changes: 2 additions & 16 deletions src/pipedream/components/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ def list(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.components.list(
after="after",
before="before",
limit=1,
q="q",
app="app",
component_type="trigger",
)
response = client.components.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
Expand Down Expand Up @@ -379,14 +372,7 @@ async def list(


async def main() -> None:
response = await client.components.list(
after="after",
before="before",
limit=1,
q="q",
app="app",
component_type="trigger",
)
response = await client.components.list()
async for item in response:
yield item

Expand Down
4 changes: 2 additions & 2 deletions src/pipedream/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "pipedream/1.0.11",
"User-Agent": "pipedream/1.0.12",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "pipedream",
"X-Fern-SDK-Version": "1.0.11",
"X-Fern-SDK-Version": "1.0.12",
**(self.get_custom_headers() or {}),
}
if self._project_environment is not None:
Expand Down
22 changes: 10 additions & 12 deletions src/pipedream/deployed_triggers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ def list(
client_secret="YOUR_CLIENT_SECRET",
)
response = client.deployed_triggers.list(
after="after",
before="before",
limit=1,
external_user_id="external_user_id",
emitter_type="email",
)
for item in response:
yield item
Expand Down Expand Up @@ -151,6 +147,7 @@ def update(
active: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
name: typing.Optional[str] = OMIT,
emit_on_deploy: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Emitter:
"""
Expand All @@ -171,6 +168,9 @@ def update(
name : typing.Optional[str]
The name of the trigger

emit_on_deploy : typing.Optional[bool]
Whether the trigger should emit events during deployment

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -200,6 +200,7 @@ def update(
active=active,
configured_props=configured_props,
name=name,
emit_on_deploy=emit_on_deploy,
request_options=request_options,
)
return _response.data
Expand Down Expand Up @@ -245,7 +246,6 @@ def delete(
client.deployed_triggers.delete(
trigger_id="trigger_id",
external_user_id="external_user_id",
ignore_hook_errors=True,
)
"""
_response = self._raw_client.delete(
Expand Down Expand Up @@ -298,7 +298,6 @@ def list_events(
client.deployed_triggers.list_events(
trigger_id="trigger_id",
external_user_id="external_user_id",
n=1,
)
"""
_response = self._raw_client.list_events(
Expand Down Expand Up @@ -558,11 +557,7 @@ async def list(

async def main() -> None:
response = await client.deployed_triggers.list(
after="after",
before="before",
limit=1,
external_user_id="external_user_id",
emitter_type="email",
)
async for item in response:
yield item
Expand Down Expand Up @@ -640,6 +635,7 @@ async def update(
active: typing.Optional[bool] = OMIT,
configured_props: typing.Optional[ConfiguredProps] = OMIT,
name: typing.Optional[str] = OMIT,
emit_on_deploy: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Emitter:
"""
Expand All @@ -660,6 +656,9 @@ async def update(
name : typing.Optional[str]
The name of the trigger

emit_on_deploy : typing.Optional[bool]
Whether the trigger should emit events during deployment

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -697,6 +696,7 @@ async def main() -> None:
active=active,
configured_props=configured_props,
name=name,
emit_on_deploy=emit_on_deploy,
request_options=request_options,
)
return _response.data
Expand Down Expand Up @@ -747,7 +747,6 @@ async def main() -> None:
await client.deployed_triggers.delete(
trigger_id="trigger_id",
external_user_id="external_user_id",
ignore_hook_errors=True,
)


Expand Down Expand Up @@ -808,7 +807,6 @@ async def main() -> None:
await client.deployed_triggers.list_events(
trigger_id="trigger_id",
external_user_id="external_user_id",
n=1,
)


Expand Down
Loading
Loading