Skip to main content

Sort a folder's content with just one line of code

Project description

Alphorder

Alphorder is a tool that allows you to sort your folders with a simple line of code either from the command line or you can import it into your Python project.

Instalation

You can install alphorder whit pip running the following command

pip install alphorder

Usage

There are two main ways you can use alphorder, from the comandline and importing it to your proyect.

Proyect

You can import alphorder to your proyect with this line of code

from alphorder import Alphorder

This way you have imported the class that contains the methods to sort your folders

Alphabetic order

You can put all the files and folders into the corresponding folder to his name, this mean that if there is a file called Casa will me moved to the folder C.

All of the numeric starting folders or files will be moved to a folder called #.

All of this will be achived bia the method sort

Alphorder.sort("path/to/folder")

Move to a specific folder

You can perform the same that before but just for the content that matches one of the keywords that you specifie with the method moveToFolder.

The method will receive two params, the first one will be the path of the folder, and the second one will be the folder to move.

If the second param is not a valid path, then the program will create a folder with the second param as its name and move all the content to it.

Alphorder.sort("/path/to/folder", "path/to/second/folder")
# or you can simply add a word or sentence
Alphorder.sort("/path/to/folder", "ordenado con alphorder")

Move to a specific folder with params

You can perform the same that before but just for the content that matches a series one of the keywords that you specifie with the method moveToFolderByKeywords

This method will receive a param more that the previous one: an array of strings to match

The target will be moved if any of the keywords is found on its name

Alphorder.sort("/path/to/folder", "second path", ["sort", "alph"])

Commandline

You can use the same methods that on the proyect directly from the commandline with the alphorder keyword.

Alphabetic order

alphorder "/path/to/folder"

As you can see is allmost the same as before.

Move to a specific folder

As in a proyect you need to specify two params: the main path and the target path.

alphorder "/path/to/folder" "/target/path"

If the second param is not an existing folder then a folder with the same name will be created on the main folder

Move to a specific folder with params

If you add more params after the two path this ones will be taked as keywords, and then just will be moved the files or the folders that contains any of the keywords in its name

alphorder "/path/to/folder" "/target/path" word1 word2 "sample of a sentence"

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

alphorder-0.1.1.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file alphorder-0.1.1.tar.gz.

File metadata

  • Download URL: alphorder-0.1.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.3

File hashes

Hashes for alphorder-0.1.1.tar.gz
Algorithm Hash digest
SHA256 58f55d49ab46304d39bb47b4049de9b354ec14c71133604f17eb98826d203f14
MD5 863a2218fe553d048bb8f41b4785788e
BLAKE2b-256 bde6fbaf43cc61c28e3210221bb4684ca2a69053b477f345bdc7c9ea115318ae

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