Skip to main content

simple_file_handler

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

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:

pip install simple-file-handler

Metadata

Release files for simple-file-handler 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-file-handler 0.0.1
File Size Uploaded Provenance Actions
simple_file_handler-0.0.1.tar.gz 22.1 kB Without provenance Details for simple_file_handler-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-file-handler 0.0.1
File Interpreter ABI Platform Actions
simple_file_handler-0.0.1-py3-none-any.whl Python 3 none any Details for simple_file_handler-0.0.1-py3-none-any.whl

Total release size: 42.2 kB

Release files / simple_file_handler-0.0.1.tar.gz

Download URL simple_file_handler-0.0.1.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
04d8732c141040d15768644767cceb8fad87b5114a9ca86e89a4fc3204cb522b
BLAKE2b-256 checksum
How to use checksums
36bca43a5b1dc99a386b4458a0228d178da287b71e31107beeb8069568881a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / simple_file_handler-0.0.1-py3-none-any.whl

Download URL simple_file_handler-0.0.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9776555352fd62aa3de14959ef179a9e610b9fb194e682a5a033fa3e93eaeab0
BLAKE2b-256 checksum
How to use checksums
cab77eb0142c29fd07b3ee87150b587386d576bafa46da858945846f9a4b4058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Security for simple-file-handler 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page