aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/parse_emails.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/parse_emails.py b/python/parse_emails.py
index 4081d39b..4ff32602 100644
--- a/python/parse_emails.py
+++ b/python/parse_emails.py
@@ -58,8 +58,9 @@ def makedf(r, indextype, quote_source):
def parse_quotedate(fh, date_received):
for line in fh:
line = line.rstrip()
- if "At:" in line:
- for p in ['%m/%d/%y %H:%M:%S', '%b %d %Y %H:%M:%S', '%m/%d %H:%M:%S']:
+ if "At:" in line or "Sent:" in line:
+ for p in ["%m/%d/%y %H:%M:%S", "%b %d %Y %H:%M:%S", "%m/%d %H:%M:%S",
+ "%B %d, %Y %H:%M %p"]:
try:
quotedate = pd.to_datetime(line, format=p, exact=False)
except ValueError:
@@ -386,7 +387,7 @@ def parse_citi(fh, indextype, series, quotedate):
subject_baml = re.compile(r"(?:Fwd:){0,2}(?:BAML )?(\w{2})([0-9]{1,2})\s")
subject_ms = re.compile(r"[^$]*\$\$ MS CDX OPTIONS: (IG|HY)(\d{2})[^-]*- REF[^\d]*([\d.]+)")
subject_nom = re.compile(r"(?:Fwd:)?CDX (IG|HY)(\d{2}).*- REF:[^\d]*([\d.]+)")
-subject_gs = re.compile(r"GS (IG|HY)(\d{2}) 5y.*- Ref [^\d]*([\d.]+)")
+subject_gs = re.compile(r"(?:FW: )?GS (IG|HY)(\d{2}) 5y.*- Ref [^\d]*([\d.]+)")
subject_sg = re.compile(r"SG OPTIONS - CDX (IG|HY) S(\d{2}).* REF[^\d]*([\d.]+)")
subject_citi = re.compile(r"(?:Fwd:)?Citi Options: (IG|HY)(\d{2}) 5Y")