Resume_and_CV_crafter / flowchart.py
Niharmahesh's picture
Upload folder using huggingface_hub
d015b2a verified
raw
history blame
3.18 kB
import graphviz
import streamlit as st
def display_architecture_diagram():
# Create a directed graph
graph = graphviz.Digraph(format='png')
# Define node styles
styles = {
'start': {'shape': 'cylinder', 'style': 'filled', 'fillcolor': '#22c55e', 'fontcolor': 'white'},
'input': {'shape': 'box', 'style': 'filled', 'fillcolor': '#f97316', 'fontcolor': 'white'},
'decision': {'shape': 'diamond', 'style': 'filled', 'fillcolor': '#0ea5e9', 'fontcolor': 'white'},
'process': {'shape': 'box', 'style': 'filled', 'fillcolor': '#8b5cf6', 'fontcolor': 'white'},
'output': {'shape': 'box', 'style': 'filled', 'fillcolor': '#ec4899', 'fontcolor': 'white'}
}
# Add nodes
graph.node('Start', 'πŸš€ Start\nApplication', **styles['start'])
graph.node('Upload', 'πŸ“„ Upload DOCX\nResume', **styles['input'])
graph.node('JobDesc', 'πŸ’Ό Input Job\nDescription', **styles['input'])
graph.node('ApiKey', 'πŸ”‘ Input GROQ\nAPI Key', **styles['input'])
graph.node('ChooseAction', 'πŸ”„ Choose\nAction', **styles['decision'])
graph.node('AnalysisType', 'πŸ“Š Analysis\nType', **styles['decision'])
# Add process nodes with detailed content
quick_analysis = """Quick Analysis
──────────────
β€’ Skills Match Rating
β€’ Experience Alignment
β€’ Pros and Cons
β€’ Match Percentage"""
graph.node('QuickAnalysis', quick_analysis, **styles['process'])
in_depth = """In-Depth Analysisc
──────────────
β€’ Comprehensive Skill Gap
β€’ Detailed Experience Review
β€’ Career Path Alignment
β€’ Strategic Recommendations"""
graph.node('InDepthAnalysis', in_depth, **styles['process'])
enhancement = """Resume Enhancement
──────────────
β€’ In-Depth Analysis
β€’ Format Optimization
β€’ Content Improvement
β€’ Design Enhancement"""
graph.node('Enhancement', enhancement, **styles['process'])
# Add output nodes
results = """Analysis Results
──────────────
πŸ“Š Analysis Summary
πŸ“ Recommendations
βœ… Action Items"""
graph.node('Results', results, **styles['output'])
enhanced = """Enhanced Resume
──────────────
πŸ“‘ Optimized DOCX
πŸ–οΈ Text Highlighting Changes
🌐 HTML Version"""
graph.node('EnhancedOutputs', enhanced, **styles['output'])
# Add edges
graph.edge('Start', 'Upload')
graph.edge('Upload', 'JobDesc')
graph.edge('JobDesc', 'ApiKey')
graph.edge('ApiKey', 'ChooseAction')
graph.edge('ChooseAction', 'AnalysisType', 'Analyze')
graph.edge('ChooseAction', 'Enhancement', 'Enhance')
graph.edge('AnalysisType', 'QuickAnalysis', 'Quick')
graph.edge('AnalysisType', 'InDepthAnalysis', 'In-Depth')
graph.edge('QuickAnalysis', 'Results')
graph.edge('InDepthAnalysis', 'Results')
graph.edge('Enhancement', 'EnhancedOutputs')
graph.edge('Results', 'ChooseAction', 'New Analysis')
graph.edge('EnhancedOutputs', 'ChooseAction', 'New Analysis')
# Graph settings
graph.attr(rankdir='TB', splines='ortho')
return graph