Skip to main content

Privacy-safe diagnostics, paths, and logging helpers for analytics projects.

Project description

Data Analytics Fundamentals: Toolkit

PyPI version Latest Release Docs License: MIT CI Deploy-Docs Check Links Dependabot

Privacy-safe diagnostics, paths, and logging helpers for analytics projects.

What This Provides

  • find_project_root() and safe_relpath_str() for robust, repo-relative paths
  • get_logger() for consistent console and file logging (using a standard logging API)
  • log_header() for a privacy-safe logging header (shows OS, shell, Python version, repo-relative cwd)

This toolkit is designed for reuse. It works the same locally and in GitHub Actions.

Install (Choose One)

uv add datafun-toolkit
pip install datafun-toolkit

Example

import logging
from pathlib import Path
from datafun_toolkit.logger import get_logger, log_header

LOG: logging.Logger = get_logger("P01", level="DEBUG")

ROOT_PATH: Path = Path.cwd()
DATA_PATH: Path = ROOT_PATH / "data"

def main() -> None:
    """Start the main logic."""
    log_header(LOG, "P01 Pipeline")

    LOG.info("START main()")
    LOG.info(f"ROOT_PATH = {ROOT_PATH}")
    LOG.info(f"DATA_PATH = {DATA_PATH}")
    LOG.info("Working....")

    LOG.info("END main()")


# === CONDITIONAL EXECUTION GUARD ===

if __name__ == "__main__":
    main()

Developer Setup

Install tools:

  • git
  • uv
  • VS Code

One-time setup:

uv self update
uv python pin 3.14
uv sync --extra dev --extra docs --upgrade

uvx pre-commit install
git add -A
uvx pre-commit run --all-files

Before starting work:

git pull

After working, run checks:

uv run ruff format .
uv run ruff check . --fix
uv run pytest --cov=src --cov-report=term-missing

uv run deptry .
uv run bandit -c pyproject.toml -r src
uv run validate-pyproject pyproject.toml

Build and serve docs:

uv run zensical build
uv run zensical serve

Hit CTRL+c in the VS Code terminal to quit serving.

Save progress frequently (some tools may make changes; you may need to re-run git add and commit to ensure everything gets committed before pushing):

git add -A
git commit -m "update"
git push -u origin main

Annotations

ANNOTATIONS.md

Citation

CITATION.cff

License

MIT

SE Manifest

SE_MANIFEST.md

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

datafun_toolkit-0.9.6.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

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

datafun_toolkit-0.9.6-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file datafun_toolkit-0.9.6.tar.gz.

File metadata

  • Download URL: datafun_toolkit-0.9.6.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datafun_toolkit-0.9.6.tar.gz
Algorithm Hash digest
SHA256 c8627c14ebfecee4d1b9ee1313fe551c5f725cc7fcdccbc31ba1a8b01be12520
MD5 fcacc818b4d9f09fc2b033a1e4d8cbf0
BLAKE2b-256 35ef58a2aa2b9c5a2d78a12f1a8034634e026a553d5ca08a006f6d5cd5eeaa6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for datafun_toolkit-0.9.6.tar.gz:

Publisher: release.yml on denisecase/datafun-toolkit

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

File details

Details for the file datafun_toolkit-0.9.6-py3-none-any.whl.

File metadata

File hashes

Hashes for datafun_toolkit-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c70a28dc8a83b8872682e2b0eadb6e305a0e5008e18f4ceb2d4e53d61034c69a
MD5 e022eb8afbcb5433b3d3f3df5eb421a9
BLAKE2b-256 22a173e722db4617ad30990946a516cbbe71ef0b028503365c7adb06e2aea220

See more details on using hashes here.

Provenance

The following attestation bundles were made for datafun_toolkit-0.9.6-py3-none-any.whl:

Publisher: release.yml on denisecase/datafun-toolkit

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