{"id":10277,"library":"tabpfn-common-utils","title":"TabPFN Common Utilities","description":"TabPFN Common Utilities (tabpfn-common-utils) provides shared helper functions, primarily focusing on telemetry and logging, used across various TabPFN codebases. It is currently at version 0.2.19 and maintains a frequent release cadence, often with minor updates and bug fixes.","status":"active","version":"0.2.19","language":"python","source_language":"en","source_url":"https://github.com/priorlabs/tabpfn_common_utils","tags":["utility","telemetry","logging","tabpfn"],"install":[{"cmd":"pip install tabpfn-common-utils","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for telemetry functionality to send events.","package":"posthog","optional":false}],"imports":[{"wrong":"from tabpfn_common_utils import TelemetryClient","symbol":"annotations","correct":"from tabpfn_common_utils import annotations"}],"quickstart":{"code":"import os\nfrom tabpfn_common_utils.telemetry.client import TelemetryClient\nfrom tabpfn_common_utils.telemetry.logger import TabPFNLogger\n\n# Initialize TelemetryClient (API key can be passed directly or via POSTHOG_API_KEY env var)\n# For local testing, set POSTHOG_API_KEY in your environment, or pass a dummy string.\n# Data won't be sent if API key is invalid or not set in a production context.\ntelemetry_client = TelemetryClient(\n    api_key=os.environ.get('POSTHOG_API_KEY', 'phc_dummy_key_for_dev'),\n    project_group=\"quickstart\",\n    project_name=\"example\"\n)\n\n# Initialize TabPFNLogger\nlogger = TabPFNLogger(telemetry_client=telemetry_client)\n\n# Log a message\nlogger.info(\"Quickstart example executed.\")\n\n# Capture a custom event\ntelemetry_client.capture(\n    event_name=\"quickstart_event\",\n    properties={\n        \"data_point_count\": 100,\n        \"model_type\": \"test_model\"\n    }\n)\n\nprint(\"Telemetry client and logger initialized and events captured (if API key is valid).\")","lang":"python","description":"This quickstart demonstrates how to initialize the `TelemetryClient` and `TabPFNLogger`. The `TelemetryClient` is configured to use an environment variable for the PostHog API key, falling back to a dummy key for development. It then logs an informational message and captures a custom telemetry event."},"warnings":[{"fix":"Consult the source code or documentation for specific environment variables or constructor arguments to disable or configure telemetry. For instance, setting `POSTHOG_API_KEY` to an empty string might effectively disable it, or checking for an explicit 'disable' flag in future versions.","message":"Telemetry data is sent to PostHog by default. If you need to disable or control this for privacy or compliance, ensure you configure the `TelemetryClient` appropriately or set environment variables like `TABPFN_DISABLE_TELEMETRY`.","severity":"gotcha","affected_versions":"All versions with telemetry."},{"fix":"Ensure `POSTHOG_API_KEY` is set correctly in your environment, or pass the `api_key` explicitly when initializing `TelemetryClient`. Verify network access if events are still not reaching PostHog.","message":"The `TelemetryClient` relies on the `POSTHOG_API_KEY` environment variable or direct `api_key` argument for proper functioning. If not provided or incorrect, telemetry events may not be sent, or the client might fail silently.","severity":"gotcha","affected_versions":"All versions with `TelemetryClient`."},{"fix":"Upgrade to version `0.2.14` or newer to ensure correct timezone handling for telemetry events. If on older versions, ensure all timestamps are explicitly timezone-aware before passing them to the utility functions.","message":"Older versions (prior to v0.2.14) had an issue with timezone awareness for timestamps. This could lead to incorrect timestamps in telemetry data if not handled carefully.","severity":"breaking","affected_versions":"< 0.2.14"}],"env_vars":null,"search_vec":"'0.2.19':31 'across':22 'bug':43 'cadenc':37 'codebas':25 'common':2,5,9 'current':28 'fix':44 'focus':16 'frequent':35 'function':14 'helper':13 'log':20,47 'maintain':33 'minor':40 'often':38 'primarili':15 'provid':11 'releas':36 'share':12 'tabpfn':1,4,8,24,48 'tabpfn-common-util':7 'telemetri':18,46 'updat':41 'use':21 'util':3,6,10,45 'various':23 'version':30","created_at":"2026-04-17T01:23:17.673154+00:00","updated_at":"2026-04-17T01:23:17.673154+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.21","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/priorlabs/tabpfn_common_utils","docs":null,"changelog":null,"pypi":"https://pypi.org/project/tabpfn-common-utils/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}