Repository navigation
Refactor CLI into modular structure - #524
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #524 +/- ##
==========================================
+ Coverage 95.29% 95.50% +0.21%
==========================================
Files 59 65 +6
Lines 2676 2758 +82
==========================================
+ Hits 2550 2634 +84
+ Misses 126 124 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
CLI Refactoring: Split monolithic cli.py into modular structure
Summary
This PR refactors the large 1481-line
wikipediaapi/cli.pyfile into a clean, maintainable modular structure while preserving 100% backward compatibility.Changes Made
🏗️ New Modular Structure
base.py📁 File Structure
🔧 Technical Improvements
📚 Documentation Updates
✅ Backward Compatibility
Command Modules
📄 page_commands.py
summary,text,sections,section,page🔗 link_commands.py
links,backlinks,langlinks📂 category_commands.py
categories,categorymembers🌍 geo_commands.py
coordinates,images,geosearch🔍 search_commands.py
search,random🛠️ base.py
Benefits
🎯 Maintainability
🚀 Development
📖 Documentation
Quality Assurance
✅ Code Quality
✅ Functionality
✅ Compatibility
Migration Guide
For Users
No changes required - all existing CLI commands work identically.
For Developers
To add new commands:
register_commands()functionFiles Changed
This refactoring transforms an unwieldy monolithic file into a clean, maintainable modular structure while preserving perfect backward compatibility and improving the developer experience.