Skip to content

Commit dee42a3

Browse files
committed
added streaming download example
1 parent 565f36f commit dee42a3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/patent_data_example.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@
154154
overwrite=True,
155155
)
156156
print(f"Downloaded document to: {downloaded_path}")
157+
158+
print("\nStreaming same document to memory...")
159+
with client.stream_document(
160+
document=document_to_download, format="PDF"
161+
) as response:
162+
content = response.content
163+
print(f"Streamed {len(content)} bytes")
157164
else:
158165
print(
159166
"No downloadable formats available for the first document or document identifier missing."

0 commit comments

Comments
 (0)