Glider
Loading...
Searching...
No Matches
src.upload_module.common.UploadFilesS3 Namespace Reference

Functions

 folder_or_file (local_path, files_list)
 
 upload_files_s3 (bucket, s3_path, local_path, file, mode)
 
 transform_xls_file (local_path, file)
 
 extract_file (bucket, s3_path, local_path, file, compression, final_files)
 
 clean_files (event, local_path)
 

Constants

 file_path = os.path.dirname(__file__)
 
 dotenv_path = os.path.join(file_path, ".env")
 
 ACCESS_ID
 Access keys for AWS.
 
 ACCESS_KEY
 Access keys for AWS.
 
 s3_client = boto3.client("s3", aws_access_key_id=ACCESS_ID, aws_secret_access_key=ACCESS_KEY)
 Connection for AWS using boto3.
 
 date_for_path = date.today()
 Sets the name for s3 path were files will be uploaded according to current date.
 
 mode = None
 

Function Documentation

◆ clean_files()

src.upload_module.common.UploadFilesS3.clean_files ( event,
local_path )

Definition at line 127 of file UploadFilesS3.py.

Here is the call graph for this function:

◆ extract_file()

src.upload_module.common.UploadFilesS3.extract_file ( bucket,
s3_path,
local_path,
file,
compression,
final_files )
Extract files from a compressed file, delete blank spaces  

Args:
    local_path (str): Root path where is saved files
    files (str): File to decompress
    compression (str): Type of compression (gz, zip)
Returns : Nothing.

Definition at line 96 of file UploadFilesS3.py.

Here is the caller graph for this function:

◆ folder_or_file()

src.upload_module.common.UploadFilesS3.folder_or_file ( local_path,
files_list )
Moves all files (in fub folders) to root path

Args:
    local_path (str): Root path where is saved files
    files_list (list): list where each file is allocated to be moved posteriorly
Returns : Nothing.

Definition at line 29 of file UploadFilesS3.py.

Here is the caller graph for this function:

◆ transform_xls_file()

src.upload_module.common.UploadFilesS3.transform_xls_file ( local_path,
file )
Converts xls file (it contains fx rates for apple) to csv file

Args:
    local_path (str): Root path where is saved files
    files (str): File to convert
Returns : Nothing.

Definition at line 68 of file UploadFilesS3.py.

Here is the caller graph for this function:

◆ upload_files_s3()

src.upload_module.common.UploadFilesS3.upload_files_s3 ( bucket,
s3_path,
local_path,
file,
mode )
Uploads all files to s3 path defined previously

Args:
    local_path (str): Root path where is saved files
    files (str): File to upload
Returns : Nothing.

Definition at line 47 of file UploadFilesS3.py.

Constant Documentation

◆ ACCESS_ID

src.upload_module.common.UploadFilesS3.ACCESS_ID

Access keys for AWS.

Definition at line 17 of file UploadFilesS3.py.

◆ ACCESS_KEY

src.upload_module.common.UploadFilesS3.ACCESS_KEY

Access keys for AWS.

Definition at line 17 of file UploadFilesS3.py.

◆ date_for_path

src.upload_module.common.UploadFilesS3.date_for_path = date.today()

Sets the name for s3 path were files will be uploaded according to current date.

Definition at line 23 of file UploadFilesS3.py.

◆ dotenv_path

src.upload_module.common.UploadFilesS3.dotenv_path = os.path.join(file_path, ".env")

Definition at line 13 of file UploadFilesS3.py.

◆ file_path

src.upload_module.common.UploadFilesS3.file_path = os.path.dirname(__file__)

Definition at line 12 of file UploadFilesS3.py.

◆ mode

src.upload_module.common.UploadFilesS3.mode = None

Definition at line 26 of file UploadFilesS3.py.

◆ s3_client

src.upload_module.common.UploadFilesS3.s3_client = boto3.client("s3", aws_access_key_id=ACCESS_ID, aws_secret_access_key=ACCESS_KEY)

Connection for AWS using boto3.

Definition at line 20 of file UploadFilesS3.py.