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.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 (hit CTRL+c in the VS Code terminal to quit serving):

uv run mkdocs build --strict
uv run mkdocs serve

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.5.tar.gz (71.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.5-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datafun_toolkit-0.9.5.tar.gz
  • Upload date:
  • Size: 71.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.5.tar.gz
Algorithm Hash digest
SHA256 7c1001abda89ed509d9c0d36664ffc1b8a4e5a861d5db168ba14dce7c4c5d65e
MD5 d9b40adb33a52e74daa2312f5c49c2b2
BLAKE2b-256 a383c0f878fc9bb53e12b6c8a1ab8483f7ec0aeeaa2f3cdec46b367f0f85215b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for datafun_toolkit-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 91c06a0a78aff7c002a66c10d095f9e2306ac992e88da39c5a41d54305cb4d10
MD5 a08530b64a3d3a0152818d13ac094812
BLAKE2b-256 92dc4faf4e2be9760fb1f24482bc7db40650fd888414224f4cf87ed5763f852e

See more details on using hashes here.

Provenance

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