Metadata-Version: 2.4
Name: forfiles
Version: 6.0.0
Summary: Utilities for files and images.
Project-URL: Home, https://github.com/4mbl/forfiles
Project-URL: Repository, https://github.com/4mbl/forfiles
Project-URL: Documentation, https://github.com/4mbl/forfiles/blob/main/README.md
Project-URL: Bug Tracker, https://github.com/4mbl/forfiles/issues
Author: 4MBL
License: MIT License
        
        Copyright (c) 2022 4MBL
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: directory,file,filesystem,fs,image,utility
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pillow<12.2.0,>=12.0.0
Description-Content-Type: text/markdown

# forfiles

Utilities for files and images.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install forfiles.

```bash
pip install --upgrade forfiles
```

## Usage

```python
from forfiles import fs, image

# file tools
fs.filter_type("directory-to-filter/", [".png", ".txt", "md"])
fs.dir_create("directory-to-create/")
fs.dir_delete("directory-to-delete/")

# image tools
image.scale("boat.png", 1, 1.5)
image.resize("car.jpg", 1000, 1000)
image.to_png("plane.jpg")

# you can also process all files in a directory with a callback function
# arguments after the function are passed to the callback in addition to the file path
fs.process_files("cats/", image.scale, 2, 2)
fs.process_files("giraffes/", image.resize, 1000, 1000)
fs.process_files("tortoises/", image.to_png)

# you can also iterate using a generator syntax
for file in fs.iterate_files('gorillas/'):
    if file.suffix == '.py':
        print(file.name)
```
