Skip to content

Commit cd78d2a

Browse files
GeneAIclaude
andcommitted
feat: Publish empathy-framework v1.6.1 to PyPI
Published the Empathy Framework to PyPI under the name "empathy-framework" since "empathy" was already taken. Package is now publicly available at: https://pypi.org/project/empathy-framework/ Major Changes: - Changed package name from "empathy" to "empathy-framework" in pyproject.toml - Updated README.md with new installation instructions and badge URLs - Ran black formatter and ruff linter across entire codebase - Fixed 307 linting issues automatically with ruff --fix - Temporarily excluded 2 example files with syntax errors from distribution - Applied isort to fix import ordering in wizard files Package Details: - Version: 1.6.1 - Size: 206KB (wheel), 816KB (source) - Python: 3.10+ - License: Fair Source 0.9 Installation: pip install empathy-framework pip install empathy-framework[full] # Recommended Distribution Files: - empathy_framework-1.6.1-py3-none-any.whl - empathy_framework-1.6.1.tar.gz Code Quality: - Black formatting applied to empathy_llm_toolkit/providers.py - Ruff auto-fixes applied to 17 wizard files - Import sorting fixed with isort on 7 wizard files - All packages validated with twine check Next Steps: - Fix syntax errors in bug_prediction.py and debugging_assistant.py - Address remaining linting warnings for future release 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f36f67d commit cd78d2a

21 files changed

+1303
-895
lines changed

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ global-exclude .git*
3939
global-exclude .env
4040
global-exclude .vscode
4141
global-exclude .idea
42+
43+
# Temporarily exclude examples with syntax errors (to be fixed)
44+
exclude examples/bug_prediction.py
45+
exclude examples/debugging_assistant.py

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
**A five-level maturity model for AI-human collaboration**
44

55
[![License](https://img.shields.io/badge/License-Fair%20Source%200.9-blue.svg)](LICENSE)
6-
[![PyPI version](https://img.shields.io/pypi/v/empathy.svg)](https://pypi.org/project/empathy/)
7-
[![Python 3.10+](https://img.shields.io/pypi/pyversions/empathy.svg)](https://www.python.org/downloads/)
6+
[![PyPI version](https://img.shields.io/pypi/v/empathy-framework.svg)](https://pypi.org/project/empathy-framework/)
7+
[![Python 3.10+](https://img.shields.io/pypi/pyversions/empathy-framework.svg)](https://www.python.org/downloads/)
88
[![Tests](https://github.com/Smart-AI-Memory/empathy/actions/workflows/tests.yml/badge.svg)](https://github.com/Smart-AI-Memory/empathy/actions/workflows/tests.yml)
99
[![codecov](https://codecov.io/gh/Smart-AI-Memory/empathy/branch/main/graph/badge.svg)](https://codecov.io/gh/Smart-AI-Memory/empathy)
1010
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Smart-AI-Memory/empathy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Smart-AI-Memory/empathy)
1111
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
1212
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
13-
[![Downloads](https://img.shields.io/pypi/dm/empathy.svg)](https://pypi.org/project/empathy/)
13+
[![Downloads](https://img.shields.io/pypi/dm/empathy-framework.svg)](https://pypi.org/project/empathy-framework/)
1414

1515
---
1616

1717
## Quick Start
1818

1919
```bash
2020
# Install core framework
21-
pip install empathy
21+
pip install empathy-framework
2222

2323
# Install with Claude Code + MemDocs transformative stack (recommended)
24-
pip install empathy[full]
24+
pip install empathy-framework[full]
2525

2626
# Or install specific components:
27-
pip install empathy[llm] # LLM providers (Anthropic, OpenAI)
28-
pip install empathy[memdocs] # MemDocs integration
29-
pip install empathy[all] # Everything including dev tools
27+
pip install empathy-framework[llm] # LLM providers (Anthropic, OpenAI)
28+
pip install empathy-framework[memdocs] # MemDocs integration
29+
pip install empathy-framework[all] # Everything including dev tools
3030
```
3131

3232
**Development installation:**

empathy_llm_toolkit/providers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def __init__(
109109

110110
self.client = anthropic.Anthropic(api_key=api_key)
111111
except ImportError as e:
112-
raise ImportError("anthropic package required. Install with: pip install anthropic") from e
112+
raise ImportError(
113+
"anthropic package required. Install with: pip install anthropic"
114+
) from e
113115

114116
async def generate(
115117
self,

examples/bug_prediction.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
Licensed under the Apache License, Version 2.0
1717
"""
1818

19-
from typing import Dict, List, Any
19+
from typing import Any, Dict, List
20+
2021
from empathy_os import (
2122
EmpathyOS,
23+
FeedbackLoopDetector,
2224
Level4Anticipatory,
2325
LeveragePointAnalyzer,
24-
PatternLibrary,
2526
Pattern,
26-
FeedbackLoopDetector
27+
PatternLibrary,
2728
)
2829

2930

@@ -413,19 +414,19 @@ def main():
413414
print("Bug Prediction - Level 4 Anticipatory Empathy")
414415
print("=" * 70)
415416

416-
# Initialize predictor
417-
predictor = BugPredictor(team_id="team_backend")
417+
# Initialize predictor
418+
predictor = BugPredictor(team_id="team_backend")
418419

419-
print(f"\n✓ Bug predictor initialized for team: team_backend")
420-
print(f" Empathy Level: {predictor.empathy.target_level} (Anticipatory)")
421-
print(f" Anti-patterns loaded: {len(predictor.pattern_library.patterns)}")
420+
print(f"\n✓ Bug predictor initialized for team: team_backend")
421+
print(f" Empathy Level: {predictor.empathy.target_level} (Anticipatory)")
422+
print(f" Anti-patterns loaded: {len(predictor.pattern_library.patterns)}")
422423

423-
# ========================================
424-
# Scenario: Analyze codebase trajectory
425-
# ========================================
426-
print("\n" + "=" * 70)
427-
print("Analyzing Codebase Trajectory")
428-
print("=" * 70)
424+
# ========================================
425+
# Scenario: Analyze codebase trajectory
426+
# ========================================
427+
print("\n" + "=" * 70)
428+
print("Analyzing Codebase Trajectory")
429+
print("=" * 70)
429430

430431
# Current state
431432
current_metrics = {

examples/debugging_assistant.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
Licensed under the Apache License, Version 2.0
1515
"""
1616

17-
from typing import Dict, List, Any
17+
from typing import Any, Dict, List
1818

1919
from empathy_os import (
2020
EmpathyOS,
21+
FeedbackLoopDetector,
2122
Level3Proactive,
22-
PatternLibrary,
2323
Pattern,
24+
PatternLibrary,
2425
TrustBuildingBehaviors,
25-
FeedbackLoopDetector
2626
)
2727

2828

@@ -357,8 +357,8 @@ def main():
357357
print("Debugging Assistant - Level 3 Proactive Empathy")
358358
print("=" * 70)
359359

360-
# Initialize assistant
361-
assistant = DebuggingAssistant(developer_id="dev_alice")
360+
# Initialize assistant
361+
assistant = DebuggingAssistant(developer_id="dev_alice")
362362

363363
print(f"\n✓ Debugging assistant initialized for developer: dev_alice")
364364
print(f" Empathy Level: {assistant.empathy.target_level} (Proactive)")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=68.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "empathy"
6+
name = "empathy-framework"
77
version = "1.6.1"
88
description = "A five-level maturity model for AI-human collaboration with anticipatory empathy"
99
readme = {file = "README.md", content-type = "text/markdown"}

wizards/__init__.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,70 +6,77 @@
66
# Wizard router imports following Conditional Imports Pattern
77
try:
88
from .sbar_wizard import router as sbar_wizard_router
9+
910
_has_sbar_wizard = True
1011
except ImportError:
1112
_has_sbar_wizard = False
1213
sbar_wizard_router = None
1314

1415
try:
1516
from .treatment_plan_wizard import router as treatment_plan_router
17+
1618
_has_treatment_plan = True
1719
except ImportError:
1820
_has_treatment_plan = False
1921
treatment_plan_router = None
2022

2123
try:
2224
from .dosage_calculation import router as dosage_calculation_router
25+
2326
_has_dosage_calculation = True
2427
except ImportError:
2528
_has_dosage_calculation = False
2629
dosage_calculation_router = None
2730

2831
try:
2932
from .clinical_assessment import router as clinical_assessment_router
33+
3034
_has_clinical_assessment = True
3135
except ImportError:
3236
_has_clinical_assessment = False
3337
clinical_assessment_router = None
3438

3539
try:
3640
from .patient_education import router as patient_education_router
41+
3742
_has_patient_education = True
3843
except ImportError:
3944
_has_patient_education = False
4045
patient_education_router = None
4146

4247
try:
4348
from .quality_improvement import router as quality_improvement_router
49+
4450
_has_quality_improvement = True
4551
except ImportError:
4652
_has_quality_improvement = False
4753
quality_improvement_router = None
4854

4955
# Export available wizards
5056
__all__ = [
51-
'sbar_wizard_router',
52-
'treatment_plan_router',
53-
'dosage_calculation_router',
54-
'clinical_assessment_router',
55-
'patient_education_router',
56-
'quality_improvement_router'
57+
"sbar_wizard_router",
58+
"treatment_plan_router",
59+
"dosage_calculation_router",
60+
"clinical_assessment_router",
61+
"patient_education_router",
62+
"quality_improvement_router",
5763
]
5864

65+
5966
def get_available_wizards():
6067
"""Get list of available wizard routers."""
6168
available = {}
6269
if _has_sbar_wizard and sbar_wizard_router:
63-
available['sbar'] = sbar_wizard_router
70+
available["sbar"] = sbar_wizard_router
6471
if _has_treatment_plan and treatment_plan_router:
65-
available['treatment_plan'] = treatment_plan_router
72+
available["treatment_plan"] = treatment_plan_router
6673
if _has_dosage_calculation and dosage_calculation_router:
67-
available['dosage_calculation'] = dosage_calculation_router
74+
available["dosage_calculation"] = dosage_calculation_router
6875
if _has_clinical_assessment and clinical_assessment_router:
69-
available['clinical_assessment'] = clinical_assessment_router
76+
available["clinical_assessment"] = clinical_assessment_router
7077
if _has_patient_education and patient_education_router:
71-
available['patient_education'] = patient_education_router
78+
available["patient_education"] = patient_education_router
7279
if _has_quality_improvement and quality_improvement_router:
73-
available['quality_improvement'] = quality_improvement_router
80+
available["quality_improvement"] = quality_improvement_router
7481

75-
return available
82+
return available

wizards/admission_assessment_wizard.py

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
import logging
1010
from datetime import datetime
11-
from typing import Any, Dict, Optional
11+
from typing import Any
1212
from uuid import uuid4
1313

1414
from fastapi import APIRouter, HTTPException, status
15-
1615
from src.services import get_service
1716
from src.utils.api_responses import create_success_response
1817
from src.utils.config import get_settings
@@ -57,7 +56,7 @@ async def translate_text(
5756
except ImportError:
5857
_has_redis = False
5958

60-
_wizard_sessions: Dict[str, Dict[str, Any]] = {}
59+
_wizard_sessions: dict[str, dict[str, Any]] = {}
6160

6261

6362
# Admission assessment wizard steps
@@ -160,19 +159,15 @@ async def translate_text(
160159
"""
161160

162161

163-
async def _store_wizard_session(wizard_id: str, session_data: Dict[str, Any]) -> bool:
162+
async def _store_wizard_session(wizard_id: str, session_data: dict[str, Any]) -> bool:
164163
"""Store wizard session in Redis (preferred) or memory (fallback)"""
165164
try:
166165
if _has_redis:
167166
redis_client = await get_redis_client()
168167
if redis_client:
169168
cache_key = f"wizard:admission_assessment:{wizard_id}"
170-
await redis_client.setex(
171-
cache_key, 7200, str(session_data) # 2 hour TTL
172-
)
173-
logger.info(
174-
f"Stored admission assessment wizard session {wizard_id} in Redis"
175-
)
169+
await redis_client.setex(cache_key, 7200, str(session_data)) # 2 hour TTL
170+
logger.info(f"Stored admission assessment wizard session {wizard_id} in Redis")
176171
return True
177172
except Exception as e:
178173
logger.warning(f"Failed to store session in Redis: {e}, using memory fallback")
@@ -183,7 +178,7 @@ async def _store_wizard_session(wizard_id: str, session_data: Dict[str, Any]) ->
183178
return True
184179

185180

186-
async def _get_wizard_session(wizard_id: str) -> Optional[Dict[str, Any]]:
181+
async def _get_wizard_session(wizard_id: str) -> dict[str, Any] | None:
187182
"""Retrieve wizard session from Redis (preferred) or memory (fallback)"""
188183
try:
189184
if _has_redis:
@@ -202,7 +197,7 @@ async def _get_wizard_session(wizard_id: str) -> Optional[Dict[str, Any]]:
202197
return _wizard_sessions.get(wizard_id)
203198

204199

205-
def _get_step_data(step: int) -> Dict[str, Any]:
200+
def _get_step_data(step: int) -> dict[str, Any]:
206201
"""Get step configuration data"""
207202
if step not in ADMISSION_ASSESSMENT_STEPS:
208203
raise HTTPException(
@@ -220,9 +215,7 @@ def _get_step_data(step: int) -> Dict[str, Any]:
220215
}
221216

222217

223-
def _generate_admission_assessment_report(
224-
collected_data: Dict[str, Any]
225-
) -> Dict[str, Any]:
218+
def _generate_admission_assessment_report(collected_data: dict[str, Any]) -> dict[str, Any]:
226219
"""Generate final admission assessment report from collected data"""
227220

228221
# Generate formatted narrative
@@ -347,7 +340,7 @@ async def start_admission_assessment_wizard():
347340

348341

349342
@router.post("/{wizard_id}/step", summary="Submit admission assessment wizard step")
350-
async def submit_admission_assessment_step(wizard_id: str, step_data: Dict[str, Any]):
343+
async def submit_admission_assessment_step(wizard_id: str, step_data: dict[str, Any]):
351344
"""
352345
Submit data for current step and advance to next step.
353346
@@ -438,10 +431,8 @@ async def submit_admission_assessment_step(wizard_id: str, step_data: Dict[str,
438431
)
439432

440433

441-
@router.post(
442-
"/{wizard_id}/enhance", summary="Enhance admission assessment text with AI"
443-
)
444-
async def enhance_admission_assessment_text(wizard_id: str, text_data: Dict[str, Any]):
434+
@router.post("/{wizard_id}/enhance", summary="Enhance admission assessment text with AI")
435+
async def enhance_admission_assessment_text(wizard_id: str, text_data: dict[str, Any]):
445436
"""
446437
Enhance user-provided text with AI to improve clinical documentation quality.
447438
@@ -501,9 +492,7 @@ async def enhance_admission_assessment_text(wizard_id: str, text_data: Dict[str,
501492
"field": field_name,
502493
}
503494

504-
return create_success_response(
505-
data=response_data, message="Text enhanced successfully"
506-
)
495+
return create_success_response(data=response_data, message="Text enhanced successfully")
507496

508497
except HTTPException:
509498
raise

0 commit comments

Comments
 (0)