smart_open API reference
115 public APIs from smart_open (piskvorky/smart_open) — 10 classes, 22 functions, 83 methods. Signatures extracted by static analysis of the actual source.
Repository: piskvorky/smart_open
| Kind | Count |
|---|---|
| Classes | 10 |
| Functions | 22 |
| Methods | 83 |
API list
func
release.update_changelog.get_json(url)Perform a GET + json.loads.
class
smart_open.azure.AppendWriterAppend bytes to Azure Blob Storage.
method
smart_open.azure.AppendWriter.closed() -> boolReturn True if the stream is closed.
method
smart_open.azure.AppendWriter.detach() -> io.RawIOBaseUnsupported.
method
smart_open.azure.AppendWriter.seek(offset:int, whence:int=smart_open.constants.WHENCE_START) -> intUnsupported.
method
smart_open.azure.AppendWriter.tell() -> intReturn the current stream position.
method
smart_open.azure.AppendWriter.terminate() -> NoneAppendBlob cannot be aborted, so we do nothing here.
method
smart_open.azure.AppendWriter.truncate(size:int | None=None) -> intUnsupported.
method
smart_open.azure.AppendWriter.writable() -> boolReturn True if the stream supports writing.
method
smart_open.azure.AppendWriter.write(b:ReadableBuffer) -> intAppend `b` to the AppendBlob, buffering until ``min_part_size``.
class
smart_open.azure.ReaderReads bytes from Azure Blob Storage.
method
smart_open.azure.Reader.close() -> NoneFlush and close this stream.
method
smart_open.azure.Reader.closed() -> boolReturn True if the stream is closed.
method
smart_open.azure.Reader.detach() -> io.RawIOBaseUnsupported.
method
smart_open.azure.Reader.read(size:int | None=-1) -> bytesRead up to size bytes from the object and return them.
method
smart_open.azure.Reader.read1(size:int | None=-1) -> bytesThis is the same as read().
method
smart_open.azure.Reader.readable() -> boolReturn True if the stream can be read from.
method
smart_open.azure.Reader.readinto(b:WriteableBuffer) -> intRead up to len(b) bytes into b, and return the number of bytes read.
method
smart_open.azure.Reader.readline(limit:int | None=-1) -> bytesRead up to and including the next newline.
method
smart_open.azure.Reader.seek(offset:int, whence:int=smart_open.constants.WHENCE_START) -> intSeek to the specified position.
method
smart_open.azure.Reader.seekable() -> boolReturn True; we support `seek` but not `truncate`.
method
smart_open.azure.Reader.tell() -> intReturn the current position within the file.
method
smart_open.azure.Reader.truncate(size:int | None=None) -> intUnsupported.
class
smart_open.azure.WriterWrites bytes to Azure Blob Storage.
method
smart_open.azure.Writer.close() -> NoneCommit the buffered block list and close the stream.
method
smart_open.azure.Writer.closed() -> boolReturn True if the stream is closed.
method
smart_open.azure.Writer.detach() -> io.RawIOBaseUnsupported.
method
smart_open.azure.Writer.seek(offset:int, whence:int=smart_open.constants.WHENCE_START) -> intUnsupported.
method
smart_open.azure.Writer.tell() -> intReturn the current stream position.
method
smart_open.azure.Writer.terminate() -> NoneDo not commit block list on abort.
method
smart_open.azure.Writer.truncate(size:int | None=None) -> intUnsupported.
method
smart_open.azure.Writer.writable() -> boolReturn True if the stream supports writing.
method
smart_open.azure.Writer.write(b:ReadableBuffer) -> intWrite the given bytes (binary string) to the Azure Blob Storage file.
func
smart_open.azure.parse_uri(uri_as_string:str) -> _AzureUriParse an ``azure://`` URI into its container and blob components.
class
smart_open.concurrency.ThreadPoolExecutorSubclass with a lazy consuming imap method.
func
smart_open.concurrency.ThreadPoolExecutor.get() -> AnyBlock until the next task is done and return the result.
func
smart_open.doctools.extract_examples_from_readme(indent:str | None=None) -> strExtract examples from this project's README.md file.
func
smart_open.doctools.to_docstring(kwargs:list[Any], lpad:str='') -> strReconstruct a docstring from keyword argument info.
func
smart_open.ftp.open_uri(uri:str, mode:str, transport_params:TransportParams) -> IO[Any]Open an FTP/FTPS URI using the given mode and transport params.
func
smart_open.ftp.parse_uri(uri_as_string:str) -> _FTPUriParse an ``ftp://`` or ``ftps://`` URI into connection components.
func
smart_open.gcs.open_uri(uri:str, mode:str, transport_params:TransportParams) -> io.IOBaseOpen a GCS URI using the given mode and transport params.
method
smart_open.hdfs.CliRawInputBase.close() -> NoneFlush and close this stream.
method
smart_open.hdfs.CliRawInputBase.closed() -> boolReturn True if the stream is closed.
method
smart_open.hdfs.CliRawInputBase.detach() -> io.RawIOBaseUnsupported.
method
smart_open.hdfs.CliRawInputBase.read(size:int | None=-1) -> bytesRead up to size bytes from the object and return them.
method
smart_open.hdfs.CliRawInputBase.read1(size:int | None=-1) -> bytesThis is the same as read().
method
smart_open.hdfs.CliRawInputBase.readable() -> boolReturn True if the stream can be read from.
method
smart_open.hdfs.CliRawInputBase.seekable() -> boolReturn False; HDFS streams do not support seeking.
method
smart_open.hdfs.CliRawOutputBase.close() -> NoneFlush and close this stream.
method
smart_open.hdfs.CliRawOutputBase.closed() -> boolReturn True if the stream is closed.
method
smart_open.hdfs.CliRawOutputBase.detach() -> io.RawIOBaseUnsupported.
method
smart_open.hdfs.CliRawOutputBase.flush() -> NoneFlush the underlying ``hdfs dfs -put`` subprocess stdin.
method
smart_open.hdfs.CliRawOutputBase.seekable() -> boolReturn False; HDFS streams do not support seeking.
method
smart_open.hdfs.CliRawOutputBase.write(b:ReadableBuffer) -> intWrite the given buffer to the underlying raw stream.
method
smart_open.hdfs.CliRawOutputBase.writeable() -> boolReturn True if this object is writeable.
func
smart_open.hdfs.open(uri:str, mode:str) -> CliRawInputBase | CliRawOutputBaseOpen an HDFS `uri` for reading or writing.
func
smart_open.hdfs.parse_uri(uri_as_string:str) -> _HDFSUriParse an ``hdfs://`` or ``viewfs://`` URI into its path component.
class
smart_open.http.SeekableBufferedInputBaseSeekable streamed reader from a web site.
method
smart_open.http.SeekableBufferedInputBase.seek(offset:int, whence:int=0) -> intSeek to the specified position.
method
smart_open.http.SeekableBufferedInputBase.tell() -> intReturn the current stream position.
method
smart_open.http.SeekableBufferedInputBase.truncate(size:int | None=None) -> intUnsupported.
func
smart_open.http.parse_uri(uri_as_string:str) -> _HTTPUriParse an ``http://`` or ``https://`` URI into its path component.
func
smart_open.local_file.extract_local_path(uri_as_string:str) -> strReturn the user-expanded local filesystem path from `uri_as_string`.
func
smart_open.local_file.open_uri(uri_as_string:str, mode:str, transport_params:TransportParams) -> IO[Any]Open a local file URI using the given mode.
class
smart_open.s3.MultipartWriterWrites bytes to S3 using the multi part API.
method
smart_open.s3.MultipartWriter.closed() -> boolReturn True if the stream is closed.
method
smart_open.s3.MultipartWriter.detach() -> io.RawIOBaseUnsupported.
method
smart_open.s3.MultipartWriter.seek(offset:int, whence:int=constants.WHENCE_START) -> intUnsupported.
method
smart_open.s3.MultipartWriter.tell() -> intReturn the current stream position.
method
smart_open.s3.MultipartWriter.terminate() -> NoneCancel the underlying multipart upload.
method
smart_open.s3.MultipartWriter.to_boto3(resource:Any) -> AnyCreate an **independent** `boto3.s3.Object` instance.
method
smart_open.s3.MultipartWriter.truncate(size:int | None=None) -> intUnsupported.
method
smart_open.s3.MultipartWriter.writable() -> boolReturn True if the stream supports writing.
method
smart_open.s3.MultipartWriter.write(b:Buffer) -> intWrite the given buffer to the S3 file.
class
smart_open.s3.ReaderReads bytes from S3.
method
smart_open.s3.Reader.close() -> NoneFlush and close this stream.
method
smart_open.s3.Reader.detach() -> io.RawIOBaseUnsupported.
method
smart_open.s3.Reader.read(size:int | None=-1) -> bytesRead up to size bytes from the object and return them.
method
smart_open.s3.Reader.read1(size:int | None=-1) -> bytesThis is the same as read().
method
smart_open.s3.Reader.readable() -> boolReturn True if the stream can be read from.
method
smart_open.s3.Reader.readinto(b:WriteableBuffer) -> intRead up to len(b) bytes into b, and return the number of bytes read.
method
smart_open.s3.Reader.readline(limit:int | None=-1) -> bytesRead up to and including the next newline.
method
smart_open.s3.Reader.seek(offset:int, whence:int=constants.WHENCE_START) -> intSeek to the specified position.
method
smart_open.s3.Reader.seekable() -> boolIf False, seek(), tell() and truncate() will raise IOError.
method
smart_open.s3.Reader.tell() -> intReturn the current position within the file.
method
smart_open.s3.Reader.terminate() -> NoneDo nothing.
method
smart_open.s3.Reader.to_boto3(resource:Any) -> AnyCreate an **independent** `boto3.s3.Object` instance.
method
smart_open.s3.Reader.truncate(size:int | None=None) -> intUnsupported.
class
smart_open.s3.SinglepartWriterWrites bytes to S3 using the single part API.
method
smart_open.s3.SinglepartWriter.closed() -> boolReturn True if the stream is closed.
method
smart_open.s3.SinglepartWriter.flush() -> NoneNo-op flush; data is buffered until `close`.
method
smart_open.s3.SinglepartWriter.read(size:int | None=-1) -> bytesPropagate.
method
smart_open.s3.SinglepartWriter.read1(size:int | None=-1) -> bytesPropagate.
method
smart_open.s3.SinglepartWriter.readable() -> boolPropagate.
method
smart_open.s3.SinglepartWriter.seek(offset:int, whence:int=constants.WHENCE_START) -> intPropagate.
method
smart_open.s3.SinglepartWriter.seekable() -> boolPropagate.
method
smart_open.s3.SinglepartWriter.tell() -> intPropagate.
method
smart_open.s3.SinglepartWriter.terminate() -> NoneClose buffer and skip upload.
method
smart_open.s3.SinglepartWriter.truncate(size:int | None=None) -> intPropagate.
method
smart_open.s3.SinglepartWriter.writable() -> boolPropagate.
method
smart_open.s3.SinglepartWriter.write(b:Buffer) -> intWrite the given buffer into the in-memory buffer.
func
smart_open.s3.open_uri(uri:str, mode:str, transport_params:TransportParams) -> io.BufferedIOBaseOpen an S3 URI using the given mode and transport params.
func
smart_open.smart_open_lib.parse_uri(uri_as_string:str) -> tuple[Any, ...]Parse the given URI from a string.
class
smart_open.smart_open_lib.patch_pathlibReplace `Path.open` with `smart_open.open`.
func
smart_open.transport.get_transport(scheme:str) -> ModuleTypeGet the submodule that handles transport for the specified scheme.
func
smart_open.utils.check_kwargs(kallable:Callable[..., Any], kwargs:dict[str, Any]) -> dict[str, Any]Check which keyword arguments the callable supports.
func
smart_open.utils.clamp(value:int, minval:int=0, maxval:int | None=None) -> intClamp a numeric value to a specific range.
func
smart_open.utils.make_range_string(start:int | None=None, stop:int | None=None) -> strCreate a byte range specifier in accordance with RFC-2616.
class
smart_open.webhdfs.BufferedOutputBaseWrites bytes to a WebHDFS file in multipart chunks.
method
smart_open.webhdfs.BufferedOutputBase.closed() -> boolReturn True if the stream is closed.
method
smart_open.webhdfs.BufferedOutputBase.detach() -> io.RawIOBaseUnsupported.
method
smart_open.webhdfs.BufferedOutputBase.writable() -> boolReturn True if the stream supports writing.
func
smart_open.webhdfs.convert_to_http_uri(parsed_uri:Any) -> strConvert a parsed webhdfs URI to its HTTP REST URL (compat wrapper).
func
smart_open.webhdfs.open(http_uri:str, mode:str, min_part_size:int=MIN_PART_SIZE) -> BufferedInputBase | BufferedOutputBaseOpen a WebHDFS URI for reading or writing.
func
smart_open.webhdfs.parse_uri(uri_as_str:str) -> _WebHDFSUriReturn the WebHDFS URI as a dict with `scheme` and `uri` keys.
About this data
These signatures were extracted from the public source of piskvorky/smart_open
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.