Skip to content

Welcome¤

Griffe logo, created by François Rozet <francois.rozet@outlook.com>

Griffe, pronounced "grif" (/ɡʁif/), is a french word that means "claw", but also "signature" in a familiar way. "On reconnaît bien là sa griffe."

What is Griffe?¤

Griffe is a Python tool and library that gives you signatures for entire Python programs. It extracts the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.

Griffe can be used as a Python library. For example, the Python handler of mkdocstrings uses Griffe to collect API data and render API documentation in HTML. Griffe can also be used on the command-line, to load and serialize your API data to JSON, or find breaking changes in your API since the previous version of your library.

Serializing as JSON
$ griffe dump griffe -ssrc -r 2>/dev/null | head -n29
{
  "griffe": {
    "kind": "module",
    "name": "griffe",
    "docstring": {
      "value": "Griffe package.\n\nSignatures for entire Python programs.\nExtract the structure, the frame, the skeleton of your project,\nto generate API documentation or find breaking changes in your API.\n\nThe entirety of the public API is exposed here, in the top-level `griffe` module.\n\nAll messages written to standard output or error are logged using the `logging` module.\nOur logger's name is set to `\"griffe\"` and is public (you can rely on it).\nYou can obtain the logger from the standard `logging` module: `logging.getLogger(\"griffe\")`.\n\nIf you need to alter our logger, do so temporarily and restore it to its original state,\nfor example using [context managers][contextlib.contextmanager].\nActual logging messages are not part of the public API (they might change without notice).\n\nRaised exceptions throughout the package are part of the public API (you can rely on them).\nTheir actual messages are not part of the public API (they might change without notice).",
      "lineno": 5,
      "endlineno": 23
    },
    "labels": [],
    "members": [
      {
        "kind": "alias",
        "name": "annotations",
        "target_path": "__future__.annotations",
        "lineno": 25,
        "endlineno": 25
      },
      {
        "kind": "alias",
        "name": "Inspector",
        "target_path": "_griffe.agents.inspector.Inspector",
        "lineno": 27,
        "endlineno": 27
      },
      {
        "kind": "alias",
        "name": "inspect",
        "target_path": "_griffe.agents.inspector.inspect",
Checking for API breaking changes
$ griffe check griffe -ssrc -b0.46.0.1.2.0 -a0.45.0.1.2.0 --verbose
src/griffe/mixins.py:303: ObjectAliasMixin.is_exported:
Public object points to a different kind of object:
  Old: function
  New: attribute

src/griffe/mixins.py:353: ObjectAliasMixin.is_public:
Public object points to a different kind of object:
  Old: function
  New: attribute

src/griffe/dataclasses.py:520: Object.has_labels(labels):
Parameter kind was changed:
  Old: positional or keyword
  New: variadic positional

src/griffe/diff.py:571: find_breaking_changes(ignore_private):
Parameter default was changed:
  Old: True
  New: _sentinel

src/griffe/extensions/base.py:463: load_extensions(exts):
Parameter kind was changed:
  Old: positional or keyword
  New: variadic positional

src/griffe/dataclasses.py:1073: Alias.has_labels(labels):
Parameter kind was changed:
  Old: positional or keyword
  New: variadic positional

Playground Join our Gitter channel