Skip to main content

Move Interactively

Project description

mvi: move interactively

Organising files via the command line can be cumbersome, for many reasons. Editing capabilities on the command line are limited. Characters from foreign character sets cannot be inserted. Arguments may require quoting or escaping. Names may be mistaken for flags.

Mvi aims to simplify bulk renames of files and directories by opening the directory listing in a text editor, thus providing a powerful interface for editing destination paths. Names are changed by editing lines in place. Upon exit mvi will show a list of scheduled rename operations and ask for confirmation before committing the changes to disk.

A lot of care is taken to make sure that mvi does not bail out halfway through an operation. File targets are checked for availability before starting a commit - mvi will never overwrite a file. In case of an unexpected IO error mvi will return to the editor for manual resolution, from where it can pick up with the remaining move operations.

examples

The equivalence of mv bar baz in mvi involves an edit of the first line "bar" into "baz" (not shown, but listed by mvi in summary):

$ ls
bar foo

$ mvi
Line 1: bar -> baz
Proceed: continue/edit/abort c
Moved bar -> baz
Done.

$ ls
baz foo

Swapping lines results in swapping files:

$ ls
bar foo

$ mvi
Line 1: bar -> foo
Line 2: foo -> bar
Proceed: continue/edit/abort c
Moved bar -> bar_
Moved foo -> bar
Moved bar_ -> foo
Done.

$ ls
bar foo

Items can be organized in subdirectories by simply editing a (relative or absolute) destination path including directory separators.

$ ls
bar foo

$ mvi
Line 1: bar -> sub/bar
Line 2: foo -> sub/foo
Proceed: continue/edit/abort c
Moved bar -> sub/bar
Moved foo -> sub/foo
Done.

$ ls
sub/

installation

Mvi is available on pypi for installation via pip:

$ pip3 install mvi

Note that in externally managed environments (i.e. having Python packages installed via apt or similar) you may need to add --break-system-packages to step over pip's guard rails. Alternatively you can use pipx to install mvi in an isolated environment:

$ pipx install mvi

see also

The rename command that is available in most distributions allows for bulk move operations based on regular expressions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mvi-2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

mvi-2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mvi-2.0.tar.gz.

File metadata

  • Download URL: mvi-2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.2

File hashes

Hashes for mvi-2.0.tar.gz
Algorithm Hash digest
SHA256 072f42bfc8575c7cc4e59d89790c69de1aa63a43d502cf17a5d66bcd7bd09bd9
MD5 a0ed8969ce6d13e953066feb531d19e9
BLAKE2b-256 5125c754ef1262a5d21afc9ce8b62051e580a43c1c5b7b35d1cdde2384403284

See more details on using hashes here.

File details

Details for the file mvi-2.0-py3-none-any.whl.

File metadata

  • Download URL: mvi-2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.2

File hashes

Hashes for mvi-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2483334b41afc05cec45ac98a2dda6c26584b46dd60ef91343813f8e94fc2f78
MD5 371a6c5e8361ed6f01615ff6b7fdaabd
BLAKE2b-256 68925315c92fd9d743487dce5d50cf7374df9250fa38ff3efafac4b1e9391d60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page