Registry / data / glean-parser

glean-parser

JSON →
library20.0.1pypypi✓ verified 86d ago

Parser tools for Mozilla's Glean telemetry system. Version 19.0.0, released on a monthly cadence. Used to translate YAML-based metric definitions into language-specific bindings (Swift, Kotlin, Python, etc.) and to perform linting and validation.

pip install glean-parser
INSTALL
IMPORT
SIG · GLEAN-PARSER
G
glean-parser
datapythonv20.0.1
Install
2.9s avg
Import
633ms
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v20.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.656s · 27MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.9s · import 0.610s · 28MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

translate
from glean_parser import translate
from glean_parser.util import translate
translate moved to top-level module in v5
validate_ping
from glean_parser import validate_ping
lint_glean
from glean_parser import lint_glean
from glean_parser.lint import glinter
lint_glean is the public API; glinter is internal and removed in v19

This example runs the translator on a single metrics.yaml file, outputting Kotlin bindings.

from glean_parser import translate # Validate and translate a metrics.yaml file to Kotlin translate.translate( input_filepaths=["metrics.yaml"], output_dir="./generated", option={"allow_reserved": False} )
glean_parser --version
Debug
Known issues
breakingIn v19, the `coverage` subcommand was removed entirely. If you relied on it, use external coverage tools.
fix
Remove any calls to `glean_parser coverage ...`. Check `glean_parser --help` for available commands.
affects: >=19.0.0
deprecatedThe `--option` flag for `translate` is being replaced by structured arguments. In future versions, `options` dict will be the only way.
fix
Pass options as a dict: `translate(..., option={"allow_reserved": False})` instead of CLI-style `--option allow_reserved=false`.
affects: >=18.0.0 <20.0.0
gotchaAlways use `allow_reserved=False` in production. Without it, reserved metric names may clash with Glean internals.
fix
Set `option={"allow_reserved": False}` when calling `translate`.
affects: all
gotchaEvent timestamp values in server templates changed in v19.0.0. Verify that your server-side ingestion expects the new format.
fix
Update server-side schema to match new timestamp handling. See PR #831.
affects: 19.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'glean_parser'
The package is not installed, or installed in a different environment.
fix
Run `pip install glean-parser`. Verify the environment with `python -m pip list | grep glean-parser`.
ImportError: cannot import name 'translate' from 'glean_parser.util'
The import path changed in v5. The function is now at `glean_parser.translate`.
fix
Use `from glean_parser import translate` instead.
glean_parser.cli.main: error: unrecognized arguments: --coverage
The `coverage` subcommand was removed in v19.
fix
Remove `coverage` usage. Use external testing coverage tools if needed.
glean_parser.lint.LinterError: metric 'my.metric' is reserved
The metric name conflicts with a reserved Glean identifier.
fix
Use `option={"allow_reserved": False}` to avoid this, or rename the metric. If intentional, pass `allow_reserved=True` (not recommended).
Upgrade
Version history
20.0.1latest on PyPI · released Jun 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
glean-parser — pip install glean-parser · libregistry