Skip to content

ML Model for Selecting Courier Partner which should lead to better customer satisfaction along with Automating complete shipping process right from generating AWB no then, Editing Label as per the client's requirement and Finally sending PDF Label as an attachment via email to Printing Executive along with a WhatsApp notification to Packing Repr…

Notifications You must be signed in to change notification settings

krishna-NIT/Courier-Selecting-ML-Model-with-Shipping-Automation

Repository files navigation

Courier selecting ML Model with Shipping Automation

Aim :

  • Build ML Model for Selecting Courier Partner which should lead to better customer satisfaction along with Automating complete shipping process right from generating AWB no then, Editing Label as per the client's requirement and Finally sending PDF Label as an attachment via email to Printing Executive along with a WhatsApp notification to Packing Representative.
  • On Razorpay webhook Trigger, we want AWS lambda + AWS CloudWatch to Schedules execution of script after 30 min

Client's Problem Statement:

  1. Selecting courier partner is manual, we have to automate that with high performance courier partner ML Model build on previous data.
  2. Client don't want his address and contact details should be printed label.
  3. Sending edited PDF Label to Printing Executive over Mail so that he can print label and provide it to Packing Team.
  4. Sending WhatsApp Notification to Packaging Executive so that he can start packing.
  5. Client wants to execute entire Process to happen after 30 minutes from placing order.

Provided Solution to Client (via this project):

  1. Build an ML Model which first….
  2. Use of PDF.CO API for Editing PDF Label as per the requirement.
  3. By using Google Cloud Gmail API via oAuth 2.0
  4. By using Twilio API using Sandbox 2.0
  5. Hosted complete project on AWS then after webhook request from Razorpay, Script is scheduled to run after 30 min by using AWS Lambda and AWS CloudWatch. sample 3

Automation using AWS S3, Lambda, EventBridge build on CloudWatch



  • Selecting Best courier partner as per the previous performance of the courier partner.
  • Shipping Automation
    • Fetching all orders details
    • Filtering order status & storing shipping id
    • Generating AWB for respective courier partner ( assisted by ML Model)
    • Scheduling pickup for earliest date
    • Generating Packing Label
    • Removing shipper address from generated pdf label
    • Download final label
      • Sending Gmail to Printing Team with Label PDF attachment
      • Sending WhatsApp Notification to Packing Team

Things to take care of while Hosting Automation on AWS

  • Use AWS S3 to upload .zip file of code to AWS Lambda because after all packages size > 30 MB
  • replace main() to def lambda_handler(event, context):
  • rename app.py to lambda_function.py
  • Don't forget to include Google.py (It's has oAuth 2.0 Script)
  • Use pip install package-name -t directory_name to install all required library
  • In Lambda function, change timeout configuration from by default 3 sec to 15 min (else script will stop working in between)
  • In AWS EventBridge, set cron() function as per requirement so, Refer: cron() function
  • Don't forget to include token.json (generated by OAuth 2.0) and credentials.json (GCloud) while making .zip to upload it in S3

Courier Selecting ML Model



Work under progress



How to Use ?

  • Generate All your API Keys and Credentials from API Links provided below
  • Change Localhost Port (If running locally) eg, 4080
  • Replace the credentials within app.py file
  • Do required changes as mentioned above for AWS
  • Run 🚀🚀 and Save your Time

TechStack Used

Python NumPy Pandas scikit-learn AWS Google Cloud Postman

API Docs :

PS: This Automation will save a salary of 1 person 🚀 Approx . (20k/month) 🥳
🥂 Party toh banti hai, boss! 🥂

About

ML Model for Selecting Courier Partner which should lead to better customer satisfaction along with Automating complete shipping process right from generating AWB no then, Editing Label as per the client's requirement and Finally sending PDF Label as an attachment via email to Printing Executive along with a WhatsApp notification to Packing Repr…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages