class_docstr: Transfer files from an SFTP server to Amazon S3.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:SFTPToS3Operator`
  
  :param sftp_conn_id: The sftp connection id. The name or identifier for
      establishing a connection to the SFTP server.
  :param sftp_path: The sftp remote path. This is the specified file path
      for downloading the file from the SFTP server.
  :param s3_conn_id: The s3 connection id. The name or identifier for
      establishing a connection to S3
  :param s3_bucket: The targeted s3 bucket. This is the S3 bucket to where
      the file is uploaded.
  :param s3_key: The targeted s3 key. This is the specified path for
      uploading the file to S3.
  :param use_temp_file: If True, copies file first to local,
      if False streams file from SFTP to S3.
class_docstr_tok: ["Transfer","files","from","an","SFTP","server","to","Amazon","S3",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","SFTPToS3Operator","`",":","param","sftp_conn_id",":","The","sftp","connection","id",".","The","name","or","identifier","for","establishing","a","connection","to","the","SFTP","server",".",":","param","sftp_path",":","The","sftp","remote","path",".","This","is","the","specified","file","path","for","downloading","the","file","from","the","SFTP","server",".",":","param","s3_conn_id",":","The","s3","connection","id",".","The","name","or","identifier","for","establishing","a","connection","to","S3",":","param","s3_bucket",":","The","targeted","s3","bucket",".","This","is","the","S3","bucket","to","where","the","file","is","uploaded",".",":","param","s3_key",":","The","targeted","s3","key",".","This","is","the","specified","path","for","uploading","the","file","to","S3",".",":","param","use_temp_file",":","If","True",",","copies","file","first","to","local",",","if","False","streams","file","from","SFTP","to","S3","."]
docstr: Parse the correct format for S3 keys regardless of how the S3 url is passed.
docstr_tok: ["Parse","the","correct","format","for","S3","keys","regardless","of","how","the","S3","url","is","passed","."]
code: def get_s3_key(s3_key: str) -> str:
      """Parse the correct format for S3 keys regardless of how the S3 url is passed."""
      parsed_s3_key = urlsplit(s3_key)
      return parsed_s3_key.path.lstrip("/")
  
file_path: airflow/airflow/providers/amazon/aws/transfers/sftp_to_s3.py
imports: from __future__ import annotations
  from tempfile import NamedTemporaryFile
  from typing import TYPE_CHECKING, Sequence
  from urllib.parse import urlsplit
  from airflow.models import BaseOperator
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
  from airflow.providers.ssh.hooks.ssh import SSHHook
label_desc: Use image node_id 2 for calling the SFTPToS3Operator obj's underlying member method code with example usage: obj.get_s3_key(s3_key) and returns: parsed_s3_key