A PyCharm plugin that enables refactoring of function arguments into separate dataclasses.
This plugin introduces an "Extract to Dataclass" refactoring action, allowing you to quickly organize function parameters into structured dataclasses. It's designed to enhance your code's readability and maintainability in Python projects.
- 🚀 Extract selected function parameters into a new dataclass
- 🔍 Type-friendly: preserve existing type annotations, including generic types
- 🔄 Automatically update function calls and parameter usages
- 📦 Handle dataclass imports and type annotations
The plugin requires PyCharm 2023.1 or later.
- Open PyCharm
- Navigate to
Settings/Preferences
→Plugins
- Search for "Extract to Dataclass"
- Click
Install
- Select function that requires refactoring
- Access via right-click
Refactor
menu - Select
Extract arguments to dataclass
- Choose parameters to extract
- Specify dataclass and parameter names (or use defaults)
- Confirm to perform the refactoring
This project is licensed under the MIT License. See the LICENSE file for details.