File size: 1,217 Bytes
c9c54fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# enrich.py
import pandas as pd
import random

# Simulate enrichment for now
def enrich_company_info(name, website):
    return {
        "LinkedIn Employees": random.randint(10, 1000),
        "Tech Stack": random.choice(["React, Node.js", "PHP, MySQL", "Django, PostgreSQL"]),
        "Funding (USD)": random.choice([None, 500000, 2000000, 10000000]),
        "Glassdoor Rating": round(random.uniform(2.5, 4.9), 1),
        "SSL Secure": website.startswith("https")
    }

def score_lead(row):
    score = 0
    if row["LinkedIn Employees"] > 100: score += 20
    if row["Funding (USD)"] and row["Funding (USD)"] > 1000000: score += 30
    if row["Glassdoor Rating"] > 4: score += 20
    if "React" in row["Tech Stack"] or "Django" in row["Tech Stack"]: score += 20
    if row["SSL Secure"]: score += 10
    return score

def enrich_and_score(df):
    enriched_data = []
    for _, row in df.iterrows():
        company_info = enrich_company_info(row['Company Name'], row['Website'])
        full_data = {**row, **company_info}
        enriched_data.append(full_data)
    enriched_df = pd.DataFrame(enriched_data)
    enriched_df["Lead Score (0-100)"] = enriched_df.apply(score_lead, axis=1)
    return enriched_df