Giter Site home page Giter Site logo

pltnk / selective_copy Goto Github PK

View Code? Open in Web Editor NEW
37.0 2.0 6.0 117 KB

Command line application for selective file copying based on filename extensions.

License: MIT License

Python 100.00%
cli cli-app command-line command-line-tool command-line-app command-line-interface automate-the-boring-stuff automate-the-boring-stuff-python python

selective_copy's Introduction

Selective Copy v0.3.0

Python Version PyPi Version Downloads Codacy Badge Code style: black License

Simple command line application that copies all files with given extensions from a directory and its subfolders to another directory showing progress bar and remaining files counter.
Allows to preserve a source folder structure, to process only files without given extensions, to move files instead of copying, to exclude certain files from processing and to create a log if necessary.
Opens a filedialog if source and/or destination are not given in the command line.
Creates folders in a destination path if they don't exist.

Installing

pip install slcp

Usage

slcp ext [ext ...] [-s SRC] [-d DST] [-sc | -dc] [-p] [-i] [-m] [-e FILE [FILE ...]] [-l] [-h]

Positional arguments:
ext                         One or more extensions of the files to copy. 
                            Enter extensions without a dot and separate by spaces.

Optional arguments:
-s SRC, --source SRC        Source folder path.
-d DST, --dest DST          Destination folder path.
-sc, --srccwd               Use current working directory as a source folder.
-dc, --dstcwd               Use current working directory as a destination folder.
-p, --preserve              Preserve source folder structure.
-i, --invert                Process only files without given extensions.
-m, --move                  Move files instead of copying, be careful with this option.
-e FILE [FILE ...],         Exclude one or more files from processing.
--exclude FILE [FILE ...]   Enter filenames with extensions and separate by spaces.
-l, --log                   Create and save log to the destination folder.
-h, --help                  Show this help message and exit.

Examples

asciicast

Changelog

v0.3.0 - 2019-08-22

Added

Changed

  • The code is now divided into separate modules
  • Dots that come with extensions are removed from output folder name. The reason is that folders with a name starting with a dot are considered as hidden on Linux.
  • Log saving indication
  • Name of the logfile

Fixed

  • Issue when paths like /home/user/test and /home/user/test2 were considered as nested which lead to an error.

Compare with v0.2.1

v0.2.1 - 2019-07-16

Added

  • Changelog

Fixed

Compare with v0.2.0

v0.2.0 - 2019-07-15

Added

  • Support of processing several extensions at once
  • --invert option
  • --move option
  • --exclude option

Compare with v0.1.0

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Inspired by the task from Chapter 9 of Automate the Boring Stuff.

selective_copy's People

Contributors

pltnk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

selective_copy's Issues

Feature Request: Give the user the choice to Copy or Move.

When it's in the same drive, sometimes users might prefer to just Move/Rename. So we can just keep copy as default option, and only when move/rename is passed as argument just move the files.
Reduces overall time, and HW IO. (I guess)

Feature Request : Extension list with an invert option.

It's useful to copy all files while omitting a couple extensions sometimes.. an invert option there would be useful.
slcp [txt] --invert would copy all files except txt files. Useful when there are many other extensions.

Feature Request : Extentsion List instead of single extension.

We can have multiple extensions ,that'll be copied.
Eg: I have a movies folder, and I want to copy mkv, mp4, srt, ass etc files with folder structure preserved, while omitting jpg, txt, nfo, etc.
We'd have to run the command multiple times with each extension if not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.