fishertools 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. fishertools/__init__.py +82 -0
  2. fishertools/config/__init__.py +24 -0
  3. fishertools/config/manager.py +247 -0
  4. fishertools/config/models.py +96 -0
  5. fishertools/config/parser.py +265 -0
  6. fishertools/decorators.py +93 -0
  7. fishertools/documentation/__init__.py +38 -0
  8. fishertools/documentation/api.py +242 -0
  9. fishertools/documentation/generator.py +502 -0
  10. fishertools/documentation/models.py +126 -0
  11. fishertools/documentation/visual.py +583 -0
  12. fishertools/errors/__init__.py +29 -0
  13. fishertools/errors/exceptions.py +191 -0
  14. fishertools/errors/explainer.py +303 -0
  15. fishertools/errors/formatters.py +386 -0
  16. fishertools/errors/models.py +228 -0
  17. fishertools/errors/patterns.py +119 -0
  18. fishertools/errors/recovery.py +467 -0
  19. fishertools/examples/__init__.py +22 -0
  20. fishertools/examples/models.py +118 -0
  21. fishertools/examples/repository.py +770 -0
  22. fishertools/helpers.py +116 -0
  23. fishertools/integration.py +451 -0
  24. fishertools/learn/__init__.py +18 -0
  25. fishertools/learn/examples.py +550 -0
  26. fishertools/learn/tips.py +281 -0
  27. fishertools/learning/__init__.py +32 -0
  28. fishertools/learning/core.py +349 -0
  29. fishertools/learning/models.py +112 -0
  30. fishertools/learning/progress.py +314 -0
  31. fishertools/learning/session.py +500 -0
  32. fishertools/learning/tutorial.py +626 -0
  33. fishertools/legacy/__init__.py +76 -0
  34. fishertools/legacy/deprecated.py +261 -0
  35. fishertools/legacy/deprecation.py +149 -0
  36. fishertools/safe/__init__.py +16 -0
  37. fishertools/safe/collections.py +242 -0
  38. fishertools/safe/files.py +240 -0
  39. fishertools/safe/strings.py +15 -0
  40. fishertools/utils.py +57 -0
  41. fishertools-0.2.1.dist-info/METADATA +256 -0
  42. fishertools-0.2.1.dist-info/RECORD +81 -0
  43. fishertools-0.2.1.dist-info/WHEEL +5 -0
  44. fishertools-0.2.1.dist-info/licenses/LICENSE +21 -0
  45. fishertools-0.2.1.dist-info/top_level.txt +2 -0
  46. tests/__init__.py +6 -0
  47. tests/conftest.py +25 -0
  48. tests/test_config/__init__.py +3 -0
  49. tests/test_config/test_basic_config.py +57 -0
  50. tests/test_config/test_config_error_handling.py +287 -0
  51. tests/test_config/test_config_properties.py +435 -0
  52. tests/test_documentation/__init__.py +3 -0
  53. tests/test_documentation/test_documentation_properties.py +253 -0
  54. tests/test_documentation/test_visual_documentation_properties.py +444 -0
  55. tests/test_errors/__init__.py +3 -0
  56. tests/test_errors/test_api.py +301 -0
  57. tests/test_errors/test_error_handling.py +354 -0
  58. tests/test_errors/test_explainer.py +173 -0
  59. tests/test_errors/test_formatters.py +338 -0
  60. tests/test_errors/test_models.py +248 -0
  61. tests/test_errors/test_patterns.py +270 -0
  62. tests/test_examples/__init__.py +3 -0
  63. tests/test_examples/test_example_repository_properties.py +204 -0
  64. tests/test_examples/test_specific_examples.py +303 -0
  65. tests/test_integration.py +298 -0
  66. tests/test_integration_enhancements.py +462 -0
  67. tests/test_learn/__init__.py +3 -0
  68. tests/test_learn/test_examples.py +221 -0
  69. tests/test_learn/test_tips.py +285 -0
  70. tests/test_learning/__init__.py +3 -0
  71. tests/test_learning/test_interactive_learning_properties.py +337 -0
  72. tests/test_learning/test_learning_system_properties.py +194 -0
  73. tests/test_learning/test_progress_tracking_properties.py +279 -0
  74. tests/test_legacy/__init__.py +3 -0
  75. tests/test_legacy/test_backward_compatibility.py +236 -0
  76. tests/test_legacy/test_deprecation_warnings.py +208 -0
  77. tests/test_safe/__init__.py +3 -0
  78. tests/test_safe/test_collections_properties.py +189 -0
  79. tests/test_safe/test_files.py +104 -0
  80. tests/test_structure.py +58 -0
  81. tests/test_structure_enhancements.py +115 -0
@@ -0,0 +1,118 @@
1
+ """
2
+ Data models for the Example Repository module.
3
+ """
4
+
5
+ from dataclasses import dataclass
6
+ from typing import List, Optional, Dict, Any
7
+ from enum import Enum
8
+
9
+
10
+ class ExampleCategory(Enum):
11
+ """Categories of code examples."""
12
+ COLLECTIONS = "collections"
13
+ USER_INPUT = "user_input"
14
+ FILE_OPERATIONS = "file_operations"
15
+ ERROR_HANDLING = "error_handling"
16
+ SIMPLE_PROJECTS = "simple_projects"
17
+ BASIC_SYNTAX = "basic_syntax"
18
+
19
+
20
+ class ProjectType(Enum):
21
+ """Types of simple projects."""
22
+ CALCULATOR = "calculator"
23
+ TODO_LIST = "todo_list"
24
+ GUESSING_GAME = "guessing_game"
25
+ TEXT_ANALYZER = "text_analyzer"
26
+ FILE_ORGANIZER = "file_organizer"
27
+
28
+
29
+ @dataclass
30
+ class CodeExample:
31
+ """A code example with explanation."""
32
+ id: str
33
+ title: str
34
+ description: str
35
+ code: str
36
+ explanation: str
37
+ difficulty: str
38
+ topics: List[str]
39
+ prerequisites: List[str]
40
+ category: ExampleCategory
41
+ expected_output: Optional[str] = None
42
+ common_mistakes: List[str] = None
43
+
44
+ def __post_init__(self):
45
+ if self.common_mistakes is None:
46
+ self.common_mistakes = []
47
+
48
+
49
+ @dataclass
50
+ class LineExplanation:
51
+ """Explanation for a single line of code."""
52
+ line_number: int
53
+ code: str
54
+ explanation: str
55
+ concepts: List[str] = None
56
+
57
+ def __post_init__(self):
58
+ if self.concepts is None:
59
+ self.concepts = []
60
+
61
+
62
+ @dataclass
63
+ class LineByLineExplanation:
64
+ """Complete line-by-line explanation of code."""
65
+ example_id: str
66
+ title: str
67
+ lines: List[LineExplanation]
68
+ summary: str
69
+ key_concepts: List[str] = None
70
+
71
+ def __post_init__(self):
72
+ if self.key_concepts is None:
73
+ self.key_concepts = []
74
+
75
+
76
+ @dataclass
77
+ class ProjectStep:
78
+ """A step in a project template."""
79
+ step_number: int
80
+ title: str
81
+ description: str
82
+ code_snippet: Optional[str] = None
83
+ explanation: Optional[str] = None
84
+ hints: List[str] = None
85
+
86
+ def __post_init__(self):
87
+ if self.hints is None:
88
+ self.hints = []
89
+
90
+
91
+ @dataclass
92
+ class ProjectTemplate:
93
+ """Template for a simple project."""
94
+ id: str
95
+ title: str
96
+ description: str
97
+ project_type: ProjectType
98
+ difficulty: str
99
+ estimated_time: int # in minutes
100
+ steps: List[ProjectStep]
101
+ final_code: str
102
+ extensions: List[str] = None # suggested improvements
103
+
104
+ def __post_init__(self):
105
+ if self.extensions is None:
106
+ self.extensions = []
107
+
108
+
109
+ @dataclass
110
+ class Scenario:
111
+ """A learning scenario combining multiple examples."""
112
+ id: str
113
+ title: str
114
+ description: str
115
+ examples: List[CodeExample]
116
+ learning_objectives: List[str]
117
+ difficulty: str
118
+ estimated_time: int # in minutes