LeetCode Python Style Converter is a Chrome extension that helps align your Python code style with real-world practices. It transforms LeetCode solutions from class methods to global functions, applies built-in type hints, and converts camelCase to snake_case for better readability and consistency.
- 🔄 Automatically converts camelCase to snake_case in Python functions.
- 📜 Generates standard docstrings for Python functions.
- 🔍 Converts type hints to lowercase for consistency.
- 🤝 Integrates seamlessly with the LeetCode platform.
- 🖥️ Node.js and npm or pnpm installed on your machine.
- 🌐 Google Chrome browser.
-
Clone the repository:
git clone https://github.com/yourusername/leetcode-python-style-converter.git cd leetcode-python-style-converter
-
Install dependencies:
If you are using npm:
npm install
Or, if you are using pnpm:
pnpm install
-
Build the project:
If you are using npm:
npm run build
Or, if you are using pnpm:
pnpm build
-
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/
. - Enable "Developer mode" by toggling the switch in the top right corner.
- Click "Load unpacked" and select the
dist
directory from your project.
- Open Chrome and navigate to
-
Use the extension:
- Navigate to a LeetCode problem page.
- Click on the extension icon in the Chrome toolbar.
- Use the provided options to generate code and docstrings.
The Chrome extension is currently under review. Please check back later for the official release on the Chrome Web Store.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.