Implement JSON and CSV data processing tools (Phase 1)#9
Merged
unseriousAI merged 1 commit intomainfrom Jun 24, 2025
Merged
Conversation
Added comprehensive data module with JSON and CSV processing capabilities: Infrastructure: - New exception classes: DataError, ValidationError, SerializationError - Data-specific type definitions: DataDict, NestedData, ValidationResult - Helper functions for loading tools by category JSON Tools (json_tools.py): - safe_json_serialize/deserialize with error handling - validate_json_string for validation without parsing - compress/decompress_json_data for efficient storage - Full Unicode support and comprehensive error handling CSV Tools (csv_tools.py): - read/write_csv_file with flexible delimiter and header options - csv_to_dict_list and dict_list_to_csv for string conversion - detect_csv_delimiter for auto-detection - validate_csv_structure for file validation - clean_csv_data with configurable cleaning rules Testing: - 71 comprehensive tests covering all functions - 91% coverage for CSV tools, 100% for JSON tools - Edge cases, error conditions, and round-trip validation Integration: - Updated main package to export data module - Added helper functions for selective tool loading - Maintains project's zero runtime dependencies 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
69905f2 to
8eee452
Compare
unseriousAI
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Phase 1 of the data processing module, adding comprehensive JSON and CSV processing capabilities to the basic-open-agent-tools project.
🚀 New Features
Infrastructure Added:
DataError,ValidationError,SerializationError)DataDict,NestedData,ValidationResult)JSON Processing Tools (
json_tools.py- 5 functions):safe_json_serialize()- JSON serialization with comprehensive error handlingsafe_json_deserialize()- Safe JSON parsing with validationvalidate_json_string()- JSON validation without parsing overheadcompress_json_data()/decompress_json_data()- Gzip compression for efficient storageCSV Processing Tools (
csv_tools.py- 7 functions):read_csv_file()/write_csv_file()- File I/O with flexible delimiter and header optionscsv_to_dict_list()/dict_list_to_csv()- String-based CSV conversiondetect_csv_delimiter()- Automatic delimiter detectionvalidate_csv_structure()- Structure and column validationclean_csv_data()- Configurable data cleaning with rules📊 Quality Metrics
🤖 Agent Integration
🎯 Architecture Highlights
📋 Test Coverage
All functions include comprehensive testing:
🔄 Next Steps (Phase 2)
This implementation provides the foundation for:
✅ Checklist
Test plan
python3 -m pytest🤖 Generated with Claude Code