Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Python What should be my next steps to solve this sorting/resolving issue?

chrswe03

New Coder
Hi all, first post here.

Working on a project for corp, we take in lots of emails and need to process them accordingly, my role is to automate this process however possible..

What I've done so far:
- Grab the email, convert it out of .msg format and into a more friendly format.
- Developed the automation to complete the process, given the input I am currently passing in manually.

I need to have a bot look at these emails, examples below, and be able to extract certain fields. Although the names of these fields change on an email-per-email basis. I was thinking filter by regex, but this would be very finicky and not a proper solution that would be scalable to any capacity. My mind next went to AI or ML, and while I am sure this is the secure, scalable solution, it is very much out of my realm of expertise. And do not know where to start. Not asking for someone to make it and just spoonfeed, but just some advice for how and where to start...

The big picture is to take the emails below, and extract certain info and fit it into a list that has standardized names for these required fields.

Py Dictionary currently in play for context, and a few definitions for readability:
VNDR = Vendor or Customer, MAINT = Maintenance Event, REC = Recieved, PRIM = Primary
Python:
    'VNDR_NAME': "",
    'MAINT_ID': "",
    'MAINT_DESC': "",
    'MAINT_DATE_REC': "",
    'MAINT_HOUR_REC': "",
    'MAINT_MIN_REC': "",
    'MAINT_OUTAGE_NUM': "",
    'MAINT_OUTAGE_UNT': "",
    'MAINT_CITY': "",
    'MAINT_STATE': "",
    'MAINT_PRIM_START_DATE': "",
    'MAINT_PRIM_END_DATE': "",
    'MAINT_PRIM_START_HOUR': "",
    'MAINT_PRIM_END_HOUR': "",
    'MAINT_PRIM_START_MIN': "",
    'MAINT_PRIM_END_MIN': "",

Examples of emails to be received:

Any info provided in bold is what is deemed critical for extraction.

Example #1:

Big Box Store Maintenance Notifications
Notification Type
Please take note of this maintenance activity being performed on the Big Box Store.
Dates and Times (All times are local to the work listed and reflect daylight savings.)
Date Sent 09/19/2029 01:02PM CDT
Customer INTERNAL COMPANY NAME
Description STD | LOS | Reason for work
Work Location CITY, ST
Ticket CRS000009999999/TAR000009999999
Time Zone Central
Planned Start 09/12/2029 12:00AM CDT
Planned End 09/12/2029 06:00AM CDT
Window The Big Box Store standard maintenance window is Mon-Fri (12:00am-6:00am). For
multi-night maintenances, work will begin and end during this window each day.

Impact Details:
Impact Type Loss of Service
Duration 180 (minutes)

Location Requirements: (If there are location specific instructions, they'll be outlined here.)
Big Box Store technicians may on occasion require access to a client location(s). When site access is needed, the client will receive a separate notification from Big Box Store Change Management to coordinate access for that location(s).

Circuits:
Customer Location CircuitID Address Impact INTERNAL- LEGACY INTERNAL Z-side A-side
INTERNAL- ADDRESS//ADDRESS 99.A9AA.999999..AAAA ADDRESS Loss of Service

Example #2:

Small Box Store Maintenance Notification

This email serves as official notification that Small Box Store and/or one of its providers will be performing maintenance on its network as described below. This maintenance may affect services you have with us.

Maintenance Ticket #: AAA-0001112345
Urgency: Demand
Date Notice Sent: 01-Apr-2029
Customer: INTERNAL

Maintenance Window
1st Activity Date
08-Apr-2029 07:00 to 08-Apr-2029 19:00 ( Eastern )
08-Apr-2029 11:00 to 08-Apr-2029 23:00 ( GMT )


Location of Maintenance: City, ST

Reason for Maintenance: Small Box Store's service provider will perform demand fiber maintenance. Work will be performed during the daytime due to power safety requirements. As this maintenance is not under the control of Small Box Store, it may not be possible to reschedule it. Small Box Store sincerely apologizes for any inconvenience caused by this maintenance.

Expected Impact: Service Affecting Activity: Any Maintenance Activity directly impacting the service(s) of customers. Service(s) are expected to go down as a result of these activities.

Circuit(s) Affected:

Circuit Id Expected Impact A Location Address Z Location Address Customer Circuit ID
OABC/123456//DEF Hard Down - Duration of maintenance window ADDRESS ADDRESS

OABC/123457//DEF Hard Down - Duration of maintenance window ADDRESS ADDRESS

OABC/123458//DEF Switch Hit(s) ADDRESS ADDRESS

OABC/123459//DEF Switch Hit(s) ADDRESS ADDRESS

OABC/123460//DEF Hard Down - Duration of maintenance window ADDRESS ADDRESS ETH100-123458

Please contact the Small Box Store Maintenance Team with any questions regarding this maintenance event. Please reference the Maintenance Ticket number when calling.

Thank you so much, for anyone who has any valuable input!
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom