Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python programming assistance needed

MechEngineer2012

Mechanical
Feb 8, 2017
41
Hello everyone,

I am new to Python and looking to develop a simple automation tool for a repetitive task I frequently face at work.


Task Description:
When an email is received from an end user on outlook, it typically includes the part description, quantity needed, and the user's company name. I need to forward this request to another person, but with some modifications:
  • Remove the original sender's name and company information (avoiding disclosure of the end user to the vendor).
  • Keep the rest of the message content unchanged.
  • Send the modified content in a new email to a specific another recipient.

Goal:
I would like to automate this process as much as possible — ideally without manually creating a new email, entering the recipient’s email address, subject line, or message body each time.
  • Is it possible to build this functionality using Python?
  • What tools or libraries would be most effective for this?
  • To what extent can this process be fully automated?

Any guidance or suggestions would be greatly appreciated. Thank you!
 
Replies continue below

Recommended for you

So I'm curious, what have you tried at this point in time? Sounds like you're doing some fishing for answers which can be a good exercise sometimes. I have no experience with Python integration with outlook's desktop application. Is it possible? Maybe, hard to say. How will you ensure the email that you are forwarding on is sent to the correct individual? Are all the emails that you receive that need PII cleansed then being forwarded to a single recipient, or do you have multiple recipients based on the order requirement(s)? If there are potentially multiple recipients, what logic do you intend to implement into the automation to ensure the correct message goes to the correct recipient?
 
Programmatic processing of text is obviously possible, but, programmatics imply algorithmic knowledge and configuration of the emails, i.e., they will need to adhere to a fairly rigid text structure so that the program can pluck out the desired information and dump the rest. So, if you can guarantee that the information in the emails are structured similarly, then some sort of program is possible.

On the other hand, there are large language model (LLM) "AI" programs that can usually "read" free form documents and be able to summarize them and be able to answer questions about them. So, something like Claude could possibly "read" such emails and summarize them. Claude has an API,. which presumably could be accessed by Python, so one could imagine having a Python script that would receive such emails, call Claude to summarize them, and then ask Claude for the order information, and send a separate email with only the relevant information included.

It's still possible to essentially emulate an LLM, to parse relatively free form text, and extract the relevant information, but it'll be a much large programming task, I think. Mostly, it'll be a long list of exceptions and inclusions, but still not impossible.
 

Part and Inventory Search

Sponsor