Skip to content

Hashino/python-refactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Code Refactoring Tool

A Flask web application for refactoring and formatting Python code with syntax highlighting.

Features

  • Dark-themed UI with Monokai color scheme
  • Real-time syntax highlighting
  • Dual text editors (editable input, read-only output)
  • Copy to clipboard functionality
  • Ready for black/autopep8 integration

Local Development

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. Open browser to http://localhost:5000

Implementation

To add code formatting functionality, follow the simple steps in app.py:

STEP 1: Add import at the top (line 2):

import black

STEP 2: Replace line 38 with:

refactored_code = black.format_str(original_code, mode=black.Mode())

Deployment

This app is configured for deployment on Render or other platforms that support Python web applications.

Tech Stack

  • Backend: Flask
  • Frontend: HTML, CSS, JavaScript
  • Syntax Highlighting: Highlight.js
  • Code Formatting: black/autopep8 (to be implemented)

About

simple python refactor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published