Skip to content

Commit 61d04c7

Browse files
author
Célian Haydont
committed
add docstring for wiki export functions [ch58257]
1 parent 2f6ea8c commit 61d04c7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

dataikuapi/dss/wiki.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def get_export_stream(self, paper_size="A4", export_attachment=False):
9393
"""
9494
Download the whole wiki of the project in PDF format as a binary stream.
9595
Warning: this stream will monopolize the DSSClient until closed.
96+
97+
:param str paper_size: the format of the exported page, can be one of 'A4', 'A3', 'US_LETTER' or 'LEDGER'
98+
:param bool export_attachment: export the attachments of the article(s) in addition to the pdf in a zip file
99+
:returns: the exported pdf or zip file as a stream
96100
"""
97101
body = {
98102
"paperSize": paper_size,
@@ -103,6 +107,9 @@ def get_export_stream(self, paper_size="A4", export_attachment=False):
103107
def export_to_file(self, path, paper_size="A4", export_attachment=False):
104108
"""
105109
Download the whole wiki of the project in PDF format into the given output file.
110+
111+
:param str paper_size: the format of the exported page, can be one of 'A4', 'A3', 'US_LETTER' or 'LEDGER'
112+
:param bool export_attachment: export the attachments of the article(s) in addition to the pdf in a zip file
106113
"""
107114
with self.get_export_stream(paper_size=paper_size, export_attachment=export_attachment) as stream:
108115
with open(path, 'wb') as f:
@@ -274,8 +281,14 @@ def get_uploaded_file(self, upload_id):
274281

275282
def get_export_stream(self, paper_size="A4", export_children=False, export_attachment=False):
276283
"""
277-
Download an article in PDF format as a binary stream.
284+
Download the article in PDF format as a binary stream.
278285
Warning: this stream will monopolize the DSSClient until closed.
286+
287+
:param str path: the path of the file where the pdf or zip file will be downloaded
288+
:param str paper_size: the format of the exported page, can be one of 'A4', 'A3', 'US_LETTER' or 'LEDGER'
289+
:param bool export_children: export the children of the article in the pdf
290+
:param bool export_attachment: export the attachments of the article(s) in addition to the pdf in a zip file
291+
:returns: the exported pdf or zip file as a stream
279292
"""
280293
body = {
281294
"paperSize": paper_size,
@@ -286,7 +299,11 @@ def get_export_stream(self, paper_size="A4", export_children=False, export_attac
286299

287300
def export_to_file(self, path, paper_size="A4", export_children=False, export_attachment=False):
288301
"""
289-
Download an article in PDF format into the given output file.
302+
Download the article in PDF format into the given output file.
303+
304+
:param str paper_size: the format of the exported page, can be one of 'A4', 'A3', 'US_LETTER' or 'LEDGER'
305+
:param bool export_children: export the children of the article in the pdf
306+
:param bool export_attachment: export the attachments of the article(s) in addition to the pdf in a zip file
290307
"""
291308
with self.get_export_stream(paper_size=paper_size, export_children=export_children, export_attachment=export_attachment) as stream:
292309
with open(path, 'wb') as f:

0 commit comments

Comments
 (0)