Metadata-Version: 2.1
Name: simple_file_handler
Version: 0.0.1
Summary: An easy to use interface for basic file handling operations.
Author-email: ti-oluwa <tioluwa.dev@gmail.com>
Maintainer-email: ti-oluwa <tioluwa.dev@gmail.com>
Project-URL: Homepage, https://github.com/ti-oluwa/simple_file_handler
Project-URL: Bug Tracker, https://github.com/ti-oluwa/simple_file_handler/issues
Project-URL: Repository, https://github.com/ti-oluwa/simple_file_handler
Keywords: file,file-handling,file-handler,file-handlers,file-handling-operations,file-handling-operation,write-to-file,read-from-file,copy-file,move-file,delete-file
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Natural Language :: English
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: toml
Requires-Dist: pyyaml

## simple_file_handler

The `FileHandler` class provides an interface to perform most file operations easily and intuitively. All you need is the file path.

```python
import simple_file_handler as sfh

# Use in a with statement to ensure the file is closed after use
with sfh.FileHandler('path/to/file.txt') as hdl:
    try:
        # Read the handled file's content
        data = hdl.read_file(mode='r')
        # Write to the handled file
        hdl.write_file(b'Hello World!', mode='ab')
        # Make a copy of the handled file
        copy_hdl = hdl.make_copy('path/to/directory', filename='file_copy')
        print(copy_hdl.file_path)
        # Delete the handled file
        hdl.delete_file()
    except sfh.FileError as exc:
        print(exc)
```

## Installation

Do a pip install from the command line:

```bash
pip install simple-file-handler
```
