Project architecture This document describes how the project is architectured, both regarding boilerplate and actual code. We start by giving an overview of the project's contents:
π .git/
π .github/ # (1)!
π .venv/ # (2)!
π .venvs/ # (3)!
π .vscode/ # (4)!
π .zed/ # (5)!
π config/ # (6)!
π docs/ # (7)!
π htmlcov/ # (8)!
π packages/ # (9)!
π scripts/ # (10)!
π site/ # (11)!
.copier-answers.yml # (12)!
.envrc # (13)!
.gitignore
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
Makefile # (14)!
README.md
duties.py # (15)!
logo.svg
mkdocs.yml # (16)!
pyproject.toml # (17)!
uv.lock
GitHub workflows, issue templates and other configuration.
π ISSUE_TEMPLATE/ # (1)!
π workflows/ # (2)!
FUNDING.yml
pull_request_template.md
1 -bug.md
2 -feature.md
3 -docs.md
4 -change.md
config.yml
ci.yml
release.yml
sponsors.yml
The default virtual environment (git-ignored). See make setup command.
The virtual environments for all supported Python versions (git-ignored). See make setup command.
The configuration for VSCode (git-ignored). See make vscode command.
configurationCache.log
dryrun.log
launch.json
settings.json
targets.log
tasks.json
Contains our tooling configuration. See Scripts, configuration .
π vscode/ # (1)!
coverage.ini
git-changelog.toml
pytest.ini
ruff.toml
ty.toml
launch.json
settings.json
tasks.json
Documentation sources (Markdown pages). See make docs task.
π .overrides/ # (1)!
π css/ # (2)!
π extensions/ # (3)!
π guide/ # (4)!
π img/ # (5)!
π js/ # (6)!
π reference/ # (7)!
alternatives.md
changelog.md
code-of-conduct.md
community.md
contributing.md
credits.md
downstream-projects.md
extensions.md
getting-help.md
getting-started.md
guide.md
index.md
installation.md
introduction.md
license.md
logo.svg
playground.md
reference.md
schema-docstrings-options.json
schema.json
Customization of Material for MkDocs ' templates.
π partials/ # (1)!
main.html
comments.html
path-item.html
custom.css
material.css
mkdocstrings.css
π built-in/ # (1)!
π official/ # (2)!
π third-party/ # (3)!
built-in.md
official.md
third-party.md
dataclasses.md
unpack-typeddict.md
autodocstringstyle.md
inherited-docstrings.md
public-redundant-aliases.md
public-wildcard-imports.md
pydantic.md
runtime-objects.md
sphinx.md
typingdoc.md
warnings-deprecated.md
docstring-inheritance.md
fastapi.md
fieldz.md
generics.md
inherited-method-crossrefs.md
modernized-annotations.md
π contributors/ # (1)!
π users/ # (2)!
contributors.md
users.md
architecture.md
commands.md
setup.md
workflow.md
π how-to/ # (1)!
π recommendations/ # (2)!
checking.md
extending.md
loading.md
navigating.md
serializing.md
parse-docstrings.md
selectively-inspect.md
set-docstring-styles.md
set-git-info.md
support-decorators.md
docstrings.md
public-apis.md
python-code.md
favicon.ico
gha_annotations_1.png
gha_annotations_2.png
π api/ # (1)!
api.md
cli.md
docstrings.md
Python API reference, injected with mkdocstrings .
π docstrings/ # (1)!
π models/ # (2)!
agents.md
checks.md
cli.md
docstrings.md
exceptions.md
expressions.md
extensions.md
finder.md
helpers.md
loaders.md
loggers.md
models.md
serializers.md
alias.md
attribute.md
class.md
function .md
module.md
type_alias.md
HTML report for Python code coverage (git-ignored), integrated in the Coverage report page. See make coverage task.
π griffecli/ # (1)!
π griffelib/ # (2)!
π src/ # (1)!
π tests/ # (2)!
pyproject.toml
π _internal/ # (1)!
__init__.py
__main__.py
py.typed
Our test suite. See Tests .
π src/ # (1)!
π tests/ # (2)!
pyproject.toml
π _internal/ # (1)!
__init__.py
__main__.py
py.typed
Our internal API, hidden from users. See Program structure .
π agents/ # (1)!
π docstrings/ # (2)!
π extensions/ # (3)!
__init__.py
c3linear.py
collections.py
debug.py
diff.py
encoders.py
enumerations.py
exceptions.py
expressions.py
finder.py
git.py
helpers.py
importer.py
loader.py
logger.py
merger.py
mixins.py
models.py
stats.py
π nodes/ # (1)!
__init__.py
inspector.py
visitor.py
__init__.py
assignments.py
ast.py
docstrings.py
exports.py
imports.py
parameters.py
runtime.py
values.py
__init__.py
auto.py
google.py
models.py
numpy.py
parsers.py
sphinx.py
utils.py
__init__.py
base.py
dataclasses.py
unpack_typeddict.py
Our test suite. See Tests .
π fixtures/
π test_docstrings/ # (1)!
π test_extensions/ # (2)!
__init__.py
conftest.py
helpers.py
test_api.py
test_diff.py
test_encoders.py
test_expressions.py
test_finder.py
test_functions.py
test_git.py
test_inheritance.py
test_inspector.py
test_loader.py
test_merger.py
test_mixins.py
test_models.py
test_nodes.py
test_public_api.py
test_stdlib.py
test_visitor.py
__init__.py
conftest.py
helpers.py
test_google.py
test_numpy.py
test_sphinx.py
test_warnings.py
__init__.py
test_base.py
test_dataclasses.py
test_unpack_typeddict.py
Our different scripts. See Scripts, configuration .
gen_credits.py
gen_griffe_json.py
gen_structure_docs.py
get_version.py
make
make.py
Documentation site, built with make run mkdocs build (git-ignored).
The answers file generated by Copier . See Boilerplate .
The environment configuration, automatically sourced by direnv . See commands .
A dummy makefile, only there for auto-completion. See commands .
Our project tasks, written with duty . See Tasks .
The build configuration for our docs. See make docs task.
The project metadata and production dependencies.
Boilerplate This project's skeleton (the file-tree shown above) is actually generated from a Copier template called copier-uv . When generating the project, Copier asks a series of questions (configured by the template itself), and the answers are used to render the file and directory names, as well as the file contents. Copier also records answers in the .copier-answers.yml file, allowing to update the project with latest changes from the template while reusing previous answers.
To update the project (in order to apply latest changes from the template), we use the following command:
copier update --trust --skip-answered
Scripts, configuration We have a few scripts that let us manage the various maintenance aspects for this project. The entry-point is the make script located in the scripts folder. It doesn't need any dependency to be installed to run. See Management commands for more information.
The make script can also invoke what we call "tasks ". Tasks need our development dependencies to be installed to run. These tasks are written in the duties.py file, and the development dependencies are listed in devdeps.txt.
The tools used in tasks have their configuration files stored in the config folder, to unclutter the root of the repository. The tasks take care of calling the tools with the right options to locate their respective configuration files.
Sources Sources are located in the packages/ subfolders, following the src-layout . We use Hatch to build source and wheel distributions, and configure it in pyproject.toml.
Tests Our test suite is located in the tests folder. It is located outside of the sources as to not pollute distributions (it would be very wrong to publish a tests package as part of our distributions, since this name is extremely common), or worse, the public API. The tests folder is however included in our source distributions (.tar.gz), alongside most of our metadata and configuration files. Check out our pyproject.toml files to get the full list of files included in our source distributions for every individual package within the packages/ folder.
The test suite is based on pytest . Test modules reflect our internal API structure, and except for a few test modules that test specific aspects of our API, each test module tests the logic from the corresponding module in the internal API. For example, test_finder.py tests code of the griffe._internal.finder internal module, while test_functions tests our ability to extract correct information from function signatures, statically. The general rule of thumb when writing new tests is to mirror the internal API. If a test touches to many aspects of the loading process, it can be added to the test_loader test module.
Program structure Griffe is split into two pieces: the library and the CLI.
Each of them has an internal API contained within an _internal folder:
packages/griffelib/src/griffe/_internal for the library, packages/griffecli/src/griffecli/_internal for the CLI. Griffe can be installed in library-only mode, which means that the CLI package from packages/griffecli is not present. Library-only mode can be preferred if the user does not utilize the CLI functionality of Griffe and does not want to incorporate its dependencies.
The top-level packages/griffelib/src/griffe/__init__.py module exposes all the public API available: it always re-exports internal objects from various submodules of griffe._internal and, if the CLI is installed, it re-exports the public API of griffecli as well.
Users then import griffe directly, or import objects from it. If they don't have griffecli installed, they cannot import the CLI-related functionality, such as griffecli.check .
We'll be honest: our code organization is not the most elegant, but it works Have a look at the following module dependency graph, which will basically tell you nothing except that we have a lot of inter-module dependencies. Arrows read as "imports from". The code base is generally pleasant to work with though.
G griffe griffe griffe__internal griffe. _internal griffe->griffe__internal griffe__internal_agents griffe. _internal. agents griffe->griffe__internal_agents griffe__internal_agents_inspector griffe. _internal. agents. inspector griffe->griffe__internal_agents_inspector griffe__internal_agents_nodes griffe. _internal. agents. nodes griffe->griffe__internal_agents_nodes griffe__internal_agents_nodes_assignments griffe. _internal. agents. nodes. assignments griffe->griffe__internal_agents_nodes_assignments griffe__internal_agents_nodes_ast griffe. _internal. agents. nodes. ast griffe->griffe__internal_agents_nodes_ast griffe__internal_agents_nodes_docstrings griffe. _internal. agents. nodes. docstrings griffe->griffe__internal_agents_nodes_docstrings griffe__internal_agents_nodes_exports griffe. _internal. agents. nodes. exports griffe->griffe__internal_agents_nodes_exports griffe__internal_agents_nodes_imports griffe. _internal. agents. nodes. imports griffe->griffe__internal_agents_nodes_imports griffe__internal_agents_nodes_parameters griffe. _internal. agents. nodes. parameters griffe->griffe__internal_agents_nodes_parameters griffe__internal_agents_nodes_runtime griffe. _internal. agents. nodes. runtime griffe->griffe__internal_agents_nodes_runtime griffe__internal_agents_nodes_values griffe. _internal. agents. nodes. values griffe->griffe__internal_agents_nodes_values griffe__internal_agents_visitor griffe. _internal. agents. visitor griffe->griffe__internal_agents_visitor griffe__internal_c3linear griffe. _internal. c3linear griffe->griffe__internal_c3linear griffe__internal_collections griffe. _internal. collections griffe->griffe__internal_collections griffe__internal_diff griffe. _internal. diff griffe->griffe__internal_diff griffe__internal_docstrings griffe. _internal. docstrings griffe->griffe__internal_docstrings griffe__internal_docstrings_auto griffe. _internal. docstrings. auto griffe->griffe__internal_docstrings_auto griffe__internal_docstrings_google griffe. _internal. docstrings. google griffe->griffe__internal_docstrings_google griffe__internal_docstrings_models griffe. _internal. docstrings. models griffe->griffe__internal_docstrings_models griffe__internal_docstrings_numpy griffe. _internal. docstrings. numpy griffe->griffe__internal_docstrings_numpy griffe__internal_docstrings_parsers griffe. _internal. docstrings. parsers griffe->griffe__internal_docstrings_parsers griffe__internal_docstrings_sphinx griffe. _internal. docstrings. sphinx griffe->griffe__internal_docstrings_sphinx griffe__internal_docstrings_utils griffe. _internal. docstrings. utils griffe->griffe__internal_docstrings_utils griffe__internal_encoders griffe. _internal. encoders griffe->griffe__internal_encoders griffe__internal_enumerations griffe. _internal. enumerations griffe->griffe__internal_enumerations griffe__internal_exceptions griffe. _internal. exceptions griffe->griffe__internal_exceptions griffe__internal_expressions griffe. _internal. expressions griffe->griffe__internal_expressions griffe__internal_extensions griffe. _internal. extensions griffe->griffe__internal_extensions griffe__internal_extensions_base griffe. _internal. extensions. base griffe->griffe__internal_extensions_base griffe__internal_extensions_dataclasses griffe. _internal. extensions. dataclasses griffe->griffe__internal_extensions_dataclasses griffe__internal_extensions_unpack_typeddict griffe. _internal. extensions. unpack_typeddict griffe->griffe__internal_extensions_unpack_typeddict griffe__internal_finder griffe. _internal. finder griffe->griffe__internal_finder griffe__internal_git griffe. _internal. git griffe->griffe__internal_git griffe__internal_helpers griffe. _internal. helpers griffe->griffe__internal_helpers griffe__internal_importer griffe. _internal. importer griffe->griffe__internal_importer griffe__internal_loader griffe. _internal. loader griffe->griffe__internal_loader griffe__internal_logger griffe. _internal. logger griffe->griffe__internal_logger griffe__internal_merger griffe. _internal. merger griffe->griffe__internal_merger griffe__internal_mixins griffe. _internal. mixins griffe->griffe__internal_mixins griffe__internal_models griffe. _internal. models griffe->griffe__internal_models griffe__internal_stats griffe. _internal. stats griffe->griffe__internal_stats griffecli griffecli griffe->griffecli griffe___main__ griffe. __main__ griffe___main__->griffecli griffe__internal_agents_inspector->griffe__internal_agents_nodes griffe__internal_agents_inspector->griffe__internal_agents_nodes_runtime griffe__internal_agents_inspector->griffe__internal_collections griffe__internal_agents_inspector->griffe__internal_docstrings griffe__internal_agents_inspector->griffe__internal_docstrings_parsers griffe__internal_agents_inspector->griffe__internal_enumerations griffe__internal_agents_inspector->griffe__internal_expressions griffe__internal_agents_inspector->griffe__internal_extensions griffe__internal_agents_inspector->griffe__internal_extensions_base griffe__internal_agents_inspector->griffe__internal_importer griffe__internal_agents_inspector->griffe__internal_logger griffe__internal_agents_inspector->griffe__internal_models typing_extensions typing_extensions griffe__internal_agents_inspector->typing_extensions griffe__internal_agents_nodes_ast->griffe__internal_exceptions griffe__internal_agents_nodes_exports->griffe__internal_agents_nodes_values griffe__internal_agents_nodes_exports->griffe__internal_enumerations griffe__internal_agents_nodes_exports->griffe__internal_expressions griffe__internal_agents_nodes_exports->griffe__internal_logger griffe__internal_agents_nodes_exports->griffe__internal_models griffe__internal_agents_nodes_imports->griffe__internal_models griffe__internal_agents_nodes_parameters->griffe__internal_enumerations griffe__internal_agents_nodes_runtime->griffe__internal_enumerations griffe__internal_agents_nodes_runtime->griffe__internal_logger griffe__internal_agents_nodes_runtime->typing_extensions griffe__internal_agents_nodes_values->griffe__internal_logger griffe__internal_agents_visitor->griffe__internal_agents_nodes griffe__internal_agents_visitor->griffe__internal_agents_nodes_assignments griffe__internal_agents_visitor->griffe__internal_agents_nodes_ast griffe__internal_agents_visitor->griffe__internal_agents_nodes_docstrings griffe__internal_agents_visitor->griffe__internal_agents_nodes_exports griffe__internal_agents_visitor->griffe__internal_agents_nodes_imports griffe__internal_agents_visitor->griffe__internal_agents_nodes_parameters griffe__internal_agents_visitor->griffe__internal_collections griffe__internal_agents_visitor->griffe__internal_docstrings griffe__internal_agents_visitor->griffe__internal_docstrings_parsers griffe__internal_agents_visitor->griffe__internal_enumerations griffe__internal_agents_visitor->griffe__internal_exceptions griffe__internal_agents_visitor->griffe__internal_expressions griffe__internal_agents_visitor->griffe__internal_extensions griffe__internal_agents_visitor->griffe__internal_models griffe__internal_collections->griffe__internal_mixins griffe__internal_collections->griffe__internal_models griffe__internal_diff->griffe__internal_enumerations griffe__internal_diff->griffe__internal_exceptions griffe__internal_diff->griffe__internal_git griffe__internal_diff->griffe__internal_logger griffe__internal_diff->griffe__internal_models griffe__internal_docstrings_auto->griffe__internal_docstrings_google griffe__internal_docstrings_auto->griffe__internal_docstrings_models griffe__internal_docstrings_auto->griffe__internal_docstrings_numpy griffe__internal_docstrings_auto->griffe__internal_docstrings_sphinx griffe__internal_docstrings_auto->griffe__internal_enumerations griffe__internal_docstrings_auto->griffe__internal_models griffe__internal_docstrings_google->griffe__internal_docstrings_models griffe__internal_docstrings_google->griffe__internal_docstrings_utils griffe__internal_docstrings_google->griffe__internal_enumerations griffe__internal_docstrings_google->griffe__internal_expressions griffe__internal_docstrings_google->griffe__internal_models griffe__internal_docstrings_models->griffe__internal_enumerations griffe__internal_docstrings_models->griffe__internal_expressions griffe__internal_docstrings_numpy->griffe__internal_docstrings_models griffe__internal_docstrings_numpy->griffe__internal_docstrings_utils griffe__internal_docstrings_numpy->griffe__internal_enumerations griffe__internal_docstrings_numpy->griffe__internal_expressions griffe__internal_docstrings_numpy->griffe__internal_models griffe__internal_docstrings_parsers->griffe__internal_docstrings_auto griffe__internal_docstrings_parsers->griffe__internal_docstrings_google griffe__internal_docstrings_parsers->griffe__internal_docstrings_models griffe__internal_docstrings_parsers->griffe__internal_docstrings_numpy griffe__internal_docstrings_parsers->griffe__internal_docstrings_sphinx griffe__internal_docstrings_parsers->griffe__internal_enumerations griffe__internal_docstrings_sphinx->griffe__internal_docstrings_models griffe__internal_docstrings_sphinx->griffe__internal_docstrings_utils griffe__internal_docstrings_sphinx->griffe__internal_expressions griffe__internal_docstrings_sphinx->griffe__internal_models griffe__internal_docstrings_utils->griffe__internal_enumerations griffe__internal_docstrings_utils->griffe__internal_exceptions griffe__internal_docstrings_utils->griffe__internal_expressions griffe__internal_docstrings_utils->griffe__internal_logger griffe__internal_docstrings_utils->griffe__internal_models griffe__internal_encoders->griffe__internal_enumerations griffe__internal_encoders->griffe__internal_expressions griffe__internal_encoders->griffe__internal_git griffe__internal_encoders->griffe__internal_models griffe__internal_exceptions->griffe__internal_models griffe__internal_expressions->griffe__internal_agents griffe__internal_expressions->griffe__internal_agents_nodes griffe__internal_expressions->griffe__internal_agents_nodes_parameters griffe__internal_expressions->griffe__internal_enumerations griffe__internal_expressions->griffe__internal_exceptions griffe__internal_expressions->griffe__internal_logger griffe__internal_expressions->griffe__internal_models griffe__internal_extensions_base->griffe__internal_agents griffe__internal_extensions_base->griffe__internal_agents_nodes griffe__internal_extensions_base->griffe__internal_agents_nodes_ast griffe__internal_extensions_base->griffe__internal_agents_nodes_runtime griffe__internal_extensions_base->griffe__internal_agents_visitor griffe__internal_extensions_base->griffe__internal_exceptions griffe__internal_extensions_base->griffe__internal_extensions_dataclasses griffe__internal_extensions_base->griffe__internal_importer griffe__internal_extensions_base->griffe__internal_loader griffe__internal_extensions_base->griffe__internal_models griffe__internal_extensions_dataclasses->griffe__internal_enumerations griffe__internal_extensions_dataclasses->griffe__internal_expressions griffe__internal_extensions_dataclasses->griffe__internal_logger griffe__internal_extensions_dataclasses->griffe__internal_models griffe__internal_extensions_unpack_typeddict->griffe__internal_docstrings griffe__internal_extensions_unpack_typeddict->griffe__internal_docstrings_models griffe__internal_extensions_unpack_typeddict->griffe__internal_enumerations griffe__internal_extensions_unpack_typeddict->griffe__internal_expressions griffe__internal_extensions_unpack_typeddict->griffe__internal_extensions_base griffe__internal_extensions_unpack_typeddict->griffe__internal_models griffe__internal_finder->griffe__internal_exceptions griffe__internal_finder->griffe__internal_logger griffe__internal_finder->griffe__internal_models griffe__internal_git->griffe__internal_exceptions griffe__internal_helpers->griffe__internal_agents griffe__internal_helpers->griffe__internal_agents_inspector griffe__internal_helpers->griffe__internal_agents_visitor griffe__internal_helpers->griffe__internal_collections griffe__internal_helpers->griffe__internal_docstrings griffe__internal_helpers->griffe__internal_docstrings_parsers griffe__internal_helpers->griffe__internal_enumerations griffe__internal_helpers->griffe__internal_extensions griffe__internal_helpers->griffe__internal_extensions_base griffe__internal_helpers->griffe__internal_loader griffe__internal_helpers->griffe__internal_models griffe__internal_loader->griffe__internal_agents griffe__internal_loader->griffe__internal_agents_inspector griffe__internal_loader->griffe__internal_agents_visitor griffe__internal_loader->griffe__internal_collections griffe__internal_loader->griffe__internal_docstrings griffe__internal_loader->griffe__internal_docstrings_parsers griffe__internal_loader->griffe__internal_enumerations griffe__internal_loader->griffe__internal_exceptions griffe__internal_loader->griffe__internal_expressions griffe__internal_loader->griffe__internal_extensions griffe__internal_loader->griffe__internal_finder griffe__internal_loader->griffe__internal_git griffe__internal_loader->griffe__internal_importer griffe__internal_loader->griffe__internal_logger griffe__internal_loader->griffe__internal_merger griffe__internal_loader->griffe__internal_models griffe__internal_loader->griffe__internal_stats platformdirs platformdirs griffe__internal_loader->platformdirs griffe__internal_merger->griffe__internal_exceptions griffe__internal_merger->griffe__internal_expressions griffe__internal_merger->griffe__internal_logger griffe__internal_merger->griffe__internal_models griffe__internal_mixins->griffe__internal_encoders griffe__internal_mixins->griffe__internal_enumerations griffe__internal_mixins->griffe__internal_exceptions griffe__internal_mixins->griffe__internal_merger griffe__internal_mixins->griffe__internal_models griffe__internal_models->griffe__internal_c3linear griffe__internal_models->griffe__internal_docstrings griffe__internal_models->griffe__internal_docstrings_models griffe__internal_models->griffe__internal_docstrings_parsers griffe__internal_models->griffe__internal_enumerations griffe__internal_models->griffe__internal_git griffe__internal_models->griffe__internal_logger griffe__internal_stats->griffe__internal_enumerations griffe__internal_stats->griffe__internal_models You can zoom and pan all diagrams on this page with mouse inputs.
The following sections are generated automatically by iterating on the modules of our public and internal APIs respectively, and extracting the comment blocks at the top of each module. The comment blocks are addressed to readers of the code (maintainers, contributors), while module docstrings are addressed to users of the API. Module docstrings in our internal API are never written, because our module layout is hidden, and therefore modules aren't part of the public API, so it doesn't make much sense to write "user documentation" in them.
CLI entrypoint
griffe.__main__ Public API
griffe This top-level module imports all public names from the package, and exposes them as public objects. We have tests to make sure no object is forgotten in this list.
Internal API
The internal API layout doesn't follow any particular paradigm: we simply organize code in different modules, depending on what the code is used for.
agents These modules contain the different agents that are able to extract data.
inspector.py This module contains our dynamic analysis agent, capable of inspecting modules and objects in memory, at runtime.
G cluster_0c998eba File: inspector cluster_811aa97a Class: Inspector node_f3234669 122: __init__() node_f3234669->node_f3234669 node_9f59a76e 174: _get_docstring() node_9003f28d 196: _get_linenos() node_f8fc8b4c 262: generic_inspect() node_f8fc8b4c->node_f3234669 node_97af70d3 254: inspect() node_f8fc8b4c->node_97af70d3 node_c8f0dee9 299: inspect_module() node_f8fc8b4c->node_c8f0dee9 node_bd879be5 206: get_module() node_bd879be5->node_97af70d3 node_b6509d87 543: handle_attribute() node_b6509d87->node_9f59a76e node_3d202dbf 444: handle_function() node_3d202dbf->node_9f59a76e node_3d202dbf->node_9003f28d node_45f795c6 624: _convert_object_to_annotation() node_3d202dbf->node_45f795c6 node_10ea96ce 601: _convert_parameter() node_3d202dbf->node_10ea96ce node_70fb1bf5 660: _convert_type_parameters() node_3d202dbf->node_70fb1bf5 node_c244844f 535: inspect_attribute() node_c244844f->node_b6509d87 node_76a6ac3b 404: inspect_builtin_function() node_76a6ac3b->node_3d202dbf node_41fd31b5 380: inspect_builtin_method() node_41fd31b5->node_3d202dbf node_4fdee819 420: inspect_cached_property() node_4fdee819->node_3d202dbf node_5cf70fab 322: inspect_class() node_5cf70fab->node_9f59a76e node_5cf70fab->node_9003f28d node_5cf70fab->node_f8fc8b4c node_5cf70fab->node_70fb1bf5 node_899c2e2d 364: inspect_classmethod() node_899c2e2d->node_3d202dbf node_90b61057 396: inspect_coroutine() node_90b61057->node_3d202dbf node_07082f21 412: inspect_function() node_07082f21->node_3d202dbf node_c4932dd8 436: inspect_getset_descriptor() node_c4932dd8->node_3d202dbf node_3349c917 388: inspect_method() node_3349c917->node_3d202dbf node_776a5d77 372: inspect_method_descriptor() node_776a5d77->node_3d202dbf node_c8f0dee9->node_9f59a76e node_967c44ed 428: inspect_property() node_967c44ed->node_3d202dbf node_10e174f0 356: inspect_staticmethod() node_10e174f0->node_3d202dbf node_9a4fe27f 510: inspect_type_alias() node_9a4fe27f->node_9f59a76e node_9a4fe27f->node_9003f28d node_9a4fe27f->node_70fb1bf5 node_c68fa4c1 703: _convert_type_to_annotation() node_9a4fe27f->node_c68fa4c1 node_10ea96ce->node_45f795c6 node_70fb1bf5->node_c68fa4c1 node_c68fa4c1->node_45f795c6 node_c68fa4c1->node_c68fa4c1 node_ada1fa47 54: inspect() node_ada1fa47->node_f3234669 node_ada1fa47->node_bd879be5 nodes These submodules contain utilities for working with AST and object nodes.
assignments.py This module contains utilities for extracting information from assignment nodes.
G cluster_4e81fe38 File: assignments node_c792899a 43: _get_annassign_names() node_a8fdecc5 26: get_name() node_c792899a->node_a8fdecc5 node_4840bc02 38: _get_assign_names() node_4840bc02->node_a8fdecc5 node_dc4baa1b 12: _get_attribute_name() node_dc4baa1b->node_a8fdecc5 node_c575cda9 66: get_instance_names() node_81ab0e71 54: get_names() node_c575cda9->node_81ab0e71 ast.py This module contains utilities for navigating AST nodes.
G cluster_7c996598 File: ast node_2650f17f 26: ast_children() node_8de72554 137: ast_first_child() node_8de72554->node_2650f17f node_9f99759f 155: ast_last_child() node_9f99759f->node_2650f17f node_b1a3c5b3 119: ast_next() node_8c19c50d 66: ast_next_siblings() node_b1a3c5b3->node_8c19c50d node_8c19c50d->node_2650f17f node_7abd83f6 100: ast_previous() node_d18c21e1 50: ast_previous_siblings() node_7abd83f6->node_d18c21e1 node_d18c21e1->node_2650f17f node_05e0cb12 82: ast_siblings() node_05e0cb12->node_2650f17f docstrings.py This module contains utilities for extracting docstrings from nodes.
exports.py This module contains utilities for extracting exports from __all__ assignments.
G cluster_5fb708a6 File: exports node_f54b8eba 61: _extract() node_1c3e2136 20: _extract_attribute() node_1c3e2136->node_f54b8eba node_b3f7c4b0 24: _extract_binop() node_b3f7c4b0->node_f54b8eba node_3eaee5b8 38: _extract_sequence() node_3eaee5b8->node_f54b8eba node_9392192b 45: _extract_starred() node_9392192b->node_f54b8eba node_853444d5 65: get__all__() node_853444d5->node_f54b8eba node_9ade86c0 80: safe_get__all__() node_9ade86c0->node_853444d5 imports.py This module contains utilities for working with imports and relative imports.
parameters.py This module contains utilities for extracting information from parameter nodes.
runtime.py This module contains utilities for extracting information from runtime objects.
G cluster_a1723ecb File: runtime cluster_d86b5f5d Class: ObjectNode node_d68a447d 52: __init__() node_6afd38d9 285: _pick_member() node_8d292c54 295: alias_target_path() node_fc4cdc90 36: _same_components() node_8d292c54->node_fc4cdc90 node_8c463d7f 175: children() node_8c463d7f->node_d68a447d node_8c463d7f->node_6afd38d9 values.py This module contains utilities for extracting attribute values.
G cluster_104a6285 File: values node_192b3937 15: get_value() node_cd67fcc3 29: safe_get_value() node_cd67fcc3->node_192b3937 visitor.py This module contains our static analysis agent, capable of parsing and visiting sources, statically.
G cluster_9ed0373f File: visitor cluster_e5dcef40 Class: Visitor node_dfc51022 137: __init__() node_dfc51022->node_dfc51022 node_b8784d3b 197: _get_docstring() node_1b74b97c 217: _get_type_parameters() node_24120ccd 353: decorators_to_labels() node_e644686e 268: generic_visit() node_7d82aaa9 260: visit() node_e644686e->node_7d82aaa9 node_9ba7b4f1 371: get_base_property() node_4fd7538f 246: get_module() node_4fd7538f->node_7d82aaa9 node_ed2687b5 613: handle_attribute() node_ed2687b5->node_b8784d3b node_d5d24219 395: handle_function() node_d5d24219->node_b8784d3b node_d5d24219->node_1b74b97c node_d5d24219->node_24120ccd node_d5d24219->node_e644686e node_d5d24219->node_9ba7b4f1 node_ffcc92b1 728: visit_annassign() node_ffcc92b1->node_ed2687b5 node_ca885a22 720: visit_assign() node_ca885a22->node_ed2687b5 node_60d3b33c 509: visit_asyncfunctiondef() node_60d3b33c->node_d5d24219 node_ec98ebea 300: visit_classdef() node_ec98ebea->node_b8784d3b node_ec98ebea->node_1b74b97c node_ec98ebea->node_24120ccd node_ec98ebea->node_e644686e node_d645564e 501: visit_functiondef() node_d645564e->node_d5d24219 node_d0e9962a 757: visit_if() node_d0e9962a->node_e644686e node_52b94155 277: visit_module() node_52b94155->node_b8784d3b node_52b94155->node_e644686e node_47b8d17c 520: visit_typealias() node_47b8d17c->node_b8784d3b node_47b8d17c->node_1b74b97c node_00e63d99 80: visit() node_00e63d99->node_dfc51022 node_00e63d99->node_4fd7538f c3linear.py This module contains a single function, c3linear_merge. The function is generic enough to be in its own module.
G cluster_7544cd92 File: c3linear cluster_2bab79bd Class: _Dependency cluster_124e5801 Class: _DependencyList node_d8952af8 29: tail() node_b90048d6 60: __len__() node_d8952af8->node_b90048d6 node_f91d56a2 48: __init__() node_b323ab56 64: __repr__() node_b323ab56->node_b323ab56 node_5217d38d 82: remove() node_949cf788 93: c3linear_merge() node_949cf788->node_f91d56a2 node_949cf788->node_5217d38d collections.py This module contains collection-related classes, which are used throughout the API.
G cluster_b6308919 File: collections cluster_96415bce Class: LinesCollection node_aeb97250 56: items() node_aeb97250->node_aeb97250 node_8e6fe5b4 40: keys() node_8e6fe5b4->node_8e6fe5b4 node_451dfbcf 48: values() node_451dfbcf->node_451dfbcf debug.py This module is here to help users report bugs. It provides a function to print environment information, which is called from the public griffe.debug module (when called with python -m griffe.debug) or thanks to the --debug-info CLI flag.
G cluster_c2188cff File: debug node_8dcb59c5 80: _get_debug_info() node_8278f2e0 65: _get_version() node_8dcb59c5->node_8278f2e0 node_bc582cbb 54: _interpreter_name_version() node_8dcb59c5->node_bc582cbb node_0a682ac6 99: _print_debug_info() node_0a682ac6->node_8dcb59c5 diff.py This module exports "breaking changes" related utilities. The logic here is to iterate on objects and their members recursively, to yield found breaking changes.
The breakage class definitions might sound a bit verbose, but declaring them this way helps with (de)serialization, which we don't use yet, but could use in the future.
G cluster_47b899aa File: diff cluster_1d37a420 Class: Breakage node_37617cbb 283: _explain_azdo() node_3c15150b 204: _format_new_value() node_37617cbb->node_3c15150b node_0d4282b0 201: _format_old_value() node_37617cbb->node_0d4282b0 node_9d8ef041 193: _format_title() node_37617cbb->node_9d8ef041 node_26b0c274 261: _explain_github() node_26b0c274->node_3c15150b node_26b0c274->node_0d4282b0 node_26b0c274->node_9d8ef041 node_22792600 241: _explain_markdown() node_22792600->node_3c15150b node_22792600->node_0d4282b0 node_c07d3295 207: _explain_oneline() node_55e5fd12 196: _format_kind() node_c07d3295->node_55e5fd12 node_24717916 188: _format_location() node_c07d3295->node_24717916 node_c07d3295->node_3c15150b node_c07d3295->node_0d4282b0 node_c07d3295->node_9d8ef041 node_ac1ffdb7 223: _explain_verbose() node_ac1ffdb7->node_55e5fd12 node_ac1ffdb7->node_24717916 node_ac1ffdb7->node_3c15150b node_ac1ffdb7->node_0d4282b0 node_ac1ffdb7->node_9d8ef041 node_80d68b60 584: _alias_incompatibilities() node_f93df865 621: _type_based_yield() node_80d68b60->node_f93df865 node_6bc2e2e6 575: _attribute_incompatibilities() node_ab5b5e73 487: _class_incompatibilities() node_fc75e8cf 600: _member_incompatibilities() node_ab5b5e73->node_fc75e8cf node_2ffef146 500: _function_incompatibilities() node_91414910 658: _returns_are_compatible() node_2ffef146->node_91414910 node_fc75e8cf->node_f93df865 node_f93df865->node_6bc2e2e6 node_f93df865->node_ab5b5e73 node_f93df865->node_2ffef146 node_63dbe6d9 682: find_breaking_changes() node_63dbe6d9->node_fc75e8cf docstrings These submodules define models and parsers for docstrings.
auto.py This module defines functions to parse docstrings by guessing their style.
G cluster_b2fc7ac4 File: auto node_0b610801 116: infer_docstring_style() node_319d20c5 188: parse_auto() node_319d20c5->node_0b610801 google.py This module defines functions to parse Google-style docstrings into structured data.
G cluster_4bdaf206 File: google node_82085d8e 618: _annotation_from_parent() node_deda226a 587: _get_name_annotation_description() node_7a15510f 834: _is_empty_line() node_cf2222af 346: _read_attributes_section() node_d0828271 92: _read_block_items() node_cf2222af->node_d0828271 node_c6bd90f1 156: _read_block() node_c6bd90f1->node_7a15510f node_d0828271->node_7a15510f node_4b3bf13b 574: _read_block_items_maybe() node_4b3bf13b->node_c6bd90f1 node_4b3bf13b->node_d0828271 node_3f0011dd 425: _read_classes_section() node_3f0011dd->node_d0828271 node_ec69451a 775: _read_examples_section() node_ec69451a->node_7a15510f node_ec69451a->node_c6bd90f1 node_aea2f639 388: _read_functions_section() node_aea2f639->node_d0828271 node_d7aff482 487: _read_modules_section() node_d7aff482->node_d0828271 node_d2d93c87 266: _read_other_parameters_section() node_5d3ead73 187: _read_parameters() node_d2d93c87->node_5d3ead73 node_5d3ead73->node_d0828271 node_72e3ada3 256: _read_parameters_section() node_72e3ada3->node_5d3ead73 node_a8626997 515: _read_raises_section() node_a8626997->node_d0828271 node_18fd6e77 729: _read_receives_section() node_18fd6e77->node_82085d8e node_18fd6e77->node_deda226a node_18fd6e77->node_4b3bf13b node_c037fe6f 637: _read_returns_section() node_c037fe6f->node_82085d8e node_c037fe6f->node_deda226a node_c037fe6f->node_4b3bf13b node_437d7a8a 462: _read_type_aliases_section() node_437d7a8a->node_d0828271 node_1c66c5ac 277: _read_type_parameters_section() node_1c66c5ac->node_d0828271 node_503b8793 546: _read_warns_section() node_503b8793->node_d0828271 node_07854862 683: _read_yields_section() node_07854862->node_82085d8e node_07854862->node_deda226a node_07854862->node_4b3bf13b node_90cf64b5 881: parse_google() node_90cf64b5->node_7a15510f node_90cf64b5->node_c6bd90f1 models.py This module contains the models for storing docstrings structured data.
G cluster_64efd04d File: models cluster_28c64e29 Class: DocstringSection node_4c89a4c3 246: as_dict() node_4c89a4c3->node_4c89a4c3 numpy.py This module defines functions to parse Numpy-style docstrings into structured data.
Based on https://numpydoc.readthedocs.io/en/latest/format.html , it seems Numpydoc is a superset of RST. Since fully parsing RST is a non-goal of this project, some things are stripped from the Numpydoc specification.
Rejected as non particularly Pythonic or useful as sections:
See also: this section feels too subjective (specially crafted as a standard for Numpy itself), and there are may ways to reference related items in a docstring, depending on the chosen markup. Rejected as naturally handled by the user-chosen markup:
Warnings: this is just markup. Notes: again, just markup. References: again, just markup. G cluster_0a327c1d File: numpy node_92f24522 857: _append_section() node_5ceb2fe2 95: _is_dash_line() node_04bdac71 91: _is_empty_line() node_5ceb2fe2->node_04bdac71 node_bf14eb6c 637: _read_attributes_section() node_13edbc2f 99: _read_block_items() node_bf14eb6c->node_13edbc2f node_712e1e15 161: _read_block() node_712e1e15->node_5ceb2fe2 node_712e1e15->node_04bdac71 node_13edbc2f->node_5ceb2fe2 node_13edbc2f->node_04bdac71 node_e56e46d0 708: _read_classes_section() node_e56e46d0->node_13edbc2f node_1ca75744 404: _read_deprecated_section() node_1ca75744->node_13edbc2f node_66c3c945 792: _read_examples_section() node_66c3c945->node_04bdac71 node_66c3c945->node_712e1e15 node_c2dace63 676: _read_functions_section() node_c2dace63->node_13edbc2f node_9f2d2cb0 760: _read_modules_section() node_9f2d2cb0->node_13edbc2f node_0876499d 312: _read_other_parameters_section() node_42ff53b0 223: _read_parameters() node_0876499d->node_42ff53b0 node_42ff53b0->node_13edbc2f node_33825a58 297: _read_parameters_section() node_33825a58->node_42ff53b0 node_e6b32320 587: _read_raises_section() node_e6b32320->node_13edbc2f node_37cf768a 540: _read_receives_section() node_37cf768a->node_13edbc2f node_6b5580ef 430: _read_returns_section() node_6b5580ef->node_13edbc2f node_7ffaf1fb 740: _read_type_aliases_section() node_7ffaf1fb->node_13edbc2f node_7e8f54f8 334: _read_type_parameters_section() node_7e8f54f8->node_13edbc2f node_c24e4131 612: _read_warns_section() node_c24e4131->node_13edbc2f node_8a0839cf 489: _read_yields_section() node_8a0839cf->node_13edbc2f node_7e750639 910: parse_numpy() node_7e750639->node_92f24522 node_7e750639->node_5ceb2fe2 node_7e750639->node_04bdac71 parsers.py This module imports all the defined parsers and provides a generic function to parse docstrings.
sphinx.py This module defines functions to parse Sphinx docstrings into structured data.
G cluster_cf5ebc04 File: sphinx cluster_7b16702d Class: _FieldType node_e7d7f070 52: matches() node_2786fd39 457: _consolidate_continuation_lines() node_a4b2fa74 470: _consolidate_descriptive_type() node_4846f324 209: _determine_param_annotation() node_eb04557e 202: _determine_param_default() node_13de5bd7 444: _parse_directive() node_13de5bd7->node_2786fd39 node_b0d2f716 428: _parsed_values_to_sections() node_385a8258 474: _strip_blank_lines() node_b0d2f716->node_385a8258 node_4b9edff0 275: _read_attribute() node_4b9edff0->node_13de5bd7 node_39a08624 322: _read_attribute_type() node_39a08624->node_a4b2fa74 node_39a08624->node_13de5bd7 node_2ca2ee69 352: _read_exception() node_2ca2ee69->node_13de5bd7 node_1a678548 139: _read_parameter() node_1a678548->node_4846f324 node_1a678548->node_eb04557e node_1a678548->node_13de5bd7 node_5e679cc4 244: _read_parameter_type() node_5e679cc4->node_a4b2fa74 node_5e679cc4->node_13de5bd7 node_83a679f5 373: _read_return() node_83a679f5->node_13de5bd7 node_1e299b1e 407: _read_return_type() node_1e299b1e->node_a4b2fa74 node_1e299b1e->node_13de5bd7 node_665753f9 98: parse_sphinx() node_665753f9->node_e7d7f070 node_665753f9->node_b0d2f716 utils.py This module contains utilities for docstrings parsers.
encoders.py This module contains data encoders/serializers and decoders/deserializers. We only support JSON for now, but might want to add more formats in the future.
G cluster_e097120d File: encoders cluster_36e7a1a3 Class: JSONEncoder node_74e8d19f 55: __init__() node_74e8d19f->node_74e8d19f node_c835dfe9 150: _attach_parent_to_expr() node_9276612f 160: _attach_parent_to_exprs() node_9276612f->node_c835dfe9 node_fe511e09 274: _load_attribute() node_48bcb3ca 92: _load_docstring() node_fe511e09->node_48bcb3ca node_d63409fc 141: _load_git_info() node_fe511e09->node_d63409fc node_57a6c1ed 224: _load_class() node_57a6c1ed->node_9276612f node_dda874ad 98: _load_decorators() node_57a6c1ed->node_dda874ad node_57a6c1ed->node_48bcb3ca node_57a6c1ed->node_d63409fc node_7c3e7c95 102: _load_expression() node_90befec2 252: _load_function() node_90befec2->node_dda874ad node_90befec2->node_48bcb3ca node_90befec2->node_d63409fc node_7f20ca40 197: _load_module() node_7f20ca40->node_9276612f node_7f20ca40->node_48bcb3ca node_7f20ca40->node_d63409fc node_3c2dcdd3 122: _load_parameter() node_3c2dcdd3->node_48bcb3ca node_f94588f1 309: _load_type_alias() node_f94588f1->node_48bcb3ca node_f94588f1->node_d63409fc node_ba22d074 132: _load_type_parameter() node_4fc77a25 339: json_decoder() node_4fc77a25->node_7c3e7c95 node_4fc77a25->node_3c2dcdd3 node_4fc77a25->node_ba22d074 enumerations.py This module contains all the enumerations of the package.
exceptions.py This module contains all the exceptions specific to Griffe.
expressions.py This module contains the data classes that represent resolvable names and expressions. First we declare data classes for each kind of expression, mostly corresponding to Python's AST nodes. Then we declare builder methods, that iterate AST nodes and build the corresponding data classes, and two utilities _yield and _join to help iterate on expressions. Finally we declare a few public helpers to safely get expressions from AST nodes in different scenarios.
G cluster_6dcde79e File: expressions cluster_f82e96b9 Class: Expr cluster_8e9b6b15 Class: ExprAttribute cluster_f079fa83 Class: ExprBinOp cluster_af832611 Class: ExprBoolOp cluster_cba2edb4 Class: ExprCall cluster_19ada3a2 Class: ExprCompare cluster_e45fc37f Class: ExprComprehension cluster_beb485ea Class: ExprDict cluster_d0a9d1cd Class: ExprDictComp cluster_0f7583d7 Class: ExprExtSlice cluster_26e729f7 Class: ExprFormatted cluster_6f5d5d43 Class: ExprGeneratorExp cluster_b46be460 Class: ExprIfExp cluster_af07ab2d Class: ExprInterpolation cluster_e52b0b77 Class: ExprJoinedStr cluster_34c23222 Class: ExprKeyword cluster_c5bd3ece Class: ExprVarPositional cluster_056bbc68 Class: ExprVarKeyword cluster_2b92a6bf Class: ExprLambda cluster_c822a5e7 Class: ExprList cluster_838b999e Class: ExprListComp cluster_89942f55 Class: ExprNamedExpr cluster_71ebb8dc Class: ExprSet cluster_0557c0a1 Class: ExprSetComp cluster_6c2653cd Class: ExprSlice cluster_5c6f3c86 Class: ExprSubscript cluster_255401b9 Class: ExprTemplateStr cluster_c7014480 Class: ExprTuple cluster_920a5d00 Class: ExprUnaryOp cluster_5a8614e4 Class: ExprYield cluster_f114bfde Class: ExprYieldFrom node_8fd3b063 168: __iter__() node_6c76d3f5 172: iterate() node_8fd3b063->node_6c76d3f5 node_9285266b 165: __str__() node_9285266b->node_6c76d3f5 node_9cdd6762 255: _to_binop() node_9cdd6762->node_9cdd6762 node_a6397148 201: as_dict() node_87b93393 143: _expr_as_dict() node_a6397148->node_87b93393 node_86fb4d3a 290: append() node_86fb4d3a->node_86fb4d3a node_c2ed4a81 278: iterate() node_141a150f 1110: _get_precedence() node_c2ed4a81->node_141a150f node_a923302a 66: _yield() node_c2ed4a81->node_a923302a node_0deee5b9 334: iterate() node_0deee5b9->node_141a150f node_0deee5b9->node_a923302a node_04d4e3cc 354: iterate() node_04d4e3cc->node_141a150f node_04d4e3cc->node_a923302a node_e998f02f 377: iterate() node_e998f02f->node_141a150f node_8de2b2b0 109: _join() node_e998f02f->node_8de2b2b0 node_e998f02f->node_a923302a node_01aba130 395: iterate() node_01aba130->node_141a150f node_01aba130->node_a923302a node_1003a3cd 416: iterate() node_1003a3cd->node_8de2b2b0 node_1003a3cd->node_a923302a node_0054f1fc 452: iterate() node_0054f1fc->node_8de2b2b0 node_94bb3dd2 473: iterate() node_94bb3dd2->node_8de2b2b0 node_94bb3dd2->node_a923302a node_0658c32e 490: iterate() node_0658c32e->node_8de2b2b0 node_e474f197 501: iterate() node_e474f197->node_a923302a node_9b06577c 517: iterate() node_9b06577c->node_8de2b2b0 node_9b06577c->node_a923302a node_9f062567 534: iterate() node_9f062567->node_9f062567 node_9f062567->node_141a150f node_9f062567->node_a923302a node_5c0d27ad 559: iterate() node_5c0d27ad->node_a923302a node_d2c75038 573: iterate() node_d2c75038->node_8de2b2b0 node_7e9d88bf 613: iterate() node_7e9d88bf->node_a923302a node_2f28a7ad 652: iterate() node_2f28a7ad->node_a923302a node_e2a0f419 693: iterate() node_e2a0f419->node_8de2b2b0 node_0c686f35 708: iterate() node_0c686f35->node_8de2b2b0 node_0c686f35->node_a923302a node_de48b350 819: iterate() node_de48b350->node_a923302a node_23923e35 846: iterate() node_23923e35->node_8de2b2b0 node_38612149 861: iterate() node_38612149->node_8de2b2b0 node_38612149->node_a923302a node_a1f94e85 880: iterate() node_a1f94e85->node_a923302a node_e64af863 900: iterate() node_e64af863->node_141a150f node_e64af863->node_a923302a node_4e2b4019 907: modernize() node_4e2b4019->node_9cdd6762 node_4e2b4019->node_4e2b4019 node_858a1ec6 940: iterate() node_858a1ec6->node_8de2b2b0 node_b6408564 955: iterate() node_b6408564->node_8de2b2b0 node_851932f5 980: iterate() node_851932f5->node_141a150f node_851932f5->node_a923302a node_5b3fa42e 638: iterate() node_5b3fa42e->node_a923302a node_6ad8e030 626: iterate() node_6ad8e030->node_a923302a node_49c65265 994: iterate() node_49c65265->node_a923302a node_7068a338 1008: iterate() node_7068a338->node_a923302a node_5f92152f 1420: _build() node_eac699cd 1114: _build_attribute() node_eac699cd->node_86fb4d3a node_eac699cd->node_5f92152f node_e03434d2 1126: _build_binop() node_e03434d2->node_5f92152f node_fa3c2ba0 1134: _build_boolop() node_fa3c2ba0->node_5f92152f node_7ec041e7 1141: _build_call() node_7ec041e7->node_5f92152f node_0eb2923d 1148: _build_compare() node_0eb2923d->node_5f92152f node_ca63b1f6 1156: _build_comprehension() node_ca63b1f6->node_5f92152f node_3c3b81e3 1165: _build_constant() node_3c3b81e3->node_5f92152f node_d941574a 1204: _build_dict() node_d941574a->node_5f92152f node_6ffaff3f 1211: _build_dictcomp() node_6ffaff3f->node_5f92152f node_5d405df2 1219: _build_formatted() node_5d405df2->node_5f92152f node_dca9565a 1229: _build_generatorexp() node_dca9565a->node_5f92152f node_3c77c692 1236: _build_ifexp() node_3c77c692->node_5f92152f node_5bdd04e4 1402: _build_interpolation() node_5bdd04e4->node_5f92152f node_eda878ef 1244: _build_joinedstr() node_eda878ef->node_5f92152f node_520951e8 1254: _build_keyword() node_520951e8->node_5f92152f node_db0a1095 1260: _build_lambda() node_db0a1095->node_5f92152f node_9013ca70 1454: safe_get_expression() node_db0a1095->node_9013ca70 node_adabf7d2 1277: _build_list() node_adabf7d2->node_5f92152f node_0a5c7217 1281: _build_listcomp() node_0a5c7217->node_5f92152f node_61de0056 1289: _build_named_expr() node_61de0056->node_5f92152f node_4f2a1f6a 1293: _build_set() node_4f2a1f6a->node_5f92152f node_1b436f65 1297: _build_setcomp() node_1b436f65->node_5f92152f node_7003bcbb 1301: _build_slice() node_7003bcbb->node_5f92152f node_ce8d20cf 1309: _build_starred() node_ce8d20cf->node_5f92152f node_0f34bef6 1313: _build_subscript() node_0f34bef6->node_5f92152f node_88b12abb 1405: _build_templatestr() node_88b12abb->node_5f92152f node_3630ea0b 1342: _build_tuple() node_3630ea0b->node_5f92152f node_67b89831 1353: _build_unaryop() node_67b89831->node_5f92152f node_6545a32b 1357: _build_yield() node_6545a32b->node_5f92152f node_a1dd7506 1361: _build_yield_from() node_a1dd7506->node_5f92152f node_6e8b4e6b 132: _field_as_dict() node_87b93393->node_6e8b4e6b node_6e8b4e6b->node_6e8b4e6b node_8de2b2b0->node_a923302a node_a923302a->node_141a150f node_a923302a->node_a923302a node_1b9e3ce0 1424: get_expression() node_1b9e3ce0->node_5f92152f node_9013ca70->node_1b9e3ce0 extensions These submodules contain our extension system, as well as built-in extensions.
base.py This module contains the base class for extensions and the functions to load them.
G cluster_fd209498 File: base cluster_8e84b91f Class: Extension cluster_ed1b57b0 Class: Extensions node_cf6fefd1 56: generic_inspect() node_aa686ce9 48: inspect() node_cf6fefd1->node_aa686ce9 node_3a5dd21d 39: generic_visit() node_5574dfb2 31: visit() node_3a5dd21d->node_5574dfb2 node_3ce4c1d2 411: on_alias() node_8d6f5938 387: on_alias_instance() node_8d6f5938->node_3ce4c1d2 node_2d0e1c51 445: __init__() node_5b26bd32 454: add() node_2d0e1c51->node_5b26bd32 node_f363f0f0 495: _load_extension() node_4e396ae2 484: _load_extension_path() node_f363f0f0->node_4e396ae2 node_9791a1ef 586: load_extensions() node_9791a1ef->node_2d0e1c51 node_9791a1ef->node_5b26bd32 node_9791a1ef->node_f363f0f0 dataclasses.py Built-in extension adding support for dataclasses.
This extension re-creates __init__ methods of dataclasses during static analysis.
G cluster_2b2e64e9 File: dataclasses cluster_e94d2741 Class: DataclassesExtension node_fe1c4e40 227: on_package() node_e0e29386 203: _apply_recursively() node_fe1c4e40->node_e0e29386 node_e0e29386->node_e0e29386 node_3c2ca0b6 195: _del_members_annotated_as_initvar() node_e0e29386->node_3c2ca0b6 node_30706902 157: _set_dataclass_init() node_e0e29386->node_30706902 node_5351d1cd 49: _dataclass_arguments() node_232595a9 25: _dataclass_decorator() node_5351d1cd->node_232595a9 node_63b8b12d 32: _expr_args() node_5351d1cd->node_63b8b12d node_cf9232bd 66: _dataclass_parameters() node_cf9232bd->node_5351d1cd node_b8d34fc1 55: _field_arguments() node_cf9232bd->node_b8d34fc1 node_63b8b12d->node_63b8b12d node_b8d34fc1->node_63b8b12d node_55c0f174 139: _reorder_parameters() node_30706902->node_232595a9 node_30706902->node_cf9232bd node_30706902->node_55c0f174 unpack_typeddict.py Todo
Support extra_items=type. TODO: Support closed=True/False.
G cluster_377e265c File: unpack_typeddict cluster_b5a954f0 Class: UnpackTypedDictExtension node_e0874bda 191: on_class() node_4207620b 65: _get_or_set_attrs() node_e0874bda->node_4207620b node_cef96110 170: _params_from_attrs() node_e0874bda->node_cef96110 node_bdb62fe8 109: _update_docstring() node_e0874bda->node_bdb62fe8 node_ce84df56 218: on_function() node_ce84df56->node_4207620b node_ce84df56->node_cef96110 node_ce84df56->node_bdb62fe8 node_9b733b40 29: _unwrap_annotation() node_4207620b->node_9b733b40 finder.py This module contains the code allowing to find modules.
Note: It might be possible to replace a good part of this module's logic with utilities from importlib (however the util in question is private):
>>> from importlib.util import _find_spec
>>> _find_spec ( "griffe.agents" , _find_spec ( "griffe" , None ) . submodule_search_locations )
ModuleSpec(
name='griffe.agents',
loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fa5f34e8110>,
origin='/media/data/dev/griffelib/packages/griffe/src/griffe/agents/__init__.py',
submodule_search_locations=['/media/data/dev/griffelib/packages/griffe/src/griffe/agents'],
)
G cluster_9554efb7 File: finder cluster_22a2bb44 Class: ModuleFinder node_9a9094cf 102: __init__() node_34c26341 384: _extend_from_pth_files() node_9a9094cf->node_34c26341 node_f45f0b4c 119: append_search_path() node_9a9094cf->node_f45f0b4c node_9d0f4031 130: _append_search_path() node_cb10b22b 376: _contents() node_34c26341->node_cb10b22b node_34c26341->node_f45f0b4c node_39801b53 440: _handle_pth_file() node_34c26341->node_39801b53 node_edc4f3ad 393: _filter_py_modules() node_be26af03 361: _module_name_path() node_e9071b12 401: _top_module_name() node_fe246f17 134: insert_search_path() node_e9071b12->node_fe246f17 node_f45f0b4c->node_9d0f4031 node_ce29591a 231: find_package() node_ce29591a->node_cb10b22b node_ddb32593 425: _is_pkg_style_namespace() node_ce29591a->node_ddb32593 node_e38bd17e 148: find_spec() node_e38bd17e->node_be26af03 node_e38bd17e->node_e9071b12 node_e38bd17e->node_ce29591a node_b121e8d0 278: iter_submodules() node_b121e8d0->node_edc4f3ad node_b121e8d0->node_b121e8d0 node_c3dcf640 344: submodules() node_c3dcf640->node_b121e8d0 node_0cf10120 470: _handle_editable_module() node_0af0b4ee 51: _match_pattern() node_0cf10120->node_0af0b4ee node_39801b53->node_0cf10120 git.py This module contains Git utilities, used by our load_git function, which in turn is used to load the API for different snapshots of a Git repository and find breaking changes between them.
G cluster_c6d2d98e File: git cluster_93f2571c Class: GitInfo node_edd054c9 241: from_package() node_6378d9de 217: _get_git_commit_hash() node_edd054c9->node_6378d9de node_6cdebee8 163: _get_git_known_service() node_edd054c9->node_6cdebee8 node_b625bd1d 137: _get_git_remote_url() node_edd054c9->node_b625bd1d node_87cf775c 87: _get_repo_root() node_edd054c9->node_87cf775c node_c587c725 223: _is_tracked() node_edd054c9->node_c587c725 node_a6b79acf 265: get_source_link() node_228551cb 204: _get_source_link() node_a6b79acf->node_228551cb node_556467f8 50: _assert_git_repo() node_6a397dc5 36: _git() node_556467f8->node_6a397dc5 node_6378d9de->node_6a397dc5 node_b625bd1d->node_6a397dc5 node_560ba4c5 67: _get_latest_tag() node_560ba4c5->node_6a397dc5 node_87cf775c->node_6a397dc5 node_c587c725->node_6a397dc5 node_c5e9cdd0 30: _normalize() node_751c4c2f 104: _tmp_worktree() node_751c4c2f->node_556467f8 node_751c4c2f->node_6a397dc5 node_751c4c2f->node_c5e9cdd0 helpers.py This module contains helpers. They simplify programmatic use of Griffe, for example to load data from strings or to create temporary packages. They are particularly useful for our own tests suite.
G cluster_98c908ce File: helpers node_84669680 403: module_vtree() node_cbada710 360: vtree() node_84669680->node_cbada710 node_4866c314 309: temporary_inspected_module() node_acf016f5 54: temporary_pyfile() node_4866c314->node_acf016f5 node_26daa42c 189: temporary_inspected_package() node_b92d3ecd 72: temporary_pypackage() node_26daa42c->node_b92d3ecd node_543af561 263: temporary_visited_module() node_543af561->node_acf016f5 node_a0681e1d 121: temporary_visited_package() node_a0681e1d->node_b92d3ecd importer.py This module contains utilities to dynamically import objects. These utilities are used by our Inspector to dynamically import objects specified as Python paths, like package.module.Class.method.
G cluster_ae49e7a1 File: importer node_5ebe28ad 17: _error_details() node_adec6170 43: dynamic_import() node_adec6170->node_5ebe28ad node_d98bb1ed 22: sys_path() node_adec6170->node_d98bb1ed loader.py This module contains all the logic for loading API data from sources or compiled modules.
G cluster_b0b72d2b File: loader cluster_1534c3c9 Class: GriffeLoader node_1c9699b7 53: __init__() node_b6d1a5cc 653: _create_module() node_73465e8e 738: _expand_wildcard() node_3e4fc106 197: _fire_load_events() node_3e4fc106->node_3e4fc106 node_5cd3bb0c 708: _get_or_create_parent_module() node_5cd3bb0c->node_b6d1a5cc node_4600a9e4 681: _inspect_module() node_f44a6559 554: _load_module() node_ec15897d 573: _load_module_path() node_f44a6559->node_ec15897d node_ec15897d->node_b6d1a5cc node_ec15897d->node_4600a9e4 node_803ff651 598: _load_submodules() node_ec15897d->node_803ff651 node_b504b02a 661: _visit_module() node_ec15897d->node_b504b02a node_82bd8d39 539: _load_package() node_82bd8d39->node_f44a6559 node_ad5d9a22 334: expand_wildcards() node_82bd8d39->node_ad5d9a22 node_6576d7ce 602: _load_submodule() node_6576d7ce->node_5cd3bb0c node_6576d7ce->node_f44a6559 node_803ff651->node_6576d7ce node_d0b64b82 216: _post_load() node_d0b64b82->node_3e4fc106 node_4005f7a5 293: expand_exports() node_d0b64b82->node_4005f7a5 node_d0b64b82->node_ad5d9a22 node_4005f7a5->node_4005f7a5 node_ad5d9a22->node_73465e8e node_ad5d9a22->node_ad5d9a22 node_096e30bd 105: load() node_ad5d9a22->node_096e30bd node_096e30bd->node_4600a9e4 node_096e30bd->node_82bd8d39 node_096e30bd->node_d0b64b82 node_1c8597d9 237: resolve_aliases() node_1c8597d9->node_ad5d9a22 node_b03b101c 450: resolve_module_aliases() node_1c8597d9->node_b03b101c node_b03b101c->node_096e30bd node_b03b101c->node_b03b101c node_493528c8 747: load() node_493528c8->node_1c9699b7 node_493528c8->node_096e30bd node_493528c8->node_1c8597d9 node_9b3979fb 852: load_git() node_9b3979fb->node_493528c8 node_36bfa51a 937: load_pypi() node_36bfa51a->node_493528c8 logger.py This module contains the logger used throughout Griffe. The logger is actually a wrapper around the standard Python logger. We wrap it so that it is easier for other downstream libraries to patch it. For example, mkdocstrings-python patches the logger to relocate it as a child of mkdocs.plugins so that it fits in the MkDocs logging configuration.
We use a single, global logger because our public API is exposed in a single module, griffe. Extensions however should use their own logger, which is why we provide the get_logger function.
G cluster_4bf37289 File: logger cluster_a57e2dbd Class: Logger node_483a3c23 0: (global)() node_b3dadba3 43: _get() node_483a3c23->node_b3dadba3 node_51c27778 49: _patch_loggers() node_5a499b73 93: get_logger() node_5a499b73->node_b3dadba3 node_875bd1b3 105: patch_loggers() node_875bd1b3->node_51c27778 merger.py This module contains utilities to merge stubs data and concrete data.
G cluster_01ea6900 File: merger node_c88fdf16 77: _merge_annotations() node_32a1bcd7 40: _merge_attribute_stubs() node_1d201742 52: _merge_stubs_docstring() node_32a1bcd7->node_1d201742 node_a3fd6988 24: _merge_class_stubs() node_a3fd6988->node_1d201742 node_231daf94 110: _merge_stubs_members() node_a3fd6988->node_231daf94 node_8a2b1d35 62: _merge_stubs_overloads() node_a3fd6988->node_8a2b1d35 node_3f9632ff 57: _merge_stubs_type_parameters() node_a3fd6988->node_3f9632ff node_5a9ed645 31: _merge_function_stubs() node_5a9ed645->node_1d201742 node_5a9ed645->node_3f9632ff node_e6d1504c 18: _merge_module_stubs() node_e6d1504c->node_1d201742 node_e6d1504c->node_231daf94 node_e6d1504c->node_8a2b1d35 node_42fce77d 85: _merge_overload_annotations() node_42fce77d->node_c88fdf16 node_231daf94->node_32a1bcd7 node_231daf94->node_5a9ed645 node_fbef7437 47: _merge_type_alias_stubs() node_231daf94->node_fbef7437 node_8a2b1d35->node_42fce77d node_fbef7437->node_1d201742 node_fbef7437->node_3f9632ff node_682ddd65 154: merge_stubs() node_682ddd65->node_e6d1504c mixins.py This module contains some mixins classes that hold shared methods of the different kinds of objects, and aliases.
G cluster_d2e7b230 File: mixins cluster_8c109ee7 Class: GetMembersMixin cluster_f6cf7c7a Class: DelMembersMixin cluster_d63c7523 Class: SetMembersMixin node_cf59e233 87: __delitem__() node_e0343ed7 22: _get_parts() node_cf59e233->node_e0343ed7 node_b7033400 114: del_member() node_b7033400->node_b7033400 node_b7033400->node_e0343ed7 node_2b6d77b8 37: __getitem__() node_2b6d77b8->node_e0343ed7 node_b33a3edb 59: get_member() node_b33a3edb->node_b33a3edb node_b33a3edb->node_e0343ed7 node_d69e2ba6 142: __setitem__() node_d69e2ba6->node_e0343ed7 node_0defc164 168: set_member() node_0defc164->node_0defc164 node_0defc164->node_e0343ed7 models.py This module contains our models definitions, to represent Python objects (and other aspects of Python APIs)... in Python.
G cluster_3e739abf File: models cluster_148dd9ad Class: Docstring cluster_726bf34a Class: Parameter cluster_b3728860 Class: Parameters cluster_f088c32c Class: TypeParameters cluster_5a0cd3df Class: Object cluster_5b54c01d Class: Alias cluster_aa8e24aa Class: Class cluster_4ea8e934 Class: Function node_1c4d81ab 1350: __init__() node_10f3b5ee 2167: _update_target_aliases() node_1c4d81ab->node_10f3b5ee node_d2d4dc16 2151: _resolve_target() node_13fe8300 2118: resolve_target() node_d2d4dc16->node_13fe8300 node_adbaa805 1541: as_json() node_adbaa805->node_adbaa805 node_24683cf5 1777: filter_members() node_24683cf5->node_24683cf5 node_bf06c668 1764: has_labels() node_bf06c668->node_bf06c668 node_bfd87efc 1519: inherited_members() node_bfd87efc->node_1c4d81ab node_90058ff8 1677: is_kind() node_90058ff8->node_90058ff8 node_93e10d37 1499: members() node_93e10d37->node_1c4d81ab node_b322bd4d 1480: parent() node_b322bd4d->node_10f3b5ee node_b3f2fb16 1886: resolve() node_b3f2fb16->node_b3f2fb16 node_bf316b55 2069: target() node_bf316b55->node_13fe8300 node_a198888d 2451: _mro() node_a198888d->node_a198888d node_fb856a22 2462: mro() node_fb856a22->node_a198888d node_218c50c1 2399: parameters() node_00aaaf8e 308: __init__() node_218c50c1->node_00aaaf8e node_dde4880b 165: parse() node_a973b45d 161: parsed() node_a973b45d->node_dde4880b node_208ec109 2492: __init__() node_208ec109->node_00aaaf8e node_6f14033a 579: __init__() node_7f9e4517 488: __init__() node_6f14033a->node_7f9e4517 node_8e44c7ac 821: inherited_members() node_8e44c7ac->node_1c4d81ab node_af6839f3 1197: resolve() node_af6839f3->node_af6839f3 node_d57273f1 274: as_dict() node_d57273f1->node_d57273f1 stats.py This module contains utilities to compute loading statistics, like time spent visiting modules statically or dynamically.
G cluster_daa90503 File: stats cluster_5d3ae5d2 Class: Stats node_82bacf67 20: __init__() node_1cb27383 74: _itercount() node_82bacf67->node_1cb27383 node_1cb27383->node_1cb27383