🚀 Project Status: In active development. All components subject to change. Contributions and feedback welcome.
🎯 Intent: Enhance and automate error handling, recovery, propagation management, and logging in Python projects by integrating static and dynamic analysis with tools like DynEL.
🛠️ Goals:
- Automate error handling and logging configuration
- Improve error propagation and control flow
- Integrate with CI/CD pipelines and IDEs
- Optimize performance for scalability
- Description
- Installation
- Usage
- Features
- Configuration
- Testing
- Development Setup
- Proposed Implementation
- Security Best Practices
- Contribution
- License
- Contact
- Troubleshooting
- Acknowledgments
- References
PeSPr (Perihelion Signal Processor) is a sister project to DynEL (Dynamic Error Logging), designed to automate the generation of DynEL configuration files. It leverages static analysis tools (Mypy, Astroid) and dynamic analysis (pytest) to extract exception types, error-prone code segments, and runtime behaviors, creating a robust error handling and logging framework for Python projects.
Install PeSPr via pip:
pip install pesprFor development, use UV to manage dependencies. See Development Setup.
Analyze a project to generate a dynel_config.yaml:
pespr analyze /path/to/your/projectGenerate or update configurations with additional options:
pespr generate-config /path/to/your/project --output dynel_config.yaml
pespr update-config /path/to/your/project- Static Analysis: Extracts exception data using Mypy and Astroid
- Dynamic Analysis: Integrates runtime data with pytest
- Error Catalog: Comprehensive registry of error types
- Logging: Advanced formatting and outputs via Loguru
- CI/CD Integration: Automates config generation in pipelines
- Extensibility: Supports custom error handlers and plugins
Configure PeSPr with a pespr_config.yaml file:
analysis:
ignore_dirs: ['tests', 'docs']
max_depth: 5
logging:
level: INFO
output: ['file', 'console']
ci_integration:
enabled: true
report_format: jsonSee the Configuration Guide for details.
Run tests with pytest:
pytestInstall development dependencies first (see Development Setup).
- Clone the repository:
git clone https://github.com/tzervas/pespr.git
- Navigate to the directory:
cd pespr - Install dependencies with UV:
uv sync
- Configure via
pespr_config.yamlor environment variables. - Run the application:
python main.py
Basic static analysis and config generation:
from pespr import analyze_project
config = analyze_project('/path/to/project')
config.save('dynel_config.yaml')Configurable integration with DynEL:
from pespr import PeSPrConfig, generate_config
config = PeSPrConfig()
config.load('pespr_config.yaml')
generate_config('/path/to/project', config)🔒
- Validate all inputs to prevent injection or errors
- Use structured error handling to avoid crashes
- Secure logging to prevent sensitive data leaks
- Keep dependencies updated to address vulnerabilities
See the Developer Guide and CONTRIBUTING.md for contribution details.
MIT License. See LICENSE for more information.
- Author: Tyler Zervas
- GitHub: tzervas
- X: @vec_wt_tech
Check the issue tracker for common problems or contact the author.
Thanks to the teams behind Mypy, Astroid, Loguru, and pytest.