From 077cbbb2c1d0cf2872a36610777bc3bd70f5b3ca Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Fri, 10 Apr 2026 22:10:21 +0200 Subject: [PATCH 1/6] Update README.md --- .Github/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.Github/README.md b/.Github/README.md index 2e2092e..7abbb61 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -128,9 +128,9 @@ Pattern = "*" # A pattern used to sort files to this directory. * is a wildcard; NewFileName = "~^" # A pattern for the new names of the files that get sorted to this directory from matching this "Pattern". -NextNum = 1 # Used to keep track of the next available number for file names. It gets automatically incremented when NextNum is used in NewFileName, and a file gets sorted to this directory and renamed. +NextNum = 1 # Used to keep track of the next available number for file names. If you have two of the character that represents NextNum (Found in Config.toml), you can stack them together to make 01 or 001 instead of 1. It gets automatically incremented when NextNum is used in NewFileName, and a file gets sorted to this directory and renamed. -NextChar = "A" # Used to keep track of the next available letter for file names. It gets automatically incremented (E.G: A into B) when NextChar is used in NewFileName, and a file gets sorted to this directory and renamed. +NextChar = "A" # Used to keep track of the next available letter for file names. It gets automatically incremented (E.G: A into B or AA into AB then AZ into BA) when NextChar is used in NewFileName, and a file gets sorted to this directory and renamed. CaseSensitive = 0 # Whether this "Pattern" is case-sensitive or not. 1 is yes, 0 is no. E.G: if CaseSensitive = 1 and this "Pattern" is "*.PNG", a file named "picture.png" won't get sorted to this directory. If CaseSensitive = 0 and this "Pattern" is "*.PNG", a file named "picture.png" *will* get sorted to this directory. From 739f91a5bfc4655bbda34e1524a345acf4b21115 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 13 Apr 2026 05:39:12 +0200 Subject: [PATCH 2/6] Update README.md --- .Github/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.Github/README.md b/.Github/README.md index 7abbb61..17d0655 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -3,6 +3,16 @@ A python daemon that can automatically sort your files to your liking without us It's made by Sarah, hence the name. :3 +The versioning for SaraSortd is like so: the first number going up means that your +previous config files won't work anymore with the new SaraSortd.py. + +The second number going up means that something has been changed, but you can still +use your old config files with SaraSortd.py. + +## Installation + + + ## Dependencies toml: Use ```pip install toml``` to install toml. From a3bc726086ab7547431d85404ceb842c939cdd3a Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 13 Apr 2026 05:49:37 +0200 Subject: [PATCH 3/6] Update README.md --- .Github/README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.Github/README.md b/.Github/README.md index 17d0655..457c2f2 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -9,13 +9,23 @@ previous config files won't work anymore with the new SaraSortd.py. The second number going up means that something has been changed, but you can still use your old config files with SaraSortd.py. -## Installation - - ## Dependencies toml: Use ```pip install toml``` to install toml. + +## Installation + +Here's an [installation video.](https://youtu.be/ZMIaOhZA0kE). +Here's a step-by-step tutorial (in case you don't want to watch the video). + +1. Install ZIP-file. +2. Unzip ZIP-file wherever you want the program to live. +3. Navigate to the new SaraSortd directory in your terminal. +4. Edit your config files to your liking. +5. Run ```python SaraSortd.py``` to run the program. (This will make new directories for you.) +6. Edit your output directories' configs. + ## Config explanation ### SaraSortd Config (Config.toml) @@ -101,6 +111,7 @@ Unset = "Error: %% is not set." # When a value isn't set. # %% here is just the parameter who's value was either "Unset" or None. E.G: "RootDir". ``` + ### Output Directory Config (DirConfig.toml) The output directory config references the SaraSortd config (Config.toml). This means that you can, for example, use the character assigned to "NextNum" in Config.toml in this config (DirConfig.toml). This applies to all Variables in the SaraSortd config (Config.toml). From 0b54a729ff4f7086d20f7f13967f92013e4dc9ea Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 13 Apr 2026 06:55:40 +0200 Subject: [PATCH 4/6] Update README.md --- .Github/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.Github/README.md b/.Github/README.md index 457c2f2..a41e2b7 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -1,4 +1,5 @@ # SaraSortd + A python daemon that can automatically sort your files to your liking without using AI. It's made by Sarah, hence the name. :3 @@ -10,7 +11,21 @@ The second number going up means that something has been changed, but you can st use your old config files with SaraSortd.py. +## Usage + +SaraSortd is for people who don't want to manually sort files, people who want to organise files, and people who want an automatic naming standard for their files. + +Example use-cases: + +- Sorting log files from multiple programs into one directory. + +- Sorting downloaded github repositories to a directory for your IDE. + +- Regularly cloning important files into a backup directory. + + ## Dependencies + toml: Use ```pip install toml``` to install toml. From 9fbdec91204d6c0a2bd3cf9b1dc0cc678eae9f32 Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Mon, 13 Apr 2026 06:56:15 +0200 Subject: [PATCH 5/6] Update README.md --- .Github/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.Github/README.md b/.Github/README.md index a41e2b7..d5fa372 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -26,6 +26,8 @@ Example use-cases: ## Dependencies +python + toml: Use ```pip install toml``` to install toml. From d68550d0a9b51f26e9f1fbf8ce08f2a5a4c3fe9b Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Tue, 14 Apr 2026 07:20:38 +0200 Subject: [PATCH 6/6] Added delete parameter to dirconf. --- .Github/README.md | 4 +++- Config.toml | 2 +- DirConfig.toml | 1 + SaraSortd.py | 37 +++++++++++++++++-------------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.Github/README.md b/.Github/README.md index d5fa372..593543f 100644 --- a/.Github/README.md +++ b/.Github/README.md @@ -142,7 +142,9 @@ ParentDir = "Unset" # The name of this directory. It gets automatically updated ValidInputDirs = ["*"] # Directories that are valid for sorting. Basically, if a file is from one of these directories, they can be sorted here. * is a wildcard; ? is a one-character wilcard. E.G: if "ValidInputDirs = ["/TestDir/*"]" any file from any directory in "/TestDir" will be allowed to be sorted here. -FileLimit = 0 +FileLimit = 0 # The max limit of files a directory can have. If this is 0, then there's no limit. + +DeleteOrg = 1 # If SaraSortd should delete the original file or not. If this is 1, then sorted files will be 'moved' to an output directory. If not, they will be 'copied' to an output directory. [[Files]] # The double brackets means that you can add multiple types of files to be sorted here. Just copy [[Files]] and all the parameters under it, and paste it under or over this section, then you may change the values of the new parameters. E.G: diff --git a/Config.toml b/Config.toml index eabb173..71ee501 100644 --- a/Config.toml +++ b/Config.toml @@ -1,7 +1,7 @@ Title = "SaraSortd Config" SafeMode = 1 SilentMode = 0 -CheckInput = 3 +CheckInput = 10 DotFiles = 0 Logging = 1 OverwriteDirConf = 0 diff --git a/DirConfig.toml b/DirConfig.toml index 81accb5..c728179 100644 --- a/DirConfig.toml +++ b/DirConfig.toml @@ -3,6 +3,7 @@ LastFile = "Unset" ParentDir = "Unset" ValidInputDirs = ["*"] FileLimit = 0 +DeleteOrg = 1 [[Files]] Pattern = "*" diff --git a/SaraSortd.py b/SaraSortd.py index a24ee20..9435f49 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -266,7 +266,6 @@ def DecideNewPath(FilePath): if not os.path.exists(DirConfPath) or not InputDirValid: continue - OutputFiles = 0 FileLimitConf = GetConf("FileLimit", DirConfPath) @@ -365,37 +364,37 @@ def DecideNewPath(FilePath): def Sort(FilePath): NewPath = DecideNewPath(FilePath) + NewDirPath = os.path.dirname(NewPath) + NewName = os.path.basename(NewPath) + + if (GetConf("DeleteOrg", f"{NewDirPath}/{Parse(String = ConfNames['DirConfName'], Parent = (os.path.basename(NewDirPath)))}.toml") == 1): + Delete = True + + else: + Delete = False + if NewPath is None: Dir(Parse(String = ConfDirs["FailedDir"]), Output = False, CopyConf = False) NewName = os.path.basename(FilePath) - Clone(FilePath, Parse(String = ConfDirs["FailedDir"]), NewName, True) + Clone(FilePath, Parse(String = ConfDirs["FailedDir"]), NewName, Delete) TextOutput = Parse(String = ConfLog["NotSorted"], VarCall = FilePath) LogWrite(TextOutput) Speak(TextOutput) return - NewDirPath = os.path.dirname(NewPath) - NewName = os.path.basename(NewPath) - try: - Clone(FilePath, NewDirPath, NewName, True) - UpdateConf( - f"{NewDirPath}/{Parse(String = ConfNames['DirConfName'], Parent = os.path.basename(NewDirPath))}.toml", - "LastFile", - NewName, - ) + Clone(FilePath, NewDirPath, NewName, Delete) + UpdateConf(f"{NewDirPath}/{Parse(String = ConfNames['DirConfName'], Parent = os.path.basename(NewDirPath))}.toml", "LastFile", NewName) - TextOutput = Parse( - String = ConfLog["Sorted"], VarCall = f"{FilePath} to {NewDirPath}/{NewName}" - ) + TextOutput = Parse(String = ConfLog["Sorted"], VarCall = f"{FilePath} to {NewDirPath}/{NewName}") LogWrite(TextOutput) Speak(TextOutput) except Exception: Dir(Parse(String = ConfDirs["FailedDir"]), Output = False, CopyConf = False) NewName = os.path.basename(NewPath) - Clone(FilePath, Parse(String = ConfDirs["FailedDir"]), NewName, True) + Clone(FilePath, Parse(String = ConfDirs["FailedDir"]), NewName, Delete) TextOutput = Parse(String = ConfLog["NotSorted"], VarCall = FilePath) LogWrite(TextOutput) @@ -419,7 +418,7 @@ def Init(): Output = Parse(String = Output, Parent = os.path.basename(os.path.dirname(Output))) Dir(Output) - DirConfPath = f"{os.path.join(Output, Parse(String = ConfNames["DirConfName"], Parent = os.path.basename(Output)))}.toml" + DirConfPath = f"{Output}/{Parse(String = ConfNames["DirConfName"], Parent = os.path.basename(Output))}.toml" ConfData = toml.load(DirConfPath) for Item in ConfData.get("Files", []): @@ -444,9 +443,7 @@ def Init(): Speak(TextOutput) else: - print( - "NO CONFIG FOUND! Make sure the 'Config.toml' is in the same directory as 'SaraSortd.py'" - ) + print("NO CONFIG FOUND! Make sure the 'Config.toml' is in the same directory as 'SaraSortd.py'") def Main(): @@ -459,7 +456,7 @@ def Main(): continue for FileName in os.listdir(InputPath): - FilePath = os.path.join(InputPath, FileName) + FilePath = f"{InputPath}/{FileName}" if os.path.isfile(FilePath): FileName = os.path.basename(FilePath)