114 lines
3.4 KiB
Markdown
114 lines
3.4 KiB
Markdown
# Python LinkedIn Analyzer (Gemini AI)
|
|
|
|
This is a standalone Python version of the LinkedIn Job Analyzer, utilizing the latest `gemini-2.5-flash` model.
|
|
|
|
### Setup
|
|
|
|
1. Install the required Google Generative AI SDK:
|
|
```bash
|
|
pip install google-generativeai
|
|
```
|
|
|
|
2. Save the code below as `linkedin_analyzer.py` and run it:
|
|
|
|
```python
|
|
import os
|
|
import google.generativeai as genai
|
|
|
|
# ==========================================
|
|
# 1. Configuration
|
|
# ==========================================
|
|
# Replace with your actual Gemini API Key
|
|
API_KEY = "YOUR_API_KEY_HERE"
|
|
|
|
# Configure the API with the key
|
|
genai.configure(api_key=API_KEY)
|
|
|
|
# Use the latest, stable model supported by generateContent
|
|
MODEL_NAME = "gemini-2.5-flash"
|
|
|
|
try:
|
|
model = genai.GenerativeModel(MODEL_NAME)
|
|
except Exception as e:
|
|
print(f"Error loading model: {e}")
|
|
exit(1)
|
|
|
|
# ==========================================
|
|
# 2. User & Job Data
|
|
# ==========================================
|
|
USER_PROFILE = """
|
|
HAMZA AYED — Solutions Architect | Senior Flutter Developer | GIS & Mapping Expert
|
|
|
|
SUMMARY:
|
|
Solutions Architect with 6+ years building complete mobile ecosystems. Built two ride-hailing platforms (Fawry & Sayig) with 1,200+ users. Created proprietary offline map technology (Mapss) replacing Google Maps API and saving $10k+/month. Specialized in Dart, Python, and scalable backend infrastructure.
|
|
"""
|
|
|
|
JOB_POSTING = """
|
|
Job Title: Technical Architect (AI, Cloud, Distributed Systems & Banking Payments)
|
|
Company: International Turnkey Systems - ITS
|
|
Location: Cairo, Egypt (Hybrid)
|
|
Description:
|
|
We are looking for a highly skilled Technical Architect with deep experience in AI, cloud-native architectures, distributed systems, and banking payments...
|
|
"""
|
|
|
|
# ==========================================
|
|
# 3. AI Analysis Function
|
|
# ==========================================
|
|
def analyze_job():
|
|
print(f"🔄 Analyzing job with {MODEL_NAME}...\n")
|
|
|
|
prompt = f"""
|
|
You are an elite career strategist with 15+ years hiring for top tech companies in MENA.
|
|
Respond entirely in Arabic.
|
|
Perform a DEEP strategic analysis of this job against my profile. Be brutally honest.
|
|
|
|
MY PROFILE:
|
|
{USER_PROFILE}
|
|
|
|
JOB POSTING:
|
|
{JOB_POSTING}
|
|
|
|
Respond in this EXACT structure:
|
|
|
|
## MATCH SCORE: X/100
|
|
|
|
### Score Breakdown:
|
|
- **Technical Skills Match:** X/30
|
|
- **Experience Level Match:** X/25
|
|
- **Domain/Industry Match:** X/20
|
|
- **Location & Logistics:** X/15
|
|
- **Culture & Soft Skills:** X/10
|
|
|
|
## WHERE I CRUSH IT
|
|
- [Specific matching skills]
|
|
|
|
## HONEST GAPS
|
|
- [Missing requirements]
|
|
|
|
## VERDICT
|
|
[APPLY NOW / APPLY WITH PREP / LONG SHOT / SKIP]
|
|
"""
|
|
|
|
try:
|
|
# Generate the response
|
|
response = model.generate_content(prompt)
|
|
|
|
print("✅ ANALYSIS COMPLETE:\n")
|
|
print("="*60)
|
|
print(response.text)
|
|
print("="*60)
|
|
|
|
except Exception as e:
|
|
print(f"❌ API Error: {e}")
|
|
print("\nNote: If you get a 'Model not supported' error, ensure your API key has access to the 2.5/2.0 series or check your Google AI Studio project settings.")
|
|
|
|
# ==========================================
|
|
# Run the script
|
|
# ==========================================
|
|
if __name__ == "__main__":
|
|
if API_KEY == "YOUR_API_KEY_HERE":
|
|
print("⚠️ Please update the API_KEY variable at the top of the script first!")
|
|
else:
|
|
analyze_job()
|
|
```
|