Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cliVersion": "3.5.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.45.0",
"generatorConfig": {
"client": {
"class_name": "Client",
"filename": "client.py",
"exported_class_name": "Pipedream",
"exported_filename": "pipedream.py"
}
}
}
2 changes: 2 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ LICENSE
reference.md

# Custom Pipedream client files
src/pipedream/__init__.py
src/pipedream/pipedream.py

# Custom Proxy files
src/pipedream/proxy/client.py
Expand Down
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The Pipedream Python library provides convenient access to the Pipedream APIs fr
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Oauth Token Override](#oauth-token-override)
- [Advanced](#advanced)
- [Access Raw Response Data](#access-raw-response-data)
- [Retries](#retries)
Expand Down Expand Up @@ -104,14 +105,48 @@ client = Pipedream(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.apps.list()
response = client.apps.list(
after="after",
before="before",
limit=1,
q="q",
sort_key="name",
sort_direction="asc",
)
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
```

```python
# You can also iterate through pages and access the typed response per page
pager = client.apps.list(...)
for page in pager.iter_pages():
print(page.response) # access the typed response for each page
for item in page:
print(item)
```

## Oauth Token Override

This SDK supports two authentication methods: OAuth client credentials flow (automatic token management) or direct bearer token authentication. You can choose between these options when initializing the client:

```python
from pipedream import Pipedream

# Option 1: Direct bearer token (bypass OAuth flow)
client = Pipedream(..., token="my-pre-generated-bearer-token")

from pipedream import Pipedream

# Option 2: OAuth client credentials flow (automatic token management)
client = Pipedream(
..., client_id="your-client-id", client_secret="your-client-secret"
)
```

## Advanced

### Access Raw Response Data
Expand All @@ -129,11 +164,11 @@ response = client.actions.with_raw_response.run(...)
print(response.headers) # access the response headers
print(response.data) # access the underlying object
pager = client.apps.list(...)
print(pager.response.headers) # access the response headers for the first page
print(pager.response) # access the typed response for the first page
for item in pager:
print(item) # access the underlying object(s)
for page in pager.iter_pages():
print(page.response.headers) # access the response headers for each page
print(page.response) # access the typed response for each page
for item in page:
print(item) # access the underlying object(s)
```
Expand Down
36 changes: 35 additions & 1 deletion poetry.lock

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

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[project]
name = "pipedream"
dynamic = ["version"]

[tool.poetry]
name = "pipedream"
version = "1.0.12"
version = "1.0.13"
description = ""
readme = "README.md"
authors = []
Expand All @@ -30,7 +31,7 @@ packages = [
{ include = "pipedream", from = "src"}
]

[project.urls]
[tool.poetry.urls]
Repository = 'https://github.com/PipedreamHQ/pipedream-sdk-python'

[tool.poetry.dependencies]
Expand All @@ -44,6 +45,7 @@ typing_extensions = ">= 4.0.0"
mypy = "==1.13.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
ruff = "==0.11.5"
Expand Down
Loading