Griffelib, pronounced "grif" (/ɡʁif/), is a Python library that provides core components for extracting signatures (structure, frame, skeleton) of entire Python programs. It is a fundamental part of the larger 'Griffe' project, which is used for generating API documentation (e.g., by mkdocstrings) and detecting breaking changes in an API. The library is currently at version 2.0.2 and follows a regular release cadence as part of the Griffe ecosystem.
pip install griffelibVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `griffelib` (specifically, components from the `griffe` package) to load a Python module from a file path, access its members, and extract signature and docstring information. It involves creating a dummy module, loading it with `GriffeLoader`, and then navigating the resulting `Module` object to inspect its contents.
Refer to the official Griffe documentation's changelog for version 2.0.0 and above. Update code to use the new `griffe.loader` module for loading and `griffe.dataclasses` for accessing code object representations.
Always check the specific import paths in the official 'Griffe' documentation (https://mkdocstrings.github.io/griffe/) for the functionality you intend to use. For core data structures and loading, generally use `from griffe.dataclasses import ...` and `from griffe.loader import ...`.
If you were previously using `griffe` as a dependency for library features, explicitly install `griffelib` and update your imports. Check the `griffe` GitHub repository for the exact commit that split the workspace to understand the implications for your specific use case.
Ensure your Python environment is version 3.10 or higher when installing `griffelib` versions 2.0.0 and above. If your project must remain on an older Python version, you will need to find a compatible older version of `griffelib` or `griffe` that supports your Python version, if one exists.
Inspect the `script.py` file, particularly the lines immediately preceding the docstring on line 9, for any missing colons, parentheses, or other syntax errors that would cause the interpreter to flag the subsequent docstring as invalid syntax. Ensure the test script is valid Python for the target environment. This `SyntaxError` is unlikely to be directly caused by `griffelib`.
No dependency data recorded yet.