{"id":23922,"library":"jupyter-telemetry","title":"Jupyter Telemetry","description":"Library for emitting telemetry events from Jupyter applications. Provides a configurable event logging system with support for schemas and output sinks. Version 0.1.0 is the latest (stable). Development is relatively slow; no major releases since 2020.","status":"maintenance","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/jupyter/telemetry","tags":["jupyter","telemetry","event-logging","logging","traitlets"],"install":[{"cmd":"pip install jupyter-telemetry","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for configuration and event schema definitions","package":"traitlets","optional":false},{"reason":"Used for structured JSON logging output","package":"python-json-logger","optional":true},{"reason":"Validates event data against registered schemas","package":"jsonschema","optional":false}],"imports":[{"note":"Import directly from jupyter_telemetry. No common incorrect import identified.","wrong":"","symbol":"EventLog","correct":"from jupyter_telemetry import EventLog"},{"note":"If you need the emit function explicitly. Usually used via EventLog object.","wrong":"","symbol":"emit","correct":"from jupyter_telemetry.eventlog import emit"}],"quickstart":{"code":"from jupyter_telemetry import EventLog\n\n# Create an EventLog instance\nlog = EventLog()\n\n# Register a schema (using traitlets-based schema)\nfrom traitlets import Dict, Unicode\n\nclass MyEvent:\n    def __init__(self):\n        self.schema = {\n            'type': 'object',\n            'properties': {\n                'user': {'type': 'string'},\n                'action': {'type': 'string'},\n                'value': {'type': 'integer'}\n            },\n            'required': ['user', 'action', 'value']\n        }\n\nlog.register_event_schema('my_event', MyEvent().schema)\n\n# Emit an event\nlog.emit('my_event', {'user': 'alice', 'action': 'click', 'value': 42})\n\n# Events are logged via the configured output (default: logging.Logger to stderr)","lang":"python","description":"Basic usage: import EventLog, register a JSON schema, and emit events."},"warnings":[{"fix":"Ensure all event types are registered via log.register_event_schema before calling log.emit.","message":"Event schemas must be registered before emitting. If you emit an event for an unregistered schema, the library silently drops the event with no error.","severity":"gotcha","affected_versions":"<=0.1.0"},{"fix":"Configure logging to suppress or redirect: import logging; logging.getLogger('jupyter_telemetry').setLevel(logging.WARNING)","message":"The library uses logging under the hood. If you don't configure logging output, events are sent to stderr via a default logging handler. In environments like Jupyter Notebook, this can cause cluttered output.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3.7 or 3.8. For newer Python, consider patching or using an alternative.","message":"Python 3.5 and 3.6 are no longer supported upstream. The library's requires_python is >=3.5, but tests may fail on Python 3.9+ due to removed APIs (e.g., collections.abc vs collections).","severity":"deprecated","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from jupyter_telemetry import EventLog; or check installation: pip show jupyter-telemetry","cause":"Incorrect import path; attempting to import from the top-level namespace but the module might be missing or installed incorrectly.","error":"AttributeError: module 'jupyter_telemetry' has no attribute 'EventLog'"},{"fix":"Register the event schema before emitting: log.register_event_schema('my_event', schema)","cause":"Emitting an event with a schema name that hasn't been registered. The library silently ignores, but if you access the event log later, it may raise KeyError.","error":"KeyError: 'event'"},{"fix":"Set up logging: import logging; logging.basicConfig() or add a handler for 'jupyter_telemetry' logger.","cause":"Python's logging module emits this warning if no handlers are configured for the telemetry logger.","error":"No handlers could be found for logger \"jupyter_telemetry\""}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}