fishertools 0.3.1__tar.gz → 0.4.4.2__tar.gz
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.
- fishertools-0.4.4.2/PKG-INFO +432 -0
- fishertools-0.4.4.2/README.md +389 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/__init__.py +11 -2
- fishertools-0.4.4.2/fishertools/_version.py +3 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/config/models.py +3 -3
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/config/parser.py +89 -43
- fishertools-0.4.4.2/fishertools/debug/__init__.py +9 -0
- fishertools-0.4.4.2/fishertools/debug/debugger.py +90 -0
- fishertools-0.4.4.2/fishertools/debug/tracer.py +97 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/decorators.py +23 -18
- fishertools-0.4.4.2/fishertools/documentation/__init__.py +76 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/documentation/api.py +65 -54
- fishertools-0.4.4.2/fishertools/documentation/code_validator.py +261 -0
- fishertools-0.4.4.2/fishertools/documentation/examples_manager.py +165 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/documentation/generator.py +35 -10
- fishertools-0.4.4.2/fishertools/documentation/managers.py +273 -0
- fishertools-0.4.4.2/fishertools/documentation/models.py +244 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/documentation/visual.py +245 -4
- fishertools-0.4.4.2/fishertools/errors/explainer.py +247 -0
- fishertools-0.4.4.2/fishertools/errors/explanation_builder.py +181 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/formatters.py +3 -5
- fishertools-0.4.4.2/fishertools/errors/pattern_loader.py +133 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/patterns.py +21 -0
- fishertools-0.4.4.2/fishertools/examples/cli_example.py +306 -0
- fishertools-0.4.4.2/fishertools/examples/debug_examples.py +84 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/logger_example.py +11 -6
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/repository.py +287 -94
- fishertools-0.4.4.2/fishertools/examples/validation_examples.py +102 -0
- fishertools-0.4.4.2/fishertools/examples/visualization_examples.py +56 -0
- fishertools-0.4.4.2/fishertools/helpers.py +202 -0
- fishertools-0.4.4.2/fishertools/input_utils.py +288 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learn/__init__.py +17 -1
- fishertools-0.4.4.2/fishertools/learn/knowledge_engine.py +321 -0
- fishertools-0.4.4.2/fishertools/learn/repl/__init__.py +19 -0
- fishertools-0.4.4.2/fishertools/learn/repl/cli.py +31 -0
- fishertools-0.4.4.2/fishertools/learn/repl/code_sandbox.py +229 -0
- fishertools-0.4.4.2/fishertools/learn/repl/command_handler.py +548 -0
- fishertools-0.4.4.2/fishertools/learn/repl/command_parser.py +168 -0
- fishertools-0.4.4.2/fishertools/learn/repl/engine.py +562 -0
- fishertools-0.4.4.2/fishertools/learn/repl/models.py +121 -0
- fishertools-0.4.4.2/fishertools/learn/repl/session_manager.py +284 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_code_sandbox.py +261 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_code_sandbox_pbt.py +148 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_command_handler.py +224 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_command_handler_pbt.py +189 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_command_parser.py +160 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_command_parser_pbt.py +100 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_engine.py +194 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_session_manager.py +310 -0
- fishertools-0.4.4.2/fishertools/learn/repl/test_session_manager_pbt.py +182 -0
- fishertools-0.4.4.2/fishertools/learn/test_knowledge_engine.py +241 -0
- fishertools-0.4.4.2/fishertools/learn/test_knowledge_engine_pbt.py +180 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/patterns/cli.py +76 -15
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/readme_transformer.py +4 -2
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/safe/__init__.py +9 -4
- fishertools-0.4.4.2/fishertools/safe/collections.py +250 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/safe/files.py +295 -18
- fishertools-0.4.4.2/fishertools/safe/strings.py +213 -0
- fishertools-0.4.4.2/fishertools/validation/__init__.py +24 -0
- fishertools-0.4.4.2/fishertools/validation/exceptions.py +7 -0
- fishertools-0.4.4.2/fishertools/validation/type_checker.py +78 -0
- fishertools-0.4.4.2/fishertools/validation/validators.py +129 -0
- fishertools-0.4.4.2/fishertools/visualization/__init__.py +8 -0
- fishertools-0.4.4.2/fishertools/visualization/formatters.py +109 -0
- fishertools-0.4.4.2/fishertools/visualization/visualizer.py +90 -0
- fishertools-0.4.4.2/fishertools.egg-info/PKG-INFO +432 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools.egg-info/SOURCES.txt +54 -1
- fishertools-0.4.4.2/fishertools.egg-info/requires.txt +15 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/pyproject.toml +10 -8
- {fishertools-0.3.1 → fishertools-0.4.4.2}/setup.py +7 -1
- fishertools-0.4.4.2/tests/test_debug/__init__.py +1 -0
- fishertools-0.4.4.2/tests/test_debug/test_debugger.py +99 -0
- fishertools-0.4.4.2/tests/test_debug/test_tracer.py +73 -0
- fishertools-0.4.4.2/tests/test_documentation/test_extended_documentation_managers.py +86 -0
- fishertools-0.4.4.2/tests/test_documentation/test_extended_documentation_models.py +260 -0
- fishertools-0.4.4.2/tests/test_documentation_properties.py +324 -0
- fishertools-0.4.4.2/tests/test_documentation_structure.py +349 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_error_handling.py +9 -10
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_explainer.py +3 -2
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_patterns.py +3 -2
- fishertools-0.4.4.2/tests/test_examples_manager_properties.py +507 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_input_utils/test_input_utils.py +2 -2
- fishertools-0.4.4.2/tests/test_integration_phase1.py +191 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_legacy/test_deprecation_warnings.py +1 -1
- fishertools-0.4.4.2/tests/test_safe/test_files.py +829 -0
- fishertools-0.4.4.2/tests/test_validation/__init__.py +1 -0
- fishertools-0.4.4.2/tests/test_validation/test_type_checker.py +109 -0
- fishertools-0.4.4.2/tests/test_validation/test_validators.py +137 -0
- fishertools-0.4.4.2/tests/test_visualization/__init__.py +1 -0
- fishertools-0.4.4.2/tests/test_visualization/test_visualizer.py +133 -0
- fishertools-0.3.1/PKG-INFO +0 -510
- fishertools-0.3.1/README.md +0 -471
- fishertools-0.3.1/fishertools/documentation/__init__.py +0 -38
- fishertools-0.3.1/fishertools/documentation/models.py +0 -126
- fishertools-0.3.1/fishertools/errors/explainer.py +0 -389
- fishertools-0.3.1/fishertools/examples/cli_example.py +0 -156
- fishertools-0.3.1/fishertools/helpers.py +0 -116
- fishertools-0.3.1/fishertools/input_utils.py +0 -185
- fishertools-0.3.1/fishertools/safe/collections.py +0 -242
- fishertools-0.3.1/fishertools/safe/strings.py +0 -15
- fishertools-0.3.1/fishertools.egg-info/PKG-INFO +0 -510
- fishertools-0.3.1/fishertools.egg-info/requires.txt +0 -9
- fishertools-0.3.1/tests/test_safe/test_files.py +0 -222
- {fishertools-0.3.1 → fishertools-0.4.4.2}/LICENSE +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/config/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/config/manager.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/exception_types.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/exceptions.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/models.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/errors/recovery.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/learn_example.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/menu_example.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/models.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/examples/storage_example.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/integration.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learn/examples.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learn/tips.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/core.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/models.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/progress.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/session.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/learning/tutorial.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/legacy/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/legacy/deprecated.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/legacy/deprecation.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/patterns/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/patterns/logger.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/patterns/menu.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/patterns/storage.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/transform_readme.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools/utils.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools.egg-info/dependency_links.txt +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/fishertools.egg-info/top_level.txt +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/setup.cfg +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/conftest.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_config/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_config/test_basic_config.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_config/test_config_error_handling.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_config/test_config_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_documentation/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_documentation/test_documentation_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_documentation/test_visual_documentation_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_api.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_exception_types.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_exception_types_pbt.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_formatters.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_errors/test_models.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_examples/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_examples/test_example_repository_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_examples/test_specific_examples.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_input_utils/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_integration.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_integration_enhancements.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learn/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learn/test_examples.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learn/test_explain_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learn/test_tips.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learning/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learning/test_interactive_learning_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learning/test_learning_system_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_learning/test_progress_tracking_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_legacy/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_legacy/test_backward_compatibility.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_patterns_cli.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_patterns_docstrings.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_patterns_logger.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_patterns_menu.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_patterns_storage.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_readme_transformer/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_readme_transformer/test_readme_infrastructure.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_readme_transformer/test_transform_readme_integration.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_safe/__init__.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_safe/test_collections_properties.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_structure.py +0 -0
- {fishertools-0.3.1 → fishertools-0.4.4.2}/tests/test_structure_enhancements.py +0 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fishertools
|
|
3
|
+
Version: 0.4.4.2
|
|
4
|
+
Summary: Fishertools - инструменты, которые делают Python удобнее и безопаснее для новичков
|
|
5
|
+
Home-page: https://github.com/f1sherFM/My_1st_library_python
|
|
6
|
+
Author: f1sherFM
|
|
7
|
+
Author-email: f1sherFM <kirillka229top@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/f1sherFM/My_1st_library_python
|
|
10
|
+
Project-URL: Repository, https://github.com/f1sherFM/My_1st_library_python
|
|
11
|
+
Project-URL: Issues, https://github.com/f1sherFM/My_1st_library_python/issues
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: requests<3.0.0,>=2.31.0
|
|
28
|
+
Requires-Dist: click<9.0.0,>=8.3.0
|
|
29
|
+
Provides-Extra: config
|
|
30
|
+
Requires-Dist: pyyaml<7.0.0,>=6.0.0; extra == "config"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest<10.0.0,>=9.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: hypothesis<7.0.0,>=6.150.0; extra == "dev"
|
|
34
|
+
Requires-Dist: black<25.0.0,>=24.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff<1.0.0,>=0.1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: mypy<2.0.0,>=1.8.0; extra == "dev"
|
|
37
|
+
Provides-Extra: all
|
|
38
|
+
Requires-Dist: fishertools[config]; extra == "all"
|
|
39
|
+
Dynamic: author
|
|
40
|
+
Dynamic: home-page
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: requires-python
|
|
43
|
+
|
|
44
|
+
# Fishertools
|
|
45
|
+
|
|
46
|
+
**Tools that make Python easier and safer for beginners**
|
|
47
|
+
|
|
48
|
+
Fishertools is a Python library designed specifically for beginner developers. It provides clear error explanations, safe utilities, learning tools, and powerful debugging features to help you master Python.
|
|
49
|
+
|
|
50
|
+
## 🚀 What's New in v0.4.4?
|
|
51
|
+
|
|
52
|
+
**Professional Code Quality Improvements** - Major refactoring based on comprehensive Code Review:
|
|
53
|
+
|
|
54
|
+
- **🔒 Enhanced Type Safety** - Full type hints with `TypeVar` and `ParamSpec` in decorators
|
|
55
|
+
- **✅ Better Input Validation** - `ask_int()` and `ask_float()` now validate parameters and limit attempts
|
|
56
|
+
- **⚡ Performance Optimizations** - Pre-compiled regex patterns for faster string operations
|
|
57
|
+
- **📦 Improved Dependency Management** - Fixed version pinning and optional dependencies
|
|
58
|
+
- **🛡️ Security Enhancements** - Protection against infinite loops and DoS attacks
|
|
59
|
+
- **📚 Centralized Versioning** - Single source of truth in `_version.py`
|
|
60
|
+
|
|
61
|
+
[See full changelog →](CHANGELOG.md) | [v0.4.3 Features →](CHANGELOG.md#0433---2026-02-01)
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install fishertools
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Quick Reference
|
|
70
|
+
|
|
71
|
+
| Task | Function | Module |
|
|
72
|
+
|------|----------|--------|
|
|
73
|
+
| Explain an error | `explain_error(e)` | errors |
|
|
74
|
+
| Get element safely | `safe_get(list, index, default)` | safe |
|
|
75
|
+
| Divide safely | `safe_divide(a, b, default)` | safe |
|
|
76
|
+
| **Strip string safely** | **`safe_strip(text, default)`** | **safe** |
|
|
77
|
+
| **Split string safely** | **`safe_split(text, sep, default)`** | **safe** |
|
|
78
|
+
| **Join safely** | **`safe_join(sep, items)`** | **safe** |
|
|
79
|
+
| Read file safely | `safe_read_file(path)` | safe |
|
|
80
|
+
| Learn Python concepts | `explain(topic)` | learn |
|
|
81
|
+
| Visualize data | `visualize(data)` | visualization |
|
|
82
|
+
| Validate types | `@validate_types` | validation |
|
|
83
|
+
| Debug step-by-step | `@debug_step_by_step` | debug |
|
|
84
|
+
|
|
85
|
+
## Core Features
|
|
86
|
+
|
|
87
|
+
### 🔴 Error Explanation
|
|
88
|
+
Get clear explanations of Python errors with suggestions for fixing them.
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from fishertools import explain_error
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
result = 10 / 0
|
|
95
|
+
except Exception as e:
|
|
96
|
+
explain_error(e)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 🛡️ Safe Utilities
|
|
100
|
+
Functions like `safe_get()`, `safe_divide()`, `safe_read_file()` that prevent typical beginner errors.
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from fishertools import safe_get, safe_divide
|
|
104
|
+
from fishertools.safe import safe_strip, safe_split, safe_join
|
|
105
|
+
|
|
106
|
+
# Safe dictionary access
|
|
107
|
+
value = safe_get(my_dict, "key", default="not found")
|
|
108
|
+
|
|
109
|
+
# Safe division (mathematically correct!)
|
|
110
|
+
result = safe_divide(10, 0) # Returns None (undefined, not 0!)
|
|
111
|
+
result = safe_divide(10, 0, default=0) # Explicitly set to 0
|
|
112
|
+
|
|
113
|
+
# Safe string operations (NEW in v0.4.3!)
|
|
114
|
+
text = safe_strip(None) # Returns '' instead of error
|
|
115
|
+
items = safe_split("a,b,c", ",") # Returns ['a', 'b', 'c']
|
|
116
|
+
joined = safe_join(", ", ["a", None, "b"]) # Returns 'a, b' (skips None)
|
|
117
|
+
formatted = safe_format("Hello, {name}!", name="World") # Safe formatting
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 📚 Learning Tools
|
|
121
|
+
Structured explanations of Python concepts with examples and best practices.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from fishertools.learn import generate_example, show_best_practice
|
|
125
|
+
|
|
126
|
+
example = generate_example("list comprehension")
|
|
127
|
+
best_practice = show_best_practice("error handling")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 🎯 Ready-made Patterns
|
|
131
|
+
Templates for common tasks like menus, file storage, logging, and CLI applications.
|
|
132
|
+
|
|
133
|
+
### 📊 Data Visualization (v0.4.1+)
|
|
134
|
+
Visualize data structures in a human-readable format with proper formatting and indentation.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from fishertools.visualization import visualize
|
|
138
|
+
|
|
139
|
+
# Visualize lists
|
|
140
|
+
numbers = [10, 20, 30, 40, 50]
|
|
141
|
+
visualize(numbers)
|
|
142
|
+
# Output:
|
|
143
|
+
# 📊 Visualization:
|
|
144
|
+
# [0] → 10
|
|
145
|
+
# [1] → 20
|
|
146
|
+
# [2] → 30
|
|
147
|
+
# [3] → 40
|
|
148
|
+
# [4] → 50
|
|
149
|
+
|
|
150
|
+
# Visualize dictionaries
|
|
151
|
+
user = {"name": "Alice", "age": 25, "email": "alice@example.com"}
|
|
152
|
+
visualize(user, title="User Data")
|
|
153
|
+
# Output:
|
|
154
|
+
# 📊 User Data:
|
|
155
|
+
# {
|
|
156
|
+
# 'name' → 'Alice'
|
|
157
|
+
# 'age' → 25
|
|
158
|
+
# 'email' → 'alice@example.com'
|
|
159
|
+
# }
|
|
160
|
+
|
|
161
|
+
# Visualize nested structures
|
|
162
|
+
data = {"users": [{"name": "Alice"}, {"name": "Bob"}]}
|
|
163
|
+
visualize(data, max_depth=3)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Features:**
|
|
167
|
+
- List visualization with indices
|
|
168
|
+
- Dictionary visualization with keys
|
|
169
|
+
- Nested structure support with depth control
|
|
170
|
+
- Item limiting for large datasets
|
|
171
|
+
- Clean formatting with arrows and indentation
|
|
172
|
+
|
|
173
|
+
### ✅ Type Validation (v0.4.1+)
|
|
174
|
+
Validate function arguments and data structures with clear error messages.
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
from fishertools.validation import validate_types, validate_email, ValidationError
|
|
178
|
+
|
|
179
|
+
# Type checking via decorator
|
|
180
|
+
@validate_types
|
|
181
|
+
def create_user(name: str, age: int, email: str) -> dict:
|
|
182
|
+
return {"name": name, "age": age, "email": email}
|
|
183
|
+
|
|
184
|
+
user = create_user("Alice", 25, "alice@example.com") # ✅ Works
|
|
185
|
+
# create_user("Bob", "thirty", "bob@example.com") # ❌ ValidationError
|
|
186
|
+
|
|
187
|
+
# Email validation
|
|
188
|
+
try:
|
|
189
|
+
validate_email("user@example.com") # ✅ Valid
|
|
190
|
+
except ValidationError as e:
|
|
191
|
+
print(f"Error: {e}")
|
|
192
|
+
|
|
193
|
+
# Number validation
|
|
194
|
+
from fishertools.validation import validate_number
|
|
195
|
+
validate_number(42, min_val=0, max_val=100) # ✅ Valid
|
|
196
|
+
|
|
197
|
+
# Structure validation
|
|
198
|
+
from fishertools.validation import validate_structure
|
|
199
|
+
schema = {"name": str, "age": int}
|
|
200
|
+
data = {"name": "Alice", "age": 25}
|
|
201
|
+
validate_structure(data, schema) # ✅ Valid
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Features:**
|
|
205
|
+
- Type checking via `@validate_types` decorator
|
|
206
|
+
- Email and URL validation
|
|
207
|
+
- Number range validation
|
|
208
|
+
- String validation with length and pattern checks
|
|
209
|
+
- Data structure validation against schemas
|
|
210
|
+
- Clear, actionable error messages
|
|
211
|
+
|
|
212
|
+
### 🔍 Step-by-Step Debugging (v0.4.1+)
|
|
213
|
+
Debug functions with step-by-step execution and function call tracing.
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
from fishertools.debug import debug_step_by_step, trace, set_breakpoint
|
|
217
|
+
|
|
218
|
+
# Step-by-step debugging
|
|
219
|
+
@debug_step_by_step
|
|
220
|
+
def calculate_average(numbers):
|
|
221
|
+
total = sum(numbers)
|
|
222
|
+
average = total / len(numbers)
|
|
223
|
+
return average
|
|
224
|
+
|
|
225
|
+
result = calculate_average([1, 2, 3, 4, 5])
|
|
226
|
+
# Output:
|
|
227
|
+
# 🔍 Debugging: calculate_average
|
|
228
|
+
# Step 1: numbers = [1, 2, 3, 4, 5]
|
|
229
|
+
# Step 2: return 3.0
|
|
230
|
+
# ✅ Result: 3.0
|
|
231
|
+
|
|
232
|
+
# Function call tracing
|
|
233
|
+
@trace
|
|
234
|
+
def fibonacci(n):
|
|
235
|
+
if n <= 1:
|
|
236
|
+
return n
|
|
237
|
+
return fibonacci(n-1) + fibonacci(n-2)
|
|
238
|
+
|
|
239
|
+
result = fibonacci(4)
|
|
240
|
+
# Shows all function calls with indentation
|
|
241
|
+
|
|
242
|
+
# Breakpoints
|
|
243
|
+
x = 10
|
|
244
|
+
set_breakpoint("Check x value")
|
|
245
|
+
y = x * 2
|
|
246
|
+
# 🔴 Breakpoint: Check x value
|
|
247
|
+
# at script.py:2
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Features:**
|
|
251
|
+
- Step-by-step execution with variable values
|
|
252
|
+
- Function call tracing with indentation
|
|
253
|
+
- Breakpoints for pausing execution
|
|
254
|
+
- Exception handling with detailed information
|
|
255
|
+
- Recursive function support
|
|
256
|
+
|
|
257
|
+
## 📖 Documentation
|
|
258
|
+
|
|
259
|
+
Complete documentation is available in the `docs/` folder:
|
|
260
|
+
|
|
261
|
+
- **[Getting Started](docs/getting-started.md)** - Quick start guide with installation and first example
|
|
262
|
+
- **[Features](docs/features.md)** - Overview of all features and capabilities
|
|
263
|
+
- **[Installation](docs/installation.md)** - Detailed installation instructions for different operating systems
|
|
264
|
+
- **[API Reference](docs/api-reference.md)** - Complete API documentation with all functions and classes
|
|
265
|
+
- **[v0.4.1 Modules](docs/modules-v0.4.1.md)** - Detailed documentation for new Visualization, Validation, and Debug modules
|
|
266
|
+
- **[Examples](docs/examples.md)** - Practical examples from basic to advanced usage
|
|
267
|
+
- **[Limitations](docs/limitations.md)** - Known limitations and performance considerations
|
|
268
|
+
- **[Contributing](docs/contributing.md)** - How to contribute to the project
|
|
269
|
+
|
|
270
|
+
## 🎯 Who Should Use Fishertools?
|
|
271
|
+
|
|
272
|
+
- **Beginners** - Just starting to learn Python
|
|
273
|
+
- **Students** - Learning Python in a classroom
|
|
274
|
+
- **Educators** - Teaching Python to others
|
|
275
|
+
- **Professionals** - Want safer, more readable code
|
|
276
|
+
|
|
277
|
+
## 🔄 Integration Examples
|
|
278
|
+
|
|
279
|
+
### Visualization + Validation
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
from fishertools.validation import validate_types
|
|
283
|
+
from fishertools.visualization import visualize
|
|
284
|
+
|
|
285
|
+
@validate_types
|
|
286
|
+
def process_users(users: list) -> dict:
|
|
287
|
+
visualize(users, title="Input Users")
|
|
288
|
+
result = {"count": len(users), "users": users}
|
|
289
|
+
visualize(result, title="Output")
|
|
290
|
+
return result
|
|
291
|
+
|
|
292
|
+
users = [{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]
|
|
293
|
+
result = process_users(users)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Validation + Debug
|
|
297
|
+
|
|
298
|
+
```python
|
|
299
|
+
from fishertools.validation import validate_types
|
|
300
|
+
from fishertools.debug import debug_step_by_step
|
|
301
|
+
|
|
302
|
+
@validate_types
|
|
303
|
+
@debug_step_by_step
|
|
304
|
+
def calculate_total(prices: list) -> float:
|
|
305
|
+
total = sum(prices)
|
|
306
|
+
tax = total * 0.1
|
|
307
|
+
final = total + tax
|
|
308
|
+
return final
|
|
309
|
+
|
|
310
|
+
result = calculate_total([10.0, 20.0, 30.0])
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### All Three Modules
|
|
314
|
+
|
|
315
|
+
```python
|
|
316
|
+
from fishertools.validation import validate_types, validate_structure
|
|
317
|
+
from fishertools.visualization import visualize
|
|
318
|
+
from fishertools.debug import debug_step_by_step
|
|
319
|
+
|
|
320
|
+
@validate_types
|
|
321
|
+
@debug_step_by_step
|
|
322
|
+
def analyze_data(data: dict) -> dict:
|
|
323
|
+
schema = {"name": str, "values": list}
|
|
324
|
+
validate_structure(data, schema)
|
|
325
|
+
|
|
326
|
+
visualize(data, title="Input")
|
|
327
|
+
|
|
328
|
+
result = {
|
|
329
|
+
"name": data["name"],
|
|
330
|
+
"count": len(data["values"]),
|
|
331
|
+
"sum": sum(data["values"])
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
visualize(result, title="Output")
|
|
335
|
+
return result
|
|
336
|
+
|
|
337
|
+
data = {"name": "Test", "values": [1, 2, 3, 4, 5]}
|
|
338
|
+
result = analyze_data(data)
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## 📊 Version History
|
|
342
|
+
|
|
343
|
+
### v0.4.4 (Current)
|
|
344
|
+
- � **Enhanced Type Safety** - Full type hints with TypeVar and ParamSpec
|
|
345
|
+
- ✅ **Better Input Validation** - Parameter validation and attempt limiting
|
|
346
|
+
- ⚡ **Performance Optimizations** - Pre-compiled regex patterns
|
|
347
|
+
- � **Improved Dependencies** - Fixed version pinning and optional extras
|
|
348
|
+
- �️ **Security Enhancements** - DoS protection and better error handling
|
|
349
|
+
- 📚 **Centralized Versioning** - Single source of truth in _version.py
|
|
350
|
+
|
|
351
|
+
### v0.4.3
|
|
352
|
+
- � **Code Quality Refactoring** - Fixed "spaghetti code"
|
|
353
|
+
- ✨ **Implemented safe_string_operations** - 6 new string utilities
|
|
354
|
+
- 🔢 **Fixed safe_divide mathematics** - Now returns None for 10/0 (correct!)
|
|
355
|
+
- 🐍 **Simplified error handling** - Pythonic EAFP approach
|
|
356
|
+
- 📦 **Refactored collection functions** - Cleaner, simpler code
|
|
357
|
+
- ✅ 82/82 tests passing
|
|
358
|
+
- 📉 -150 lines of unnecessary code
|
|
359
|
+
- 📈 +6 new useful functions
|
|
360
|
+
|
|
361
|
+
### v0.4.1
|
|
362
|
+
- ✨ **NEW:** Visualization module for data structure visualization
|
|
363
|
+
- ✨ **NEW:** Validation module for type checking and data validation
|
|
364
|
+
- ✨ **NEW:** Debug module for step-by-step execution and tracing
|
|
365
|
+
- 📈 65+ new tests with 90%+ code coverage
|
|
366
|
+
- 📚 Complete documentation for all new modules
|
|
367
|
+
|
|
368
|
+
### v0.4.0
|
|
369
|
+
- 🎓 Knowledge Engine Interactive REPL
|
|
370
|
+
- 📚 Extended documentation system
|
|
371
|
+
|
|
372
|
+
### v0.3.x
|
|
373
|
+
- 🛡️ Safe utilities module
|
|
374
|
+
- 📚 Learning tools
|
|
375
|
+
- 🔴 Error explanation system
|
|
376
|
+
|
|
377
|
+
## 🧪 Testing
|
|
378
|
+
|
|
379
|
+
All modules are thoroughly tested:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
# Run all tests
|
|
383
|
+
pytest tests/ -v
|
|
384
|
+
|
|
385
|
+
# Run specific module tests
|
|
386
|
+
pytest tests/test_visualization/ -v
|
|
387
|
+
pytest tests/test_validation/ -v
|
|
388
|
+
pytest tests/test_debug/ -v
|
|
389
|
+
|
|
390
|
+
# Run with coverage
|
|
391
|
+
pytest tests/ --cov=fishertools --cov-report=html
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Test Coverage:** 90%+ across all modules
|
|
395
|
+
|
|
396
|
+
## 📦 Installation
|
|
397
|
+
|
|
398
|
+
### From PyPI (Recommended)
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
pip install fishertools
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### From Source
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
git clone https://github.com/f1sherFM/My_1st_library_python.git
|
|
408
|
+
cd My_1st_library_python
|
|
409
|
+
pip install -e .
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## 🤝 Contributing
|
|
413
|
+
|
|
414
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on:
|
|
415
|
+
- How to report bugs
|
|
416
|
+
- How to suggest features
|
|
417
|
+
- How to submit pull requests
|
|
418
|
+
- Code style guidelines
|
|
419
|
+
|
|
420
|
+
## 📄 License
|
|
421
|
+
|
|
422
|
+
MIT License - see [LICENSE](LICENSE) file for details
|
|
423
|
+
|
|
424
|
+
## 🙏 Acknowledgments
|
|
425
|
+
|
|
426
|
+
Fishertools is built with ❤️ for the Python community, especially for beginners learning to code.
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
**Fishertools** - Making Python easier, safer, and more fun for everyone! 🐍✨
|
|
431
|
+
|
|
432
|
+
**Current Version:** 0.4.4 | **Last Updated:** February 1, 2026
|