Production-grade code analysis package with LLM-powered insights
Project description
Socratic Analyzer
Status: Independent library extracted from Socrates monolith (v0.1.5)
Code analysis and workflow optimization library for project development, quality assessment, and architectural insights. Part of the Socratic Ecosystem.
Overview
Socratic Analyzer provides tools for analyzing project workflows, assessing code complexity, tracking maturity, and identifying optimization opportunities.
Key Capabilities
- Workflow Analysis - Analyze project workflows and process paths
- Complexity Metrics - Calculate workflow costs and identify bottlenecks
- Code Validation - Validate dependencies, syntax, and test execution
- Project Context - Model projects with phases, team structure, and maturity tracking
- Quality Assessment - Track project maturity across phases and categories
- Insight Categorization - Categorize insights and recommendations by workflow phase
Architecture
Core Modules
Workflow Analysis:
WorkflowCostCalculator- Calculate execution costs of workflow pathsWorkflowPathFinder- Discover optimal workflow pathsWorkflowRiskCalculator- Assess risks in workflow execution
Code Quality:
InsightCategorizer- Categorize insights by phase and workflowDependencyValidator- Validate project dependenciesSyntaxValidator- Validate code syntaxTestExecutor- Execute and track test results
Data Models:
ProjectContext- Complete project information and stateTeamMemberRole- Team member roles and skillsWorkflowDefinition- Workflow paths and execution states
Analytics:
AnalyticsCalculator- Calculate metrics from project dataMaturityCalculator- Assess project maturityTokenUsage- Track LLM usage and costs
Installation
# Basic installation
pip install socratic-analyzer
# With framework integrations
pip install socratic-analyzer[langchain]
pip install socratic-analyzer[nexus]
# Development
pip install socratic-analyzer[dev]
Dependencies
Core:
socratic-maturity>=0.1.1- Maturity tracking and assessmentsocratic-nexus>=0.3.6- Multi-provider LLM integration
Optional:
langchain>=0.1.0- LangChain integrationlanggraph>=0.0.1- Graph-based workflows
Quick Start
Analyze a Project
from socratic_analyzer.models import ProjectContext
from socratic_analyzer.core import WorkflowCostCalculator
# Create project context
project = ProjectContext(
project_id="proj-123",
name="MyProject",
owner="user@example.com",
phase="analysis",
created_at=datetime.now(),
updated_at=datetime.now()
)
# Analyze workflow costs
calculator = WorkflowCostCalculator()
costs = calculator.calculate_workflow_costs(project)
print(f"Estimated cost: {costs}")
Validate Code Dependencies
from socratic_analyzer.utils.validators import DependencyValidator
validator = DependencyValidator()
# Check dependency compatibility
issues = validator.validate_dependencies("./requirements.txt")
for issue in issues:
print(f"Issue: {issue['type']} - {issue['message']}")
Track Project Maturity
from socratic_analyzer.maturity_calculator import MaturityCalculator
calculator = MaturityCalculator()
# Calculate overall maturity
maturity = calculator.calculate_maturity(project)
print(f"Project maturity: {maturity.overall_score}%")
print(f"Phase scores: {maturity.phase_maturity_scores}")
Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=src/socratic_analyzer
# Run specific tests
pytest tests/test_module_imports.py -v
Current Coverage: 15.76% (import verification tests) Required Threshold: 5% ✅
Code Quality
All checks passing:
- ✅ Black formatting
- ✅ Ruff linting
- ✅ Mypy type checking (pragmatic for extracted library)
Configuration Examples
Workflow Analysis
from socratic_analyzer.models import WorkflowDefinition, WorkflowNode, WorkflowEdge
# Define workflow
workflow = WorkflowDefinition(
workflow_id="wf-123",
name="Analysis Workflow",
description="Project analysis process",
nodes=[
WorkflowNode(id="start", name="Start", node_type="start"),
WorkflowNode(id="analysis", name="Analysis", node_type="process"),
WorkflowNode(id="review", name="Review", node_type="process"),
WorkflowNode(id="end", name="End", node_type="end"),
],
edges=[
WorkflowEdge(source="start", target="analysis", cost=10),
WorkflowEdge(source="analysis", target="review", cost=15),
WorkflowEdge(source="review", target="end", cost=5),
]
)
Documentation
- ARCHITECTURE.md - System design and component overview
- API Reference - Complete API documentation (when available)
- Integration Guide - How to integrate with other systems
Part of the Socratic Ecosystem
Socratic Analyzer integrates with:
- Socratic Nexus - Multi-provider LLM client
- Socratic Maturity - Maturity tracking (dependency)
- Socratic Agents - Agent orchestration (optional)
- Socratic Learning - Learning patterns (optional)
See Socratic Ecosystem for complete overview.
Contributing
Contributions welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT License - See LICENSE for details.
Support
- Issues: https://github.com/Nireus79/Socratic-analyzer/issues
- Documentation: https://github.com/Nireus79/Socratic-analyzer/tree/main/docs
Built as part of the Socratic ecosystem
Made by @Nireus79
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file socratic_analyzer-0.1.6.tar.gz.
File metadata
- Download URL: socratic_analyzer-0.1.6.tar.gz
- Upload date:
- Size: 60.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33146803c9fc8b05a87637d8b49db4cd7e215b82a522db2e4f2d37d2cd2c6536
|
|
| MD5 |
3049b5ec2905b4ca24d7720d252733aa
|
|
| BLAKE2b-256 |
2a40ae13fc42b8b9c937438749938f0ccc4ed08e908f18c63bc1b5b039a52d39
|
File details
Details for the file socratic_analyzer-0.1.6-py3-none-any.whl.
File metadata
- Download URL: socratic_analyzer-0.1.6-py3-none-any.whl
- Upload date:
- Size: 69.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83d82258541c6f79db8dc5e4538ae53156584a18285a90f3b21004ea3b5890a
|
|
| MD5 |
69dd490d721fa70f9d373edaa41b21d3
|
|
| BLAKE2b-256 |
2f2d4753cb4bd8b1ee6d86a46604e95c0d1b5396432479d30ba405c3b918e7d5
|