Skip to main content

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.

Author

Roel Kist

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

darca_file_utils-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

darca_file_utils-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for darca_file_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b24f4fa16cf824a2bc971dff2140cfdd475d204cc15f0c22d91692be0fcd7847
MD5 26d72e2b7b9bd4c85f3cc2cb6a1727ab
BLAKE2b-256 8bb7cc00730f74c2669ee66391689fb9fff5bdd2b13b10afb5dbfbaad4564781

See more details on using hashes here.

Provenance

The following attestation bundles were made for darca_file_utils-0.1.1.tar.gz:

Publisher: cd.yml on roelkist/darca-file-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file darca_file_utils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for darca_file_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c01e90dcc1cccb535402971ba5ddf8e56d7d0fc3e2efbbcd0742bc3b10fe1a5a
MD5 b953370f54dba7986c76f8d53f905850
BLAKE2b-256 1064bf8292e5ae7171db508cd4fbf7988831bad70c0c8356c268425b058e8424

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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