person_search
code
Python
verified
Free Download
devices
Cross-platform
code Code Preview
Python#!/usr/bin/env python3
"""
Personalization Helper
Extract personalization variables from bio text and profiles
"""
import re
def extract_variables(bio_text):
"""Extract personalization variables from bio/profile text"""
variables = {}
# Extract company name
company_patterns = [
r'(?:at|@)\s+([A-Z][A-Za-z0-9\s&]+?)(?:\s*[,.|]|$)',
r'(?:founder|ceo|cto|vp|director)\s+(?:of|at)\s+([A-Z][A-Za-z0-9\s&]+)',
]
for pattern in company_patterns:
match = re.search(pattern, bio_text, re.I)
if match:
variables['company'] = match.group(1).strip()
break
# Extract job title
titles = ['CEO', 'CTO', 'COO', 'CFO', 'VP', 'Director',
'Manager', 'Lead', 'Head', 'Founder', 'Co-Founder']
for title in titles:
if re.search(rf'\b{title}\b', bio_text, re.I):
variables['title'] = title
break
# Extract location
location_match = re.search(
r'(?:in|based in|located in)\s+([A-Z][a-z]+(?:\s*,\s*[A-Z]{2})?)',
bio_text
)
if location_match:
variables['location'] = location_match.group(1)
# Extract industry keywords
industries = ['SaaS', 'FinTech', 'HealthTech', 'EdTech',
'E-commerce', 'Marketing', 'Sales', 'HR']
for industry in industries:
if industry.lower() in bio_text.lower():
variables['industry'] = industry
break
return variables
def generate_personalized_line(variables):
"""Generate personalized opening line"""
if 'company' in variables and 'title' in variables:
return f"As {variables['title']} at {variables['company']}"
elif 'company' in variables:
return f"I noticed you're at {variables['company']}"
elif 'industry' in variables:
return f"Fellow {variables['industry']} professional"
return "I came across your profile"
if __name__ == '__main__':
bio = "CEO at TechStartup Inc. Based in San Francisco. Building SaaS."
vars = extract_variables(bio)
print(f"Variables: {vars}")
print(f"Opening: {generate_personalized_line(vars)}")
info About This Tool
The Personalization Helper extracts useful variables from bio text, LinkedIn profiles, and other sources. Turn unstructured text into structured merge fields for email personalization.
Key Features
- Auto Extraction - Identifies company, title, location automatically
- Pattern Matching - Multiple patterns for accurate extraction
- Industry Detection - Identifies industry keywords
- Opening Generator - Creates personalized first lines
- Batch Processing - Process multiple bios at once
Extracted Variables
- company - Company or organization name
- title - Job title (CEO, VP, Director, etc.)
- location - City or region
- industry - Industry vertical (SaaS, FinTech, etc.)
Requirements
- Python 3.7+
- No external dependencies
Pro Tip: Combine with Mail Merge Tool for fully automated personalized outreach.
download Download Script
Need Full Automation?
Try Postigo for automated email campaigns with AI personalization
rocket_launch Start Free Trial