Flexible and beginner-friendly Python package for safe and cross-platform file operations.
Project description
📦 FileHandler
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:
TraditionalandModern - 🧠 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filehandler6027-1.0.1.tar.gz.
File metadata
- Download URL: filehandler6027-1.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ef72ef187f98886ced375307d2f1a071a5f5c6041b51dcaac48a4e89c906702
|
|
| MD5 |
a71f49f977ee42dd15b569aeb4d306c3
|
|
| BLAKE2b-256 |
17f98eb77b1addabde2ff36ebfef17a993caa4a28828f0baa3b382d38385010b
|
File details
Details for the file filehandler6027-1.0.1-py3-none-any.whl.
File metadata
- Download URL: filehandler6027-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fbfcbef878b56878ce880f578c0b74a953de73abafb746e8a5bbb7375f17298
|
|
| MD5 |
cbe6eb43dd9073c940f7cac098f43e67
|
|
| BLAKE2b-256 |
c18a2b122fe6bea2708c30f16c352144dbc71efd1b08ee9251077acd1305f34c
|