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.0.tar.gz (3.1 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.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: filehandler6027-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 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.0.tar.gz
Algorithm Hash digest
SHA256 c33d689c79a786b9bb8fabb9485da9891ea3c84088d6ca6d82514862960797e0
MD5 f753a5576ed007323c3e9040cd7f5097
BLAKE2b-256 32b2522924f833f7581c5a54b46f2c2317129e038ece9022cf3087722ced4a0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for filehandler6027-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9042e1d1f6cffb2170c5afdb3b8faba203dbae5371b9ae8b929c19c7b072e1d0
MD5 5a6c991420375dfc607acf7c6361d551
BLAKE2b-256 fda7e96fffcc5e18fa7d097497ff8c085265af0731a6ed272a3d37f9fe1a6cee

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