Logging facility for reuse along projects.
Project description
darca-file-utils is a Python utility library providing robust, reusable helpers for file and directory manipulation. It includes safe wrappers for common operations like reading, writing, copying, moving, renaming, and deleting files and directories, with rich exception handling and structured logging using the darca framework.
Features
✅ File utilities: check, read, write, remove, rename, move, and copy
📁 Directory utilities: create, list, move, rename, remove, and copy
🚨 Structured error handling via DarcaException
🧪 100% test coverage with pytest, coverage, and parallel test execution
🧹 Integrated pre-commit hooks for consistent code quality
📦 Isolated virtual environment and Poetry setup
Installation
Clone the repository and install dependencies using the Makefile:
make install
This will set up Poetry in an isolated virtual environment at /tmp/darca-log-venv.
Quickstart
from darca_file_utils.file_utils import FileUtils
from darca_file_utils.directory_utils import DirectoryUtils
FileUtils.write_file("example.txt", "Hello world!")
print(FileUtils.read_file("example.txt"))
DirectoryUtils.create_directory("test_folder")
Running Tests
make test
Generates full coverage reports in terminal, HTML, and JSON.
Creates a coverage badge (coverage.svg) saved to docs/source/_static.
Check Everything
Run all checks before committing:
make check
This runs formatting, pre-commit, and tests in sequence.
Documentation
To build the Sphinx documentation locally:
make docs
Output is generated in docs/build/html.
Continuous Integration
GitHub Actions uses:
make ci
This target is optimized for CI/CD environments and runs pre-commit, tests, and docs builds.
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 darca_file_utils-0.1.1.tar.gz.
File metadata
- Download URL: darca_file_utils-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b24f4fa16cf824a2bc971dff2140cfdd475d204cc15f0c22d91692be0fcd7847
|
|
| MD5 |
26d72e2b7b9bd4c85f3cc2cb6a1727ab
|
|
| BLAKE2b-256 |
8bb7cc00730f74c2669ee66391689fb9fff5bdd2b13b10afb5dbfbaad4564781
|
Provenance
The following attestation bundles were made for darca_file_utils-0.1.1.tar.gz:
Publisher:
cd.yml on roelkist/darca-file-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
darca_file_utils-0.1.1.tar.gz -
Subject digest:
b24f4fa16cf824a2bc971dff2140cfdd475d204cc15f0c22d91692be0fcd7847 - Sigstore transparency entry: 226610667
- Sigstore integration time:
-
Permalink:
roelkist/darca-file-utils@9e550ac647577f3ed2b1156656db363094167ad4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/roelkist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@9e550ac647577f3ed2b1156656db363094167ad4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file darca_file_utils-0.1.1-py3-none-any.whl.
File metadata
- Download URL: darca_file_utils-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01e90dcc1cccb535402971ba5ddf8e56d7d0fc3e2efbbcd0742bc3b10fe1a5a
|
|
| MD5 |
b953370f54dba7986c76f8d53f905850
|
|
| BLAKE2b-256 |
1064bf8292e5ae7171db508cd4fbf7988831bad70c0c8356c268425b058e8424
|
Provenance
The following attestation bundles were made for darca_file_utils-0.1.1-py3-none-any.whl:
Publisher:
cd.yml on roelkist/darca-file-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
darca_file_utils-0.1.1-py3-none-any.whl -
Subject digest:
c01e90dcc1cccb535402971ba5ddf8e56d7d0fc3e2efbbcd0742bc3b10fe1a5a - Sigstore transparency entry: 226610678
- Sigstore integration time:
-
Permalink:
roelkist/darca-file-utils@9e550ac647577f3ed2b1156656db363094167ad4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/roelkist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@9e550ac647577f3ed2b1156656db363094167ad4 -
Trigger Event:
release
-
Statement type: