<commit_before>camel-snake-pep8
================

A refactoring tool to help convert camel case to snake case and vice versa in a
Python program, in conformity with the PEP-8 style guide.  It uses/abuses
Python-Rope to find and perform the changes.  The program interactively
displays proposed changes and the code diffs that would result from the change.
It queries the user as to whether or not to accept the changes.

The program does not do all the changes for full PEP-8 naming compliance, but
it does most of them.  It currently does not recognize unpacked assignments to
tuples very well, and it does not try to modify any names in the context of
import statements.

Note that a formatting program such as autopep8 (which is pip installable) can
be used to automatically fix many syntactical and spacing issues, but those
programs do not rename variables.  If such a program is also used it should be
done as a separate step, and some testing should be done between running the
two programs to help isolate any problems which might be introduced.

* **Use this software at your own risk.** This program has various features to
  try to avoid introducing errors in renaming, but correctness cannot be
  guaranteed.  Always make a backup copy of any project before running this
  program on it.  The program has been used a few times with good results, but
  does not currently have formal tests.

  Rope is not perfect, so check your results and look at the warnings issued.
  Rope can have problems with changing names which are imported from different
  modules, especially with "import ... as", so it might be a good idea to
  change all names which appear in such statements by hand.

* **Only tested on Ubuntu Linux.**  May or may not work on Windows.

Installing and using
--------------------

The dependences can be installed by the following command::

   pip install rope colorama --upgrade

A recent version of Rope is recommended for Python 3 compatibility.

To install the program just clone or download the git repository and execute
the main file ``camel_snake_pep8.py``.  The program is currently a single
module (so you could alternately just copy that file).

Usage::

      python camel_snake_pep8.py <projectDir> <moduleToModify> [<moduleToModify> ...]

The program can be used to refactor either Python 2 or Python 3 code.  **Run<commit_msg>minor README edit<commit_after>camel-snake-pep8
================

A refactoring tool to help convert camel case to snake case and vice versa in a
Python program, in conformity with the PEP-8 style guide.  It uses/abuses
Python-Rope to find and perform the changes.  The program interactively
displays proposed changes and the code diffs that would result from the change.
It queries the user as to whether or not to accept the changes.

The program does not do all the changes for full PEP-8 naming compliance, but
it does most of them.  It currently does not recognize unpacked assignments to
tuples very well, and it does not try to modify any names in the context of
import statements.

Note that a formatting program such as autopep8 (which is pip installable) can
be used to automatically fix many syntactical and spacing issues, but those
programs do not rename variables.  If such a program is also used it should be
done as a separate step, and some testing should be done between running the
two programs to help isolate any problems which might be introduced.

* **Use this software at your own risk.** This program has various features to
  try to avoid introducing errors in renaming, but correctness cannot be
  guaranteed.  Always make a backup copy of any project before running this
  program on it.  The program has been used a few times with good results, but
  does not currently have formal tests.

  Rope is not perfect, so check your results and look at the warnings issued.
  Rope can have problems with changing names which are imported from different
  modules, especially with "import ... as", so it might be a good idea to
  change all names which appear in such statements by hand.

* **Only tested on Ubuntu Linux.**  May or may not work on Windows.

Installing and using
--------------------

The dependences can be installed by the following command::

   pip install rope colorama --upgrade

A recent version of Rope is recommended for Python 3 compatibility.

To install the program just clone or download the git repository and run
the main file ``camel_snake_pep8.py``.  The program is currently a single
module (so you could alternately just copy that file).

Usage::

      python camel_snake_pep8.py <projectDir> <moduleToModify> [<moduleToModify> ...]

The program can be used to refactor either Python 2 or Python 3 code.  **Run
{'fraction_non_alphanumeric': 0.05025337837837838, 'fraction_numerical': 0.003800675675675676, 'mean_word_length': 3.8986556359875904, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1936215', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1149, 'n_words': 749}