Skip to main content

Flexible and beginner-friendly Python package for safe and cross-platform file operations.

Project description

📦 FileHandler

Build License Python

A flexible and beginner-friendly Python package for safe and cross-platform file operations.
Supports both traditional (Unix-style ~) and modern (pathlib) path handling modes with built-in logging, error management, and content retrieval.


✨ Features

  • 🗂️ Read, write, and append to files with automatic encoding (utf-8)
  • 🔁 Switchable file handling modes: Traditional and Modern
  • 🧠 FullPathBuilder for safe home-relative paths
  • 🔐 Exception-safe file operations
  • 📄 License: MIT (free for all use)

📥 Installation

git clone https://github.com/charlie6027/filehandler.git
cd filehandler
pip install -e .

🧪 Running Tests

python -m unittest discover -s tests

🚀 Usage Example

from filehandler import FileHandler, FileHandleMode

handler = FileHandler()
handler.write('~/Documents/test.txt', 'Hello, world!')
print(handler.read('~/Documents/test.txt'))

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.


🧑 Author

Charlie Sky
Feel free to ⭐ the repo if you find it useful!

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

filehandler6027-1.0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filehandler6027-1.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file filehandler6027-1.0.2.tar.gz.

File metadata

  • Download URL: filehandler6027-1.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for filehandler6027-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7a60532129e72e42facac134827375de692c76f59f124a57b0de0f37b44f4ec7
MD5 ab7361da5c622fcf9da133d89fec2448
BLAKE2b-256 e7215f814d24c8dfbf905d331be08b3d02bb3e96e801266ee4ca14de894256b0

See more details on using hashes here.

File details

Details for the file filehandler6027-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for filehandler6027-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5814a0cfbba916ad40ef31c417a19dfce94c2ffd06da057015c2f3cd6abb6503
MD5 d4fbc466a9b656f0b8e3ad7f27d40fbd
BLAKE2b-256 5a269aa2d0c559753f6cc595508bf1dfc76ba6cab116acf8254b512c9ee1f7f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page