Skip to main content

ezfileutils

ezfileutils is a Python utility script that simplifies common file operations. It provides a set of functions to perform tasks such as file removal, renaming, copying, moving, reading, writing, directory management, and more.

Installation

To install ezfileutils, you can use pip:

pip install ezfileutils

Usage

Here's how you can use ezfileutils in your Python scripts:

from ezfileutils import *

# Example usage
result, error_code = remove_file('file.txt', verbose=True)
if result == 0:
    print("File removed successfully!")
else:
    print(f"Error: {error_code}")

Functions

  • remove_file(file_path, verbose=False): Removes a file.
  • rename_file(file_path, new_name, verbose=False): Renames a file.
  • copy_file(source, destination, verbose=False): Copies a file.
  • move_file(source, destination, verbose=False): Moves a file.
  • read_file(file_path, verbose=False): Reads the contents of a file.
  • write_file(file_path, contents, verbose=False): Writes contents to a file.
  • create_directory(directory_path, verbose=False): Creates a directory.
  • list_files_in_directory(directory_path, verbose=False): Lists files in a directory.
  • delete_directory(directory_path, verbose=False): Deletes a directory.
  • get_file_size(file_path, unit='kilobytes', verbose=False): Gets the size of a file.
  • change_file_permissions(file_path, permissions, verbose=False): Changes file permissions.
  • compress_file(file_path, archive_path, verbose=False): Compresses a file.
  • decompress_file(archive_path, extract_path, verbose=False): Decompresses a file.
  • encrypt_file(file_path, key, verbose=False): Encrypts a file.
  • decrypt_file(file_path, key, verbose=False): Decrypts a file.
  • read_csv_file(file_path, delimiter=',', verbose=False): Reads a CSV file.
  • write_csv_file(file_path, data, delimiter=',', verbose=False): Writes data to a CSV file.
  • read_json_file(file_path, verbose=False): Reads a JSON file.
  • write_json_file(file_path, data, verbose=False): Writes data to a JSON file.
  • read_xml_file(file_path, verbose=False): Reads an XML file.
  • write_xml_file(file_path, root, verbose=False): Writes XML data to a file.
  • read_text_file(file_path, verbose=False): Reads a text file.
  • write_text_file(file_path, contents, verbose=False): Writes contents to a text file.
  • append_text_to_file(file_path, contents, verbose=False): Appends text to a text file.
  • read_binary_file(file_path, verbose=False): Reads a binary file.
  • write_binary_file(file_path, contents, verbose=False): Writes binary data to a file.
  • append_binary_to_file(file_path, contents, verbose=False): Appends binary data to a file.
  • checksum_file(file_path, algorithm='md5', verbose=False): Computes the checksum of a file.
  • compare_files(file_path1, file_path2, verbose=False): Compares two files.
  • check_file_existence(file_path, verbose=False): Checks if a file exists.

Contributing

Contributions are welcome! If you have any ideas for new features or improvements, please open an issue or submit a pull request.

Extra Stuff

Im going to try and add all sorts of useful functions to this script and optimize the code as i go. I hope you enjoy! <333

Metadata

Release files for ezfileutils 1.0.54

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

Source distribution (sdist)

Source distribution for ezfileutils 1.0.54
File Size Uploaded Provenance Actions
ezfileutils-1.0.54.tar.gz 5.3 kB Without provenance Details for ezfileutils-1.0.54.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ezfileutils 1.0.54
File Interpreter ABI Platform Actions
ezfileutils-1.0.54-py3-none-any.whl Python 3 none any Details for ezfileutils-1.0.54-py3-none-any.whl

Total release size: 10.1 kB

Release files / ezfileutils-1.0.54.tar.gz

Download URL ezfileutils-1.0.54.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9ec2c1aac22d98f763712b1c901d34354966ca64a672be333752b84d8fbd666e
BLAKE2b-256 checksum
How to use checksums
ee81f5dbd8326ca258f9f157a8e8899dadd6d3074a24bc9c768b449981f8b08c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Release files / ezfileutils-1.0.54-py3-none-any.whl

Download URL ezfileutils-1.0.54-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b793a3033ec6f301644e5db452dc8a5a4e5edb674d9765d8de85d50183f33fd5
BLAKE2b-256 checksum
How to use checksums
da292fffe95d42f0e78248ff503f586786b78956646aa961db845c80c750359b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Security for ezfileutils 1.0.54

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.

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