simple-file-handler


Namesimple-file-handler JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryAn easy to use interface for basic file handling operations.
upload_time2023-12-25 20:48:47
maintainer
docs_urlNone
author
requires_python>=3.7
license
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
VCS
bugtrack_url
requirements toml pyyaml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "simple-file-handler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "ti-oluwa <tioluwa.dev@gmail.com>",
    "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",
    "author": "",
    "author_email": "ti-oluwa <tioluwa.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/36/bc/a43a5b1dc99a386b4458a0228d178da287b71e31107beeb8069568881a70/simple_file_handler-0.0.1.tar.gz",
    "platform": null,
    "description": "## simple_file_handler\r\n\r\nThe `FileHandler` class provides an interface to perform most file operations easily and intuitively. All you need is the file path.\r\n\r\n```python\r\nimport simple_file_handler as sfh\r\n\r\n# Use in a with statement to ensure the file is closed after use\r\nwith sfh.FileHandler('path/to/file.txt') as hdl:\r\n    try:\r\n        # Read the handled file's content\r\n        data = hdl.read_file(mode='r')\r\n        # Write to the handled file\r\n        hdl.write_file(b'Hello World!', mode='ab')\r\n        # Make a copy of the handled file\r\n        copy_hdl = hdl.make_copy('path/to/directory', filename='file_copy')\r\n        print(copy_hdl.file_path)\r\n        # Delete the handled file\r\n        hdl.delete_file()\r\n    except sfh.FileError as exc:\r\n        print(exc)\r\n```\r\n\r\n## Installation\r\n\r\nDo a pip install from the command line:\r\n\r\n```bash\r\npip install simple-file-handler\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An easy to use interface for basic file handling operations.",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/ti-oluwa/simple_file_handler/issues",
        "Homepage": "https://github.com/ti-oluwa/simple_file_handler",
        "Repository": "https://github.com/ti-oluwa/simple_file_handler"
    },
    "split_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"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cab77eb0142c29fd07b3ee87150b587386d576bafa46da858945846f9a4b4058",
                "md5": "765525d50c59d9bcaf528d3f66db8cfd",
                "sha256": "9776555352fd62aa3de14959ef179a9e610b9fb194e682a5a033fa3e93eaeab0"
            },
            "downloads": -1,
            "filename": "simple_file_handler-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "765525d50c59d9bcaf528d3f66db8cfd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 20106,
            "upload_time": "2023-12-25T20:48:40",
            "upload_time_iso_8601": "2023-12-25T20:48:40.602776Z",
            "url": "https://files.pythonhosted.org/packages/ca/b7/7eb0142c29fd07b3ee87150b587386d576bafa46da858945846f9a4b4058/simple_file_handler-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36bca43a5b1dc99a386b4458a0228d178da287b71e31107beeb8069568881a70",
                "md5": "6b044d4dfd53311165aa1229c1c33336",
                "sha256": "04d8732c141040d15768644767cceb8fad87b5114a9ca86e89a4fc3204cb522b"
            },
            "downloads": -1,
            "filename": "simple_file_handler-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6b044d4dfd53311165aa1229c1c33336",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 22058,
            "upload_time": "2023-12-25T20:48:47",
            "upload_time_iso_8601": "2023-12-25T20:48:47.601233Z",
            "url": "https://files.pythonhosted.org/packages/36/bc/a43a5b1dc99a386b4458a0228d178da287b71e31107beeb8069568881a70/simple_file_handler-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-25 20:48:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ti-oluwa",
    "github_project": "simple_file_handler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "toml",
            "specs": []
        },
        {
            "name": "pyyaml",
            "specs": []
        }
    ],
    "lcname": "simple-file-handler"
}
        
Elapsed time: 0.67047s