Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.0.11 instead.

refactoringidioms (Ridiom)

Refactor non-idiomatic Python code with Pythonic idioms

Package Install:

For command line use, the refactoringidiom package is installed with

python3 -m pip install RefactoringIdioms

Running:

1). Default command is to save all refactored files for all Python Idioms in the current directory in ./RefactoringIdiomsOutputdir/. And it can get <non-idiomatic code, idiomatic code> code pairs for all Python files in the current directory for all Python idioms, and save these code pairs in result.json in the current directory:

 RIdiom

2). Options:

--filepath "your filepath" (e.g., main.py) is to refactor "your filepath" file. The default path is the current directory.

--idiom "IdiomName" (e.g., List Comprehension) is to refactor for the specified "IdiomName". Options are List Comprehension, Set Comprehension, Dict Comprehension, Chain Comparison, Truth Value Test, Assign Multiple Targets, For Multiple Targets, For Else, Star in Call, All. The default idiom is "All" that means all idioms.

--outputdir "your output folder" (e.g.,RefactoringIdiomsOutputdir/ ) is to save all refactored files in "your output folder". The default directory is "./RefactoringIdiomsOutputdir".

--output_codepair "your output path" (e.g.,result.json ) is to save all code pairs in "your output folder". The default path is "result.json".

--flag_merge_allcodepair (e.g., 1 ) means whether to store a separate file for each code pair. The values are 0 and 1. The 1 means refactor a file with all code pairs. The 0 means refactor a file with each code pair individually. The default value is 1.

For example, if you want to refactor code for a Python idiom in the given directory and save the refactored files in the given directory, you can execute the following command:

RIdiom --filepath "your filepath" --idiom "IdiomName" --outputdir "your output folder" --output_codepair  "your output path" --flag_merge_allcodepair 1

IDE plugin:

https://plugins.jetbrains.com/plugin/20107-ridiom#

Web application:

We also develop a web application for the code refactoring, you could access the application through the url: 47.242.131.128:5000

Each time, you could click code area to refresh.

Metadata

Release files for RefactoringIdioms 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RefactoringIdioms 0.0.14
File Size Uploaded
refactoringidioms-0.0.14.tar.gz 148.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for RefactoringIdioms 0.0.14
File Interpreter ABI Platform
refactoringidioms-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 347.3 kB

Release files / refactoringidioms-0.0.14.tar.gz

Download URL refactoringidioms-0.0.14.tar.gz
Size 148.4 kB
Tags Source
SHA-256 checksum
How to use checksums
846b45383f9a397bf147a634a27293295d13e2b686788d274f5444202783ce9e
BLAKE2b-256 checksum
How to use checksums
725669b6efd0ef94ec20ca4b88a30a3e01d2e009dff1be59e4d8d7c388025cf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.9

Release files / refactoringidioms-0.0.14-py3-none-any.whl

Download URL refactoringidioms-0.0.14-py3-none-any.whl
Size 198.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2930fb283b03cbb40e6074982eec7286f5ab62d7e6030c16ab8fca49747d7398
BLAKE2b-256 checksum
How to use checksums
c4a5ea6a946e7df53290a44916fe6db308ae502fe38b9339a0205324ed115976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page