Skip to content

Python command line application to stack files in directory based on extension, type, and created date.

License

Notifications You must be signed in to change notification settings

haxzie-xx/stackby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackBy forthebadge

Python CLI to stack files in a directory based on type, date and extension.
StackBy uses Google's Fire module to make the command line interface. Refer their docs for mode info.

Installing requirement (libmagic)

For OSX users
Using Homebrew: brew install libmagic
Using macports: port install file

Installation

Install the package from PyPI

$ pip3 install stackby

If you encounter any permission error, use

$ sudo -H pip3 install stackby

Usage

StackBy is a handy CLI tool to make your life easier to clean up your folder with random files. StackBy can create separate subdirectories for files based on their extension, type or created date.

Stack files by their extension

CD into the directory to clean up.

$ stackby ext

or simply specify the directory path to clean up.

$ stackby ext DIRECTORY_PATH

stack by creation date

$ stackby date

or simply specify the directory path to clean up.

$ stackby date DIRECTORY_PATH

stack by predefined type

$ stackby type

or simply specify the directory path to clean up.

$ stackby type DIRECTORY_PATH

stack by multiple categories

$ stackby multiple --categories=[LIST_OF_CATEGORIES_SEPARATED_BY_COMMAS] DIRECTORY_PATH

Example to clean current directory by extension, then by date.

$ stackby multiple --categories=[ext,date]

Undo stacking in a directory

You can undo the last stacking inside a directory. CD into the directory where files has been stacked from. Make sure there exists the .stackby file.

$ stackby undo

or simply supply the DIRECTORY_PATH where the .stackby file resides

$ stackby undo DIRECTORY_PATH

Default DIRECTORY_PATH is the present working directory and by default it reverts all the stacked files in the directory.

Contributing

To contribute to the project, Please take up the tasks specified in the issues. Add a comment in the issues if you are taking up one.

Instructions

  • Fork the repository to your account.
  • Copy the clone url of your repository.
  • Clone the repository to your machine git clone https://github.com/YOUR_USER_NAME/stackby.git
  • Make sure you create a branch with the name as the issue you are working on git checkout -b YOUR_BRANCH_NAME, and make sure you are working on the same branch and not the master, run git status to know which branch you are working on, run git branch, your branch will be highlighted with an *. If you are not in your branch or want to move to another branch use git checkout BRANCH_NAME. a good branch name should explain what this branch is about eg. stackby_type, stackby_date, feature_undo etc.
  • Add the upstream url of original repository, follow the instructions here
  • Make sure your repository is in sync with the original repository's master branch. Follow the instruction here to know how to keep your local repository in sync.
  • Finally when you have made the changes, submit a pull request through github from the original repository, choose your branch against the master of original or create a new branch.

About

Python command line application to stack files in directory based on extension, type, and created date.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages