Skip to content
/ pymv Public

CLI wrapper of rope's module moving functionality

Notifications You must be signed in to change notification settings

Ridecell/pymv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pymv

pymv is a tool to move or rename python source code files from the command line. Unlike the normal mv command, pymv is python-aware and will also fix up references to the moved python file, such as import statements, within the rest of the project.

pymv is implemented as a CLI wrapper of rope's module moving functionality. Depends on a slightly forked (hacked up) version of Rope - https://github.com/Ridecell/rope.

Usage

usage: pymv [-h] [--dry-run] [--project-root-directory PROJECT_DIR]
            source_path destination_path [scoped_global_variable]

Move python files and folders, automatically updating import statements in dependent files.

positional arguments:
  source_path
  destination_path
  scoped_global_variable
                        Provide a Global variable/class/function name in source file to move to
                        destination. Allows for greater granularity when moving overscoped modules
                        that need to be split into 2 (or more) modules

optional arguments:
  -h, --help            show this help message and exit
  --dry-run
  --project-root-directory PROJECT_DIR
                        Root directory of the python project in which the files are being moved.
                        This defines the scope for which to search for affected import statements.

Install

pip install git+https://github.com/Ridecell/rope pymv

About

CLI wrapper of rope's module moving functionality

Resources

Stars

Watchers

Forks

Languages