Skip to content

Commit ebd3d3c

Browse files
Automated Spec Update (#574)
c2df3ee5dccc76a21bfa5b4139bff050cea53de7 Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> Co-authored-by: dropbox-sdk-updater[bot] <306210582+dropbox-sdk-updater[bot]@users.noreply.github.com>
1 parent 26d70cd commit ebd3d3c

3 files changed

Lines changed: 496 additions & 1 deletion

File tree

dropbox/base.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4595,6 +4595,67 @@ def riviera_get_metadata_async_check(self, async_job_id):
45954595
)
45964596
return r
45974597

4598+
def riviera_get_text_async(self, file_id_or_url=None):
4599+
"""
4600+
Asynchronous plain-text extraction from documents. Supported formats
4601+
include: - Word processing: .doc, .docx, .docm, .rtf. - Presentations:
4602+
.ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. -
4603+
Dropbox document types: .paper, .papert, .binder, .gdoc, .gsheet,
4604+
.gslides. - Plain text / subtitles: .txt, .vtt. Unsupported formats
4605+
return an `unsupported_format_error`. For the `url` variant only Dropbox
4606+
shared links are supported; external URLs return
4607+
`unsupported_format_error`.
4608+
4609+
Route attributes:
4610+
scope: files.content.read
4611+
4612+
:param file_id_or_url: Identifier of the document to extract text from.
4613+
Callers must set exactly one of the `FileIdOrUrl` variants. Text
4614+
extraction is supported for common document formats (Word,
4615+
PowerPoint, Excel, PDF, RTF, and Dropbox document types); see the
4616+
route description for the supported formats. Requests against
4617+
unsupported formats return `unsupported_format_error`. NOTE: for the
4618+
`url` variant, only Dropbox shared links (www.dropbox.com) are
4619+
supported. External (non-Dropbox) URLs are not supported and return
4620+
`unsupported_format_error`; import the file into Dropbox and
4621+
reference it by `file_id` or `path` instead.
4622+
:type file_id_or_url: Nullable[:class:`dropbox.riviera.FileIdOrUrl`]
4623+
:rtype: :class:`dropbox.async_.LaunchResultBase`
4624+
"""
4625+
arg = riviera.GetTextArgs(file_id_or_url)
4626+
r = self.request(
4627+
riviera.get_text_async,
4628+
"riviera",
4629+
arg,
4630+
None,
4631+
)
4632+
return r
4633+
4634+
def riviera_get_text_async_check(self, async_job_id):
4635+
"""
4636+
Returns the status or result of specified get_text_async task.
4637+
4638+
Route attributes:
4639+
scope: files.content.read
4640+
4641+
:param async_job_id: Id of the asynchronous job. This is the value of a
4642+
response returned from the method that launched the job.
4643+
:type async_job_id: str
4644+
:rtype: :class:`dropbox.riviera.GetTextAsyncCheckResult`
4645+
:raises: :class:`.exceptions.ApiError`
4646+
4647+
If this raises, ApiError will contain:
4648+
:class:`dropbox.async_.PollError`
4649+
"""
4650+
arg = async_.PollArg(async_job_id)
4651+
r = self.request(
4652+
riviera.get_text_async_check,
4653+
"riviera",
4654+
arg,
4655+
None,
4656+
)
4657+
return r
4658+
45984659
def riviera_get_transcript_async(
45994660
self,
46004661
file_id_or_url=None,

0 commit comments

Comments
 (0)