Glider
|
Functions | |
upload_data_mongo (df) | |
find_upc (upcs, df) | |
find_irsc (isrc, df) | |
delete_files_mongoDB (files) | |
delete_duplicates () | |
upload_main (event, s3_session) | |
Constants | |
collection_name = os.environ.get("COLLECTION") | |
It's the mongo's collection name where sales reports will be storaged. | |
mongo_conn = mongo_connection() | |
collection = mongo_conn.mongo_conn_sales() | |
It's the mongo's collection for sales storage. | |
catalogue_collection = mongo_conn.mongo_conn_catalogue() | |
It's the mongo's collection for catalogue storage. | |
src.importer.UploadSales.delete_duplicates | ( | ) |
Deletes all duplicated sales lines from database (in case of they exist) caused by parallel processing Args: Nothing Returns: Nothing
Definition at line 102 of file UploadSales.py.
src.importer.UploadSales.delete_files_mongoDB | ( | files | ) |
Deletes all files in the current batch from database (in case of they exist) to avoid overwriting Args: files (list): A list which contains all filenames in the current batch splitted by formats Returns: files_delete (list): A list with filenames in the current batch
Definition at line 85 of file UploadSales.py.
src.importer.UploadSales.find_irsc | ( | isrc, | |
df ) |
Makes catalogue matching using isrc as key Args: isrc (list): A list which contains all unique ISRCs in the current batch df (dataframe): Dataframe with sales matched by catalogue Returns: Nothing
Definition at line 59 of file UploadSales.py.
src.importer.UploadSales.find_upc | ( | upcs, | |
df ) |
Makes catalogue matching using upc as key Args: upcs (list): A list which contains all unique UPCs in the current batch df (dataframe): Dataframe with sales matched by catalogue Returns: Nothing
Definition at line 35 of file UploadSales.py.
src.importer.UploadSales.upload_data_mongo | ( | df | ) |
Uploads batch lines to mongodb Args: df (dataframe): Dataframe with sales matched by catalogue Returns: Nothing
Definition at line 24 of file UploadSales.py.
src.importer.UploadSales.upload_main | ( | event, | |
s3_session ) |
Orchestra every function and executes find_irsc function using multiprocessing Args: event (dict): Dictionary result of ProcessFiles.py s3_session: (boto3.session object): S3 session to connect to AWS bucket Returns: Nothing
Definition at line 124 of file UploadSales.py.
src.importer.UploadSales.catalogue_collection = mongo_conn.mongo_conn_catalogue() |
It's the mongo's collection for catalogue storage.
Definition at line 21 of file UploadSales.py.
src.importer.UploadSales.collection = mongo_conn.mongo_conn_sales() |
It's the mongo's collection for sales storage.
Definition at line 19 of file UploadSales.py.
src.importer.UploadSales.collection_name = os.environ.get("COLLECTION") |
It's the mongo's collection name where sales reports will be storaged.
Definition at line 15 of file UploadSales.py.
src.importer.UploadSales.mongo_conn = mongo_connection() |
Definition at line 16 of file UploadSales.py.