# yasfs - Yet Another Simple File Sorter
**Version:** 1.0
**Description:** yasfs is a Python-based command-line tool that organizes and sorts files by their extension types.
## Installation
You can install this repo directly from PyPI using `pip`:
```bash
pip install yasfs
```
Or, you can install directly from this repository:
```bash
pip install git+https://github.com/ashaider/yet-another-simple-file-sorter.git
```
## Usage
### To get help with commandline arguments
```bash
yasfs --help
```
### Basic Usage
```bash
yasfs -s /path/to/source -d /path/to/destination
```
### Optional Arguments
- `--source` or `-s`: The path to the directory where the files will be read from
- `--destination` or `-d`: The path to the directory where the files will be moved to and sorted at
- `--subfolder_only_sort` or `-sf`: When provided, does not sort files if they have no pre-made destination folder
All of the above optional arguments, if not provided, will pull their value from `config.ini`.
- `--use_current_dir` or `-u`: When provided, overrides `source` and `destination` with the current directory in the commandline. (Using `-s` and `-d` alongside this will render their values useless)
- `--config` or `-c`: Opens the config file and exits
## Configuration
By default, `yasfs` looks for a configuration file named `config.ini` located in the parent directory of the script. The settings in this file can be overrriden through the use of optional arguments in the command line. However,the config file also specifies custom sorting rules, allowing you to map specific file types to custom subfolders, which cannot be done from the command line.
The following is an example of how a `config.ini` file could look like:
```ini
[Settings]
source: /path/to/source
destination: /path/to/destination
sort_only_if_destination_subfolder_exists: False
[Overwrite Destinations]
Audio_Files: MP3, WAV, OGG, M4A, FLAC, AIFF, WMA, AAC
Image_Files: PNG, JPG, JPEG, HEIF, WEBP, TIF, TIFF, BMP, GIF, EPS
Text_Files: DOCX, PDF, PPT, PPTX, XLS, XLSX, XML, ODT, TXT, RTF, CSV, DOC, WPS, WPD, MSG. JSON, INI, LOG, YML, YAML, CONF
Video_Files: MP4, MPG, MOV, AVI, WMV, AVCHD, WEBM, FLV, F4V, SWF, MKV, WEBM, 3GP
Executable_Files: EXE, BAT, COM, CMD, INF, IPA, OSX, PIF, RUN, WSH, SH
Code_Files: C, CPP, JAVA, PY, JS, TS, CS, SWIFT, DTA, PL
Compressed_Files: RAR, ZIP, HQX, ARJ, TAR, ARC, SIT, GZ, Z
Webpage_Files: HTML, HTM, XHTML, ASP, CSS, ASPX, RSS,
3D_Files: OBJ, FBX, GLTF, USD, USDZ, CAD, BLEND, SBSAR, AMF, STL
```
In this example, we scan files from `/path/to/source`, move them to `/path/to/destination`, and sort them into custom subfolders if they match any of the file extension types defined under `[Overwrite Destinations]`.
## Examples
### Base Use case
To just run the program using the settings from `config.ini`
```bash
yasfs
```
### Using Arguments
Perhaps we want to keep `config.ini` untouched, and want to change the its settings just for this command... this is where arguments become handy.
Here we override the source and destination file paths from `config.ini`:
```bash
yasfs -s /path/to/source -d /path/to/destination
```
Here we just override the destination file path from `config.ini`:
```bash
yasfs -d /path/to/destination
```
We can do the same for the source file path, of course:
```bash
yasfs -s /path/to/source
```
When we sort files, subfolders for their file extension type are automatically created, but what if we don't want to sort files unless their subfolders already exist?
```bash
yasfs -sf
```
## Contributing
1. Fork this repository (https://github.com/ashaider/yet-another-simple-file-sorter/fork)
2. Create your feature branch (git checkout -b feature/fooBar)
3. Commit your changes (git commit -am 'Add some fooBar')
4. Push to the branch (git push origin feature/fooBar)
5. Create a new Pull Request
## Meta
A. Haider – ahmedsyedh1+gh@gmail.com
https://github.com/ashaider/yet-another-simple-file-sorter/
Distributed under the MIT license. See LICENSE for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/ashaider/yet-another-simple-file-sorter/",
"name": "yasfs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "ashaider",
"author_email": "ahmedsyedh1+gh@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/95/88/da5c1d6975bb708117a37e1b9cf4aafb86106d20228db1460c3ae8eba452/yasfs-1.0.tar.gz",
"platform": null,
"description": "\r\n# yasfs - Yet Another Simple File Sorter\r\n\r\n**Version:** 1.0 \r\n**Description:** yasfs is a Python-based command-line tool that organizes and sorts files by their extension types.\r\n\r\n## Installation\r\nYou can install this repo directly from PyPI using `pip`:\r\n```bash\r\npip install yasfs\r\n```\r\nOr, you can install directly from this repository:\r\n```bash\r\npip install git+https://github.com/ashaider/yet-another-simple-file-sorter.git\r\n```\r\n\r\n## Usage\r\n### To get help with commandline arguments\r\n```bash\r\nyasfs --help\r\n```\r\n### Basic Usage\r\n```bash\r\nyasfs -s /path/to/source -d /path/to/destination\r\n```\r\n### Optional Arguments\r\n- `--source` or `-s`: The path to the directory where the files will be read from\r\n- `--destination` or `-d`: The path to the directory where the files will be moved to and sorted at\r\n- `--subfolder_only_sort` or `-sf`: When provided, does not sort files if they have no pre-made destination folder\r\nAll of the above optional arguments, if not provided, will pull their value from `config.ini`.\r\n- `--use_current_dir` or `-u`: When provided, overrides `source` and `destination` with the current directory in the commandline. (Using `-s` and `-d` alongside this will render their values useless)\r\n- `--config` or `-c`: Opens the config file and exits\r\n\r\n## Configuration\r\nBy default, `yasfs` looks for a configuration file named `config.ini` located in the parent directory of the script. The settings in this file can be overrriden through the use of optional arguments in the command line. However,the config file also specifies custom sorting rules, allowing you to map specific file types to custom subfolders, which cannot be done from the command line.\r\n\r\nThe following is an example of how a `config.ini` file could look like:\r\n```ini\r\n[Settings]\r\nsource: /path/to/source\r\ndestination: /path/to/destination\r\nsort_only_if_destination_subfolder_exists: False\r\n\r\n[Overwrite Destinations]\r\nAudio_Files: MP3, WAV, OGG, M4A, FLAC, AIFF, WMA, AAC\r\nImage_Files: PNG, JPG, JPEG, HEIF, WEBP, TIF, TIFF, BMP, GIF, EPS\r\nText_Files: DOCX, PDF, PPT, PPTX, XLS, XLSX, XML, ODT, TXT, RTF, CSV, DOC, WPS, WPD, MSG. JSON, INI, LOG, YML, YAML, CONF\r\nVideo_Files: MP4, MPG, MOV, AVI, WMV, AVCHD, WEBM, FLV, F4V, SWF, MKV, WEBM, 3GP\r\nExecutable_Files: EXE, BAT, COM, CMD, INF, IPA, OSX, PIF, RUN, WSH, SH\r\nCode_Files: C, CPP, JAVA, PY, JS, TS, CS, SWIFT, DTA, PL\r\nCompressed_Files: RAR, ZIP, HQX, ARJ, TAR, ARC, SIT, GZ, Z\r\nWebpage_Files: HTML, HTM, XHTML, ASP, CSS, ASPX, RSS,\r\n3D_Files: OBJ, FBX, GLTF, USD, USDZ, CAD, BLEND, SBSAR, AMF, STL\r\n```\r\nIn this example, we scan files from `/path/to/source`, move them to `/path/to/destination`, and sort them into custom subfolders if they match any of the file extension types defined under `[Overwrite Destinations]`.\r\n\r\n## Examples\r\n### Base Use case\r\nTo just run the program using the settings from `config.ini`\r\n```bash\r\nyasfs\r\n```\r\n### Using Arguments\r\nPerhaps we want to keep `config.ini` untouched, and want to change the its settings just for this command... this is where arguments become handy. \r\nHere we override the source and destination file paths from `config.ini`:\r\n```bash\r\nyasfs -s /path/to/source -d /path/to/destination\r\n```\r\nHere we just override the destination file path from `config.ini`:\r\n```bash\r\nyasfs -d /path/to/destination\r\n```\r\nWe can do the same for the source file path, of course:\r\n```bash\r\nyasfs -s /path/to/source\r\n```\r\nWhen we sort files, subfolders for their file extension type are automatically created, but what if we don't want to sort files unless their subfolders already exist?\r\n```bash\r\nyasfs -sf\r\n```\r\n\r\n## Contributing\r\n1. Fork this repository (https://github.com/ashaider/yet-another-simple-file-sorter/fork)\r\n2. Create your feature branch (git checkout -b feature/fooBar)\r\n3. Commit your changes (git commit -am 'Add some fooBar')\r\n4. Push to the branch (git push origin feature/fooBar)\r\n5. Create a new Pull Request\r\n\r\n## Meta\r\nA. Haider \u00e2\u20ac\u201c ahmedsyedh1+gh@gmail.com\r\n\r\nhttps://github.com/ashaider/yet-another-simple-file-sorter/\r\n\r\nDistributed under the MIT license. See LICENSE for more information.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python-based command-line tool that organizes and sorts files by their extension types",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/ashaider/yet-another-simple-file-sorter/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ab5fe3442f2c96f5bbbb1fa826c791987e0d744a7c565def1a589de5d9611cee",
"md5": "ed4160876ae9ded3aa63d927628c409d",
"sha256": "d60ef83cce7e2681e4274ff96c85a60b49d973cd0f08122825d242122193b32b"
},
"downloads": -1,
"filename": "yasfs-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed4160876ae9ded3aa63d927628c409d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8392,
"upload_time": "2024-10-20T21:41:04",
"upload_time_iso_8601": "2024-10-20T21:41:04.784659Z",
"url": "https://files.pythonhosted.org/packages/ab/5f/e3442f2c96f5bbbb1fa826c791987e0d744a7c565def1a589de5d9611cee/yasfs-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9588da5c1d6975bb708117a37e1b9cf4aafb86106d20228db1460c3ae8eba452",
"md5": "563076e48ff04efd340f6750f816db01",
"sha256": "b6033b9894c3630c66088a9f62e137b16df72de8ca968dec3a4c2cf9f1579f03"
},
"downloads": -1,
"filename": "yasfs-1.0.tar.gz",
"has_sig": false,
"md5_digest": "563076e48ff04efd340f6750f816db01",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8536,
"upload_time": "2024-10-20T21:41:06",
"upload_time_iso_8601": "2024-10-20T21:41:06.448000Z",
"url": "https://files.pythonhosted.org/packages/95/88/da5c1d6975bb708117a37e1b9cf4aafb86106d20228db1460c3ae8eba452/yasfs-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 21:41:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ashaider",
"github_project": "yet-another-simple-file-sorter",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "yasfs"
}