Skip to content

Commit 1e6a51a

Browse files
committed
Add as_tuples example [ci skip]
1 parent 63835b0 commit 1e6a51a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ paths = ["one.pdf", "two.pdf", "three.pdf", ...]
213213
docs = layout.pipe(paths)
214214
```
215215

216+
```python
217+
sources = [("one.pdf", {"id": 1}), ("two.pdf", {"id": 2})]
218+
for doc, context in layout.pipe(sources, as_tuples=True):
219+
...
220+
```
221+
216222
| Argument | Type | Description |
217223
| --- | --- | --- |
218224
| `sources` | `Iterable[str \| Path \| bytes] \| Iterable[tuple[str \| Path \| bytes, Any]]` | Paths of documents to process or bytes, or `(source, context)` tuples if `as_tuples` is set to `True`. |

0 commit comments

Comments
 (0)