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

from datafun_toolkit import find_project_root, get_logger, log_header, safe_relpath_str
from pathlib import Path

def main() -> None:
    logger = get_logger("example")
    log_header(logger, "example")

    root = find_project_root()
    logger.info(f"project_root={root.name}")
    logger.info(f"cwd={safe_relpath_str(Path.cwd(), root)}")

if __name__ == "__main__":
    main()

Developer Setup

Install tools:

  • git
  • uv
  • VS Code

One-time setup:

uv self update
uv python pin 3.12
uv sync --extra dev --extra docs --upgrade
uvx pre-commit install
uvx pre-commit run --all-files

Before starting work:

git pull

After working, run checks:

git add -A
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 mkdocs build --strict
uv run mkdocs serve

Save progress:

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.4.tar.gz (84.2 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.4-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datafun_toolkit-0.9.4.tar.gz
  • Upload date:
  • Size: 84.2 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.4.tar.gz
Algorithm Hash digest
SHA256 22baf26d93074005e205be112c79028adc6e87eabc50307a7ed8e9f836764781
MD5 ec984dc1701398957b7a22b4b7ed820f
BLAKE2b-256 730abce119ca3176159471fc99dd88fc525fcdaabfadf4a5e393ff28cc2a4582

See more details on using hashes here.

Provenance

The following attestation bundles were made for datafun_toolkit-0.9.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for datafun_toolkit-0.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ca754f718264e8ef1fa030ecf8f001ffed34b8eac467dbfbcf484f7612b0b4b
MD5 45eb6076df214e9fc755172bdd1b2e3e
BLAKE2b-256 b08c49656416bf8043985efa4720be9cba04e8754ff9d51ae09c60415db807aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for datafun_toolkit-0.9.4-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