Utilities for files and images.
Project description
forfiles
Utilities for files and images.
Installation
Use the package manager pip to install forfiles.
pip install --upgrade forfiles
Usage
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)
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
forfiles-6.0.0.tar.gz
(8.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forfiles-6.0.0.tar.gz.
File metadata
- Download URL: forfiles-6.0.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb62ca835b427a60ec183e607fa96f7fd6f7746d282cecb5250dadb17e5cbf68
|
|
| MD5 |
effb2a9c8e351f24c1d2852523d351d9
|
|
| BLAKE2b-256 |
d1bb82f1fc612fd36f2a393be9893b47553437a8716673bc90a5e2bf4a995745
|
File details
Details for the file forfiles-6.0.0-py3-none-any.whl.
File metadata
- Download URL: forfiles-6.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ec77241e93499371c878e55fc9f63bd071519f303cc18932f198ef65ac86ddc
|
|
| MD5 |
6a5d272edd94f2eb8746231f2839e095
|
|
| BLAKE2b-256 |
9793a6c911095e2b701a9dd86113c06a60af43617250b4bbbb7aaaf9de4c399f
|