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)!
π config/ # (5)!
π docs/ # (6)!
π htmlcov/ # (7)!
π packages/ # (8)!
π scripts/ # (9)!
π site/ # (10)!
π tests/ # (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)!
pyproject.toml
π _internal/ # (1)!
__init__.py
__main__.py
py.typed
π src/ # (1)!
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
importer.py
loader.py
logger.py
merger.py
mixins.py
models.py
stats.py
tests.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 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).
Our test suite. See Tests .
π fixtures/
π test_docstrings/ # (1)!
π test_extensions/ # (2)!
__init__.py
conftest.py
helpers.py
test_api.py
test_cli.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
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_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 griffe__internal_tests griffe. _internal. tests griffe->griffe__internal_tests 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_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 griffe__internal_tests->griffe__internal_agents griffe__internal_tests->griffe__internal_agents_inspector griffe__internal_tests->griffe__internal_agents_visitor griffe__internal_tests->griffe__internal_collections griffe__internal_tests->griffe__internal_docstrings griffe__internal_tests->griffe__internal_docstrings_parsers griffe__internal_tests->griffe__internal_enumerations griffe__internal_tests->griffe__internal_extensions griffe__internal_tests->griffe__internal_extensions_base griffe__internal_tests->griffe__internal_loader griffe__internal_tests->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_99989a4a File: inspector cluster_26333442 Class: Inspector node_6e46790c 122: __init__() node_6e46790c->node_6e46790c node_d32f0cd3 174: _get_docstring() node_f41252f6 196: _get_linenos() node_3445cea3 262: generic_inspect() node_3445cea3->node_6e46790c node_809cf207 254: inspect() node_3445cea3->node_809cf207 node_2492b3a9 299: inspect_module() node_3445cea3->node_2492b3a9 node_7e107b0e 206: get_module() node_7e107b0e->node_809cf207 node_51d57dd7 543: handle_attribute() node_51d57dd7->node_d32f0cd3 node_a71b330f 444: handle_function() node_a71b330f->node_d32f0cd3 node_a71b330f->node_f41252f6 node_bac1c6c2 624: _convert_object_to_annotation() node_a71b330f->node_bac1c6c2 node_982d5fba 601: _convert_parameter() node_a71b330f->node_982d5fba node_629a67e7 660: _convert_type_parameters() node_a71b330f->node_629a67e7 node_a42e3b96 535: inspect_attribute() node_a42e3b96->node_51d57dd7 node_6978d402 404: inspect_builtin_function() node_6978d402->node_a71b330f node_fafeb37e 380: inspect_builtin_method() node_fafeb37e->node_a71b330f node_bbc9ed29 420: inspect_cached_property() node_bbc9ed29->node_a71b330f node_4a17ff25 322: inspect_class() node_4a17ff25->node_d32f0cd3 node_4a17ff25->node_f41252f6 node_4a17ff25->node_3445cea3 node_4a17ff25->node_629a67e7 node_c32320be 364: inspect_classmethod() node_c32320be->node_a71b330f node_7c164065 396: inspect_coroutine() node_7c164065->node_a71b330f node_f382f654 412: inspect_function() node_f382f654->node_a71b330f node_3aeaad3f 436: inspect_getset_descriptor() node_3aeaad3f->node_a71b330f node_f6987f55 388: inspect_method() node_f6987f55->node_a71b330f node_d17cbd42 372: inspect_method_descriptor() node_d17cbd42->node_a71b330f node_2492b3a9->node_d32f0cd3 node_2ce6e8f9 428: inspect_property() node_2ce6e8f9->node_a71b330f node_8edc0ad3 356: inspect_staticmethod() node_8edc0ad3->node_a71b330f node_b1fde2fa 510: inspect_type_alias() node_b1fde2fa->node_d32f0cd3 node_b1fde2fa->node_f41252f6 node_b1fde2fa->node_629a67e7 node_ae739d3d 703: _convert_type_to_annotation() node_b1fde2fa->node_ae739d3d node_982d5fba->node_bac1c6c2 node_629a67e7->node_ae739d3d node_ae739d3d->node_bac1c6c2 node_ae739d3d->node_ae739d3d node_8aaf495f 54: inspect() node_8aaf495f->node_6e46790c node_8aaf495f->node_7e107b0e 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_c97ecf3b File: assignments node_43fe20bd 43: _get_annassign_names() node_5c0b6a9e 26: get_name() node_43fe20bd->node_5c0b6a9e node_47f218a0 38: _get_assign_names() node_47f218a0->node_5c0b6a9e node_ce92641f 12: _get_attribute_name() node_ce92641f->node_5c0b6a9e node_6a389b95 66: get_instance_names() node_9c057eee 54: get_names() node_6a389b95->node_9c057eee ast.py This module contains utilities for navigating AST nodes.
G cluster_f5b04025 File: ast node_1602a740 26: ast_children() node_ff2ecc45 137: ast_first_child() node_ff2ecc45->node_1602a740 node_4f2fd4d1 155: ast_last_child() node_4f2fd4d1->node_1602a740 node_92acce62 119: ast_next() node_585c1764 66: ast_next_siblings() node_92acce62->node_585c1764 node_585c1764->node_1602a740 node_9a179a34 100: ast_previous() node_444a5ffa 50: ast_previous_siblings() node_9a179a34->node_444a5ffa node_444a5ffa->node_1602a740 node_8e215c4b 82: ast_siblings() node_8e215c4b->node_1602a740 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_44458a91 File: exports node_32a563cd 61: _extract() node_8be7d9ae 20: _extract_attribute() node_8be7d9ae->node_32a563cd node_43d95b7d 24: _extract_binop() node_43d95b7d->node_32a563cd node_b57afced 38: _extract_sequence() node_b57afced->node_32a563cd node_32fa2a6b 45: _extract_starred() node_32fa2a6b->node_32a563cd node_69c66bf5 65: get__all__() node_69c66bf5->node_32a563cd node_43566552 80: safe_get__all__() node_43566552->node_69c66bf5 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_25aa00e1 File: runtime cluster_bf40d4a4 Class: ObjectNode node_737884b3 52: __init__() node_2da70a9e 285: _pick_member() node_c6011500 295: alias_target_path() node_946917ba 36: _same_components() node_c6011500->node_946917ba node_f522c980 175: children() node_f522c980->node_737884b3 node_f522c980->node_2da70a9e values.py This module contains utilities for extracting attribute values.
G cluster_b809625a File: values node_f6817e57 15: get_value() node_71946f74 29: safe_get_value() node_71946f74->node_f6817e57 visitor.py This module contains our static analysis agent, capable of parsing and visiting sources, statically.
G cluster_ae12c7f2 File: visitor cluster_e336ec5d Class: Visitor node_dfde319c 137: __init__() node_dfde319c->node_dfde319c node_f5ebd8ec 197: _get_docstring() node_40d33154 217: _get_type_parameters() node_f3df8ce3 353: decorators_to_labels() node_38103f6b 268: generic_visit() node_05d515c0 260: visit() node_38103f6b->node_05d515c0 node_a9ce8d58 371: get_base_property() node_d1c659f7 246: get_module() node_d1c659f7->node_05d515c0 node_3dda9fc8 613: handle_attribute() node_3dda9fc8->node_f5ebd8ec node_b47f4be8 395: handle_function() node_b47f4be8->node_f5ebd8ec node_b47f4be8->node_40d33154 node_b47f4be8->node_f3df8ce3 node_b47f4be8->node_38103f6b node_b47f4be8->node_a9ce8d58 node_66393cbc 728: visit_annassign() node_66393cbc->node_3dda9fc8 node_e7396256 720: visit_assign() node_e7396256->node_3dda9fc8 node_268f3ef0 509: visit_asyncfunctiondef() node_268f3ef0->node_b47f4be8 node_b7369fdb 300: visit_classdef() node_b7369fdb->node_f5ebd8ec node_b7369fdb->node_40d33154 node_b7369fdb->node_f3df8ce3 node_b7369fdb->node_38103f6b node_e2cc1a0f 501: visit_functiondef() node_e2cc1a0f->node_b47f4be8 node_262d67f8 757: visit_if() node_262d67f8->node_38103f6b node_e20d9888 277: visit_module() node_e20d9888->node_f5ebd8ec node_e20d9888->node_38103f6b node_d28b2d5b 520: visit_typealias() node_d28b2d5b->node_f5ebd8ec node_d28b2d5b->node_40d33154 node_03bdf9a7 80: visit() node_03bdf9a7->node_dfde319c node_03bdf9a7->node_d1c659f7 c3linear.py This module contains a single function, c3linear_merge. The function is generic enough to be in its own module.
G cluster_1bdb9c56 File: c3linear cluster_55af957a Class: _Dependency cluster_79c86774 Class: _DependencyList node_4bde39d5 29: tail() node_2057f4d6 60: __len__() node_4bde39d5->node_2057f4d6 node_73b0e256 48: __init__() node_edf5cc30 64: __repr__() node_edf5cc30->node_edf5cc30 node_9822d173 82: remove() node_df251185 93: c3linear_merge() node_df251185->node_73b0e256 node_df251185->node_9822d173 collections.py This module contains collection-related classes, which are used throughout the API.
G cluster_a02a569f File: collections cluster_c67754ce Class: LinesCollection node_2207a31c 56: items() node_2207a31c->node_2207a31c node_fdf79ced 40: keys() node_fdf79ced->node_fdf79ced node_bac052e7 48: values() node_bac052e7->node_bac052e7 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_3ab8afa6 File: debug node_2a57057b 80: _get_debug_info() node_7c3c8bcd 65: _get_version() node_2a57057b->node_7c3c8bcd node_30dba5ef 54: _interpreter_name_version() node_2a57057b->node_30dba5ef node_07203295 99: _print_debug_info() node_07203295->node_2a57057b 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_39372c03 File: diff cluster_3d234da1 Class: Breakage node_84b53d91 261: _explain_github() node_e868c1b9 204: _format_new_value() node_84b53d91->node_e868c1b9 node_4f6aac16 201: _format_old_value() node_84b53d91->node_4f6aac16 node_7b0a5eb7 193: _format_title() node_84b53d91->node_7b0a5eb7 node_ba78047a 241: _explain_markdown() node_ba78047a->node_e868c1b9 node_ba78047a->node_4f6aac16 node_bb7c633e 207: _explain_oneline() node_e7a6eb71 196: _format_kind() node_bb7c633e->node_e7a6eb71 node_273d0b4d 188: _format_location() node_bb7c633e->node_273d0b4d node_bb7c633e->node_e868c1b9 node_bb7c633e->node_4f6aac16 node_bb7c633e->node_7b0a5eb7 node_b9675203 223: _explain_verbose() node_b9675203->node_e7a6eb71 node_b9675203->node_273d0b4d node_b9675203->node_e868c1b9 node_b9675203->node_4f6aac16 node_b9675203->node_7b0a5eb7 node_838bb017 562: _alias_incompatibilities() node_a7604e41 599: _type_based_yield() node_838bb017->node_a7604e41 node_1bbf942b 553: _attribute_incompatibilities() node_9e24ab19 465: _class_incompatibilities() node_c579b414 578: _member_incompatibilities() node_9e24ab19->node_c579b414 node_7aef6cd8 478: _function_incompatibilities() node_437db902 636: _returns_are_compatible() node_7aef6cd8->node_437db902 node_c579b414->node_a7604e41 node_a7604e41->node_1bbf942b node_a7604e41->node_9e24ab19 node_a7604e41->node_7aef6cd8 node_bdab4f62 660: find_breaking_changes() node_bdab4f62->node_c579b414 docstrings These submodules define models and parsers for docstrings.
auto.py This module defines functions to parse docstrings by guessing their style.
G cluster_35d424c3 File: auto node_b4af2c7e 116: infer_docstring_style() node_9980b306 188: parse_auto() node_9980b306->node_b4af2c7e google.py This module defines functions to parse Google-style docstrings into structured data.
G cluster_e798f1bb File: google node_c9694179 618: _annotation_from_parent() node_80f332a4 587: _get_name_annotation_description() node_57f5a354 834: _is_empty_line() node_c5aff68e 346: _read_attributes_section() node_79fced21 92: _read_block_items() node_c5aff68e->node_79fced21 node_c6cc4f5f 156: _read_block() node_c6cc4f5f->node_57f5a354 node_79fced21->node_57f5a354 node_4ee426cc 574: _read_block_items_maybe() node_4ee426cc->node_c6cc4f5f node_4ee426cc->node_79fced21 node_c472d7f0 425: _read_classes_section() node_c472d7f0->node_79fced21 node_32ea02aa 775: _read_examples_section() node_32ea02aa->node_57f5a354 node_32ea02aa->node_c6cc4f5f node_25ecc4ff 388: _read_functions_section() node_25ecc4ff->node_79fced21 node_962e861e 487: _read_modules_section() node_962e861e->node_79fced21 node_9b374af3 266: _read_other_parameters_section() node_ae426afa 187: _read_parameters() node_9b374af3->node_ae426afa node_ae426afa->node_79fced21 node_293d7bff 256: _read_parameters_section() node_293d7bff->node_ae426afa node_5c3251ab 515: _read_raises_section() node_5c3251ab->node_79fced21 node_f5e38b39 729: _read_receives_section() node_f5e38b39->node_c9694179 node_f5e38b39->node_80f332a4 node_f5e38b39->node_4ee426cc node_5317efee 637: _read_returns_section() node_5317efee->node_c9694179 node_5317efee->node_80f332a4 node_5317efee->node_4ee426cc node_6bcf2508 462: _read_type_aliases_section() node_6bcf2508->node_79fced21 node_6a45f0fd 277: _read_type_parameters_section() node_6a45f0fd->node_79fced21 node_9ed77f14 546: _read_warns_section() node_9ed77f14->node_79fced21 node_2fbbb9ca 683: _read_yields_section() node_2fbbb9ca->node_c9694179 node_2fbbb9ca->node_80f332a4 node_2fbbb9ca->node_4ee426cc node_56ffaa62 881: parse_google() node_56ffaa62->node_57f5a354 node_56ffaa62->node_c6cc4f5f models.py This module contains the models for storing docstrings structured data.
G cluster_4b7ab26a File: models cluster_65ce3bfc Class: DocstringSection node_c37ef598 246: as_dict() node_c37ef598->node_c37ef598 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_d076dac2 File: numpy node_82e55bb5 857: _append_section() node_7a82584d 95: _is_dash_line() node_bc911c9f 91: _is_empty_line() node_7a82584d->node_bc911c9f node_b6549395 637: _read_attributes_section() node_ab031dc4 99: _read_block_items() node_b6549395->node_ab031dc4 node_15b0f024 161: _read_block() node_15b0f024->node_7a82584d node_15b0f024->node_bc911c9f node_ab031dc4->node_7a82584d node_ab031dc4->node_bc911c9f node_7e2506e0 708: _read_classes_section() node_7e2506e0->node_ab031dc4 node_4a896598 404: _read_deprecated_section() node_4a896598->node_ab031dc4 node_f1748496 792: _read_examples_section() node_f1748496->node_bc911c9f node_f1748496->node_15b0f024 node_3ff7f99e 676: _read_functions_section() node_3ff7f99e->node_ab031dc4 node_f123e8f7 760: _read_modules_section() node_f123e8f7->node_ab031dc4 node_ac04bc73 312: _read_other_parameters_section() node_86ce731d 223: _read_parameters() node_ac04bc73->node_86ce731d node_86ce731d->node_ab031dc4 node_47192a15 297: _read_parameters_section() node_47192a15->node_86ce731d node_e5a19ad5 587: _read_raises_section() node_e5a19ad5->node_ab031dc4 node_406765c8 540: _read_receives_section() node_406765c8->node_ab031dc4 node_0669d544 430: _read_returns_section() node_0669d544->node_ab031dc4 node_9e4a8e7e 740: _read_type_aliases_section() node_9e4a8e7e->node_ab031dc4 node_1f28b70f 334: _read_type_parameters_section() node_1f28b70f->node_ab031dc4 node_75ae2f21 612: _read_warns_section() node_75ae2f21->node_ab031dc4 node_6d255451 489: _read_yields_section() node_6d255451->node_ab031dc4 node_b1b22db3 910: parse_numpy() node_b1b22db3->node_82e55bb5 node_b1b22db3->node_7a82584d node_b1b22db3->node_bc911c9f 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_8f8d7408 File: sphinx cluster_2f443d83 Class: _FieldType node_ca0e372c 52: matches() node_330b23bb 457: _consolidate_continuation_lines() node_0eee8bed 470: _consolidate_descriptive_type() node_04ae156e 209: _determine_param_annotation() node_90e4470e 202: _determine_param_default() node_8659cc88 444: _parse_directive() node_8659cc88->node_330b23bb node_f3751e94 428: _parsed_values_to_sections() node_639171f4 474: _strip_blank_lines() node_f3751e94->node_639171f4 node_1e8e9be6 275: _read_attribute() node_1e8e9be6->node_8659cc88 node_625207a7 322: _read_attribute_type() node_625207a7->node_0eee8bed node_625207a7->node_8659cc88 node_a04b5782 352: _read_exception() node_a04b5782->node_8659cc88 node_621827d9 139: _read_parameter() node_621827d9->node_04ae156e node_621827d9->node_90e4470e node_621827d9->node_8659cc88 node_99030c42 244: _read_parameter_type() node_99030c42->node_0eee8bed node_99030c42->node_8659cc88 node_cfcfce98 373: _read_return() node_cfcfce98->node_8659cc88 node_10b24ad7 407: _read_return_type() node_10b24ad7->node_0eee8bed node_10b24ad7->node_8659cc88 node_089ebef0 98: parse_sphinx() node_089ebef0->node_ca0e372c node_089ebef0->node_f3751e94 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_29ac6c5f File: encoders cluster_d561b93e Class: JSONEncoder node_8d02d607 55: __init__() node_8d02d607->node_8d02d607 node_e2a3aab0 150: _attach_parent_to_expr() node_3ef5908b 160: _attach_parent_to_exprs() node_3ef5908b->node_e2a3aab0 node_9663ae3f 274: _load_attribute() node_b59761f1 92: _load_docstring() node_9663ae3f->node_b59761f1 node_362e08a9 141: _load_git_info() node_9663ae3f->node_362e08a9 node_653d1d7c 224: _load_class() node_653d1d7c->node_3ef5908b node_890162db 98: _load_decorators() node_653d1d7c->node_890162db node_653d1d7c->node_b59761f1 node_653d1d7c->node_362e08a9 node_61d131b3 102: _load_expression() node_5cc80a28 252: _load_function() node_5cc80a28->node_890162db node_5cc80a28->node_b59761f1 node_5cc80a28->node_362e08a9 node_9ded09d3 197: _load_module() node_9ded09d3->node_3ef5908b node_9ded09d3->node_b59761f1 node_9ded09d3->node_362e08a9 node_2a81db95 122: _load_parameter() node_2a81db95->node_b59761f1 node_3ee73d9d 309: _load_type_alias() node_3ee73d9d->node_b59761f1 node_3ee73d9d->node_362e08a9 node_5a78af45 132: _load_type_parameter() node_a50276a2 339: json_decoder() node_a50276a2->node_61d131b3 node_a50276a2->node_2a81db95 node_a50276a2->node_5a78af45 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_e8abf9a0 File: expressions cluster_9bfb3285 Class: Expr cluster_1fefe5b4 Class: ExprAttribute cluster_aa9a0fb9 Class: ExprBinOp cluster_369afd91 Class: ExprBoolOp cluster_acde1c55 Class: ExprCall cluster_fcfeff3c Class: ExprCompare cluster_88e2df4c Class: ExprComprehension cluster_5d3cc4e7 Class: ExprDict cluster_19c244cb Class: ExprDictComp cluster_2d5925c8 Class: ExprExtSlice cluster_fcfda58f Class: ExprFormatted cluster_69969987 Class: ExprGeneratorExp cluster_17371120 Class: ExprIfExp cluster_456d405e Class: ExprInterpolation cluster_4a5aba8a Class: ExprJoinedStr cluster_6944e8df Class: ExprKeyword cluster_55ae6149 Class: ExprVarPositional cluster_7d560100 Class: ExprVarKeyword cluster_798ac6d6 Class: ExprLambda cluster_f9e0f0e5 Class: ExprList cluster_65c2ddc5 Class: ExprListComp cluster_721eef84 Class: ExprNamedExpr cluster_5c4b01bc Class: ExprSet cluster_c723661b Class: ExprSetComp cluster_c9eb63ae Class: ExprSlice cluster_62c3d3ad Class: ExprSubscript cluster_706be55f Class: ExprTemplateStr cluster_431cd7b8 Class: ExprTuple cluster_f6d3a013 Class: ExprUnaryOp cluster_c63ad9c1 Class: ExprYield cluster_fa64b779 Class: ExprYieldFrom node_7955c5d9 168: __iter__() node_c6c5a0ab 172: iterate() node_7955c5d9->node_c6c5a0ab node_d27ddfbd 165: __str__() node_d27ddfbd->node_c6c5a0ab node_89337adb 255: _to_binop() node_89337adb->node_89337adb node_cf57d91a 201: as_dict() node_8114da00 143: _expr_as_dict() node_cf57d91a->node_8114da00 node_b6fc1a3f 290: append() node_b6fc1a3f->node_b6fc1a3f node_88426ad3 278: iterate() node_1d6e70ba 1110: _get_precedence() node_88426ad3->node_1d6e70ba node_4864c746 66: _yield() node_88426ad3->node_4864c746 node_c7b9c409 334: iterate() node_c7b9c409->node_1d6e70ba node_c7b9c409->node_4864c746 node_f00ef75a 354: iterate() node_f00ef75a->node_1d6e70ba node_f00ef75a->node_4864c746 node_83328d5c 377: iterate() node_83328d5c->node_1d6e70ba node_4b5360ca 109: _join() node_83328d5c->node_4b5360ca node_83328d5c->node_4864c746 node_562c9ae7 395: iterate() node_562c9ae7->node_1d6e70ba node_562c9ae7->node_4864c746 node_9a2eff51 416: iterate() node_9a2eff51->node_4b5360ca node_9a2eff51->node_4864c746 node_6eb87409 452: iterate() node_6eb87409->node_4b5360ca node_32d842b7 473: iterate() node_32d842b7->node_4b5360ca node_32d842b7->node_4864c746 node_990e108b 490: iterate() node_990e108b->node_4b5360ca node_aee77067 501: iterate() node_aee77067->node_4864c746 node_8d887276 517: iterate() node_8d887276->node_4b5360ca node_8d887276->node_4864c746 node_bd8938ef 534: iterate() node_bd8938ef->node_bd8938ef node_bd8938ef->node_1d6e70ba node_bd8938ef->node_4864c746 node_286b5e0a 559: iterate() node_286b5e0a->node_4864c746 node_8c44ceef 573: iterate() node_8c44ceef->node_4b5360ca node_460d51da 613: iterate() node_460d51da->node_4864c746 node_758ddde2 652: iterate() node_758ddde2->node_4864c746 node_0079dd8d 693: iterate() node_0079dd8d->node_4b5360ca node_38e9448d 708: iterate() node_38e9448d->node_4b5360ca node_38e9448d->node_4864c746 node_a56dcf07 819: iterate() node_a56dcf07->node_4864c746 node_953b4dc3 846: iterate() node_953b4dc3->node_4b5360ca node_853d76e0 861: iterate() node_853d76e0->node_4b5360ca node_853d76e0->node_4864c746 node_072437f4 880: iterate() node_072437f4->node_4864c746 node_ab8830eb 900: iterate() node_ab8830eb->node_1d6e70ba node_ab8830eb->node_4864c746 node_bf6199e7 907: modernize() node_bf6199e7->node_89337adb node_bf6199e7->node_bf6199e7 node_e5b3019c 940: iterate() node_e5b3019c->node_4b5360ca node_d4cc6ece 955: iterate() node_d4cc6ece->node_4b5360ca node_40d95b0d 980: iterate() node_40d95b0d->node_1d6e70ba node_40d95b0d->node_4864c746 node_e392e584 638: iterate() node_e392e584->node_4864c746 node_9f7bd7b0 626: iterate() node_9f7bd7b0->node_4864c746 node_6e594c44 994: iterate() node_6e594c44->node_4864c746 node_670b57e1 1008: iterate() node_670b57e1->node_4864c746 node_177a4087 1420: _build() node_4805ad4d 1114: _build_attribute() node_4805ad4d->node_b6fc1a3f node_4805ad4d->node_177a4087 node_32437d8b 1126: _build_binop() node_32437d8b->node_177a4087 node_016ab60c 1134: _build_boolop() node_016ab60c->node_177a4087 node_5e607230 1141: _build_call() node_5e607230->node_177a4087 node_39e199c2 1148: _build_compare() node_39e199c2->node_177a4087 node_787386ad 1156: _build_comprehension() node_787386ad->node_177a4087 node_bc0d2c15 1165: _build_constant() node_bc0d2c15->node_177a4087 node_91e87653 1204: _build_dict() node_91e87653->node_177a4087 node_5448b4fa 1211: _build_dictcomp() node_5448b4fa->node_177a4087 node_717a6f88 1219: _build_formatted() node_717a6f88->node_177a4087 node_79af8b44 1229: _build_generatorexp() node_79af8b44->node_177a4087 node_b4207573 1236: _build_ifexp() node_b4207573->node_177a4087 node_895a1ca1 1402: _build_interpolation() node_895a1ca1->node_177a4087 node_b38c840e 1244: _build_joinedstr() node_b38c840e->node_177a4087 node_98aa332f 1254: _build_keyword() node_98aa332f->node_177a4087 node_2681a46f 1260: _build_lambda() node_2681a46f->node_177a4087 node_9f02e28e 1454: safe_get_expression() node_2681a46f->node_9f02e28e node_c83d298c 1277: _build_list() node_c83d298c->node_177a4087 node_6f208f6d 1281: _build_listcomp() node_6f208f6d->node_177a4087 node_f5aab5ce 1289: _build_named_expr() node_f5aab5ce->node_177a4087 node_923d209f 1293: _build_set() node_923d209f->node_177a4087 node_ef026d26 1297: _build_setcomp() node_ef026d26->node_177a4087 node_5aca75a3 1301: _build_slice() node_5aca75a3->node_177a4087 node_7689fd90 1309: _build_starred() node_7689fd90->node_177a4087 node_6c5f7969 1313: _build_subscript() node_6c5f7969->node_177a4087 node_0b3f7912 1405: _build_templatestr() node_0b3f7912->node_177a4087 node_e3a33cbc 1342: _build_tuple() node_e3a33cbc->node_177a4087 node_c28edc23 1353: _build_unaryop() node_c28edc23->node_177a4087 node_211bc63b 1357: _build_yield() node_211bc63b->node_177a4087 node_019c4b12 1361: _build_yield_from() node_019c4b12->node_177a4087 node_e02d9c5c 132: _field_as_dict() node_8114da00->node_e02d9c5c node_e02d9c5c->node_e02d9c5c node_4b5360ca->node_4864c746 node_4864c746->node_1d6e70ba node_4864c746->node_4864c746 node_b9b95963 1424: get_expression() node_b9b95963->node_177a4087 node_9f02e28e->node_b9b95963 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_659e1416 File: base cluster_b8e61b7f Class: Extension cluster_ba8cf248 Class: Extensions node_27739016 56: generic_inspect() node_1cafc5ef 48: inspect() node_27739016->node_1cafc5ef node_986df5b5 39: generic_visit() node_2699ec3a 31: visit() node_986df5b5->node_2699ec3a node_fb015d8b 411: on_alias() node_d14cbab6 387: on_alias_instance() node_d14cbab6->node_fb015d8b node_a94417c8 445: __init__() node_046a223e 454: add() node_a94417c8->node_046a223e node_99a1e6ce 495: _load_extension() node_72d8f842 484: _load_extension_path() node_99a1e6ce->node_72d8f842 node_c7afee42 586: load_extensions() node_c7afee42->node_a94417c8 node_c7afee42->node_046a223e node_c7afee42->node_99a1e6ce dataclasses.py Built-in extension adding support for dataclasses.
This extension re-creates __init__ methods of dataclasses during static analysis.
G cluster_0a13a8cf File: dataclasses cluster_cea6db65 Class: DataclassesExtension node_8fdcae7d 227: on_package() node_00b85751 203: _apply_recursively() node_8fdcae7d->node_00b85751 node_00b85751->node_00b85751 node_51a1246a 195: _del_members_annotated_as_initvar() node_00b85751->node_51a1246a node_0c355a75 157: _set_dataclass_init() node_00b85751->node_0c355a75 node_edfc4530 49: _dataclass_arguments() node_a630703c 25: _dataclass_decorator() node_edfc4530->node_a630703c node_0eb0e7dd 32: _expr_args() node_edfc4530->node_0eb0e7dd node_efb32bbd 66: _dataclass_parameters() node_efb32bbd->node_edfc4530 node_87771472 55: _field_arguments() node_efb32bbd->node_87771472 node_0eb0e7dd->node_0eb0e7dd node_87771472->node_0eb0e7dd node_f2d1e988 139: _reorder_parameters() node_0c355a75->node_a630703c node_0c355a75->node_efb32bbd node_0c355a75->node_f2d1e988 unpack_typeddict.py Todo
Support extra_items=type. TODO: Support closed=True/False.
G cluster_f234d53e File: unpack_typeddict cluster_aa5c05b7 Class: UnpackTypedDictExtension node_7051e33b 191: on_class() node_5e6a3dcc 65: _get_or_set_attrs() node_7051e33b->node_5e6a3dcc node_30f19f48 170: _params_from_attrs() node_7051e33b->node_30f19f48 node_a71719e9 109: _update_docstring() node_7051e33b->node_a71719e9 node_e1b911f0 218: on_function() node_e1b911f0->node_5e6a3dcc node_e1b911f0->node_30f19f48 node_e1b911f0->node_a71719e9 node_582f68f4 29: _unwrap_annotation() node_5e6a3dcc->node_582f68f4 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_3427135b File: finder cluster_d41daa37 Class: ModuleFinder node_4b8846c6 102: __init__() node_af3c3349 384: _extend_from_pth_files() node_4b8846c6->node_af3c3349 node_76b1e1ff 119: append_search_path() node_4b8846c6->node_76b1e1ff node_0a5cdff7 130: _append_search_path() node_a0eaac0a 376: _contents() node_af3c3349->node_a0eaac0a node_af3c3349->node_76b1e1ff node_70c22b9c 440: _handle_pth_file() node_af3c3349->node_70c22b9c node_3c9c145c 393: _filter_py_modules() node_0bb2cfb7 361: _module_name_path() node_408751e4 401: _top_module_name() node_9e981988 134: insert_search_path() node_408751e4->node_9e981988 node_76b1e1ff->node_0a5cdff7 node_c1c1c8da 231: find_package() node_c1c1c8da->node_a0eaac0a node_35c1d791 425: _is_pkg_style_namespace() node_c1c1c8da->node_35c1d791 node_ad889b12 148: find_spec() node_ad889b12->node_0bb2cfb7 node_ad889b12->node_408751e4 node_ad889b12->node_c1c1c8da node_1ce712d4 278: iter_submodules() node_1ce712d4->node_3c9c145c node_1ce712d4->node_1ce712d4 node_bc0f9067 344: submodules() node_bc0f9067->node_1ce712d4 node_954b3c72 470: _handle_editable_module() node_5f3e2f94 51: _match_pattern() node_954b3c72->node_5f3e2f94 node_70c22b9c->node_954b3c72 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_62f9b7d4 File: git cluster_3f8b912e Class: GitInfo node_0f0a5e23 241: from_package() node_0b5ba495 217: _get_git_commit_hash() node_0f0a5e23->node_0b5ba495 node_74923535 163: _get_git_known_service() node_0f0a5e23->node_74923535 node_3966aead 137: _get_git_remote_url() node_0f0a5e23->node_3966aead node_06f74104 87: _get_repo_root() node_0f0a5e23->node_06f74104 node_1d2fb7c2 223: _is_tracked() node_0f0a5e23->node_1d2fb7c2 node_449f1906 265: get_source_link() node_dada803b 204: _get_source_link() node_449f1906->node_dada803b node_22ad1a7c 50: _assert_git_repo() node_a1a34f75 36: _git() node_22ad1a7c->node_a1a34f75 node_0b5ba495->node_a1a34f75 node_3966aead->node_a1a34f75 node_054f8be5 67: _get_latest_tag() node_054f8be5->node_a1a34f75 node_06f74104->node_a1a34f75 node_1d2fb7c2->node_a1a34f75 node_d85c1786 30: _normalize() node_17d41b1b 104: _tmp_worktree() node_17d41b1b->node_22ad1a7c node_17d41b1b->node_a1a34f75 node_17d41b1b->node_d85c1786 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_9d4375c3 File: importer node_ef5fc6f7 17: _error_details() node_708a61e7 43: dynamic_import() node_708a61e7->node_ef5fc6f7 node_d3cbdff2 22: sys_path() node_708a61e7->node_d3cbdff2 loader.py This module contains all the logic for loading API data from sources or compiled modules.
G cluster_6459bae2 File: loader cluster_e40cb0cc Class: GriffeLoader node_d42aa953 53: __init__() node_45e23c9e 653: _create_module() node_f11eb59d 738: _expand_wildcard() node_8c65d574 197: _fire_load_events() node_8c65d574->node_8c65d574 node_097063b2 708: _get_or_create_parent_module() node_097063b2->node_45e23c9e node_715b9fd6 681: _inspect_module() node_af30e1e5 554: _load_module() node_ed233959 573: _load_module_path() node_af30e1e5->node_ed233959 node_ed233959->node_45e23c9e node_ed233959->node_715b9fd6 node_bc783db3 598: _load_submodules() node_ed233959->node_bc783db3 node_0930fc5b 661: _visit_module() node_ed233959->node_0930fc5b node_e30e8e4d 539: _load_package() node_e30e8e4d->node_af30e1e5 node_51b8008b 334: expand_wildcards() node_e30e8e4d->node_51b8008b node_537b0da7 602: _load_submodule() node_537b0da7->node_097063b2 node_537b0da7->node_af30e1e5 node_bc783db3->node_537b0da7 node_1eb151f2 216: _post_load() node_1eb151f2->node_8c65d574 node_3f6aad2d 293: expand_exports() node_1eb151f2->node_3f6aad2d node_1eb151f2->node_51b8008b node_3f6aad2d->node_3f6aad2d node_51b8008b->node_f11eb59d node_51b8008b->node_51b8008b node_2d19f009 105: load() node_51b8008b->node_2d19f009 node_2d19f009->node_715b9fd6 node_2d19f009->node_e30e8e4d node_2d19f009->node_1eb151f2 node_1582b5f8 237: resolve_aliases() node_1582b5f8->node_51b8008b node_3ec09f49 450: resolve_module_aliases() node_1582b5f8->node_3ec09f49 node_3ec09f49->node_2d19f009 node_3ec09f49->node_3ec09f49 node_1bed6ca8 747: load() node_1bed6ca8->node_d42aa953 node_1bed6ca8->node_2d19f009 node_1bed6ca8->node_1582b5f8 node_3edcd166 852: load_git() node_3edcd166->node_1bed6ca8 node_66ced7de 937: load_pypi() node_66ced7de->node_1bed6ca8 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_d5a4d1f6 File: logger cluster_99eb7abe Class: Logger node_1ccd323d 0: (global)() node_8b4cb1a6 43: _get() node_1ccd323d->node_8b4cb1a6 node_7b52d842 49: _patch_loggers() node_98a9b31b 93: get_logger() node_98a9b31b->node_8b4cb1a6 node_4a6df56a 105: patch_loggers() node_4a6df56a->node_7b52d842 merger.py This module contains utilities to merge stubs data and concrete data.
G cluster_923cc648 File: merger node_dc9d8b2c 70: _merge_annotations() node_7cd01504 40: _merge_attribute_stubs() node_218b6905 52: _merge_stubs_docstring() node_7cd01504->node_218b6905 node_84f6d4d9 24: _merge_class_stubs() node_84f6d4d9->node_218b6905 node_a1490388 103: _merge_stubs_members() node_84f6d4d9->node_a1490388 node_7c804c33 62: _merge_stubs_overloads() node_84f6d4d9->node_7c804c33 node_9c3ee34b 57: _merge_stubs_type_parameters() node_84f6d4d9->node_9c3ee34b node_02784ee2 31: _merge_function_stubs() node_02784ee2->node_218b6905 node_02784ee2->node_9c3ee34b node_ff88e9ec 18: _merge_module_stubs() node_ff88e9ec->node_218b6905 node_ff88e9ec->node_a1490388 node_ff88e9ec->node_7c804c33 node_ddd73671 78: _merge_overload_annotations() node_ddd73671->node_dc9d8b2c node_a1490388->node_7cd01504 node_a1490388->node_02784ee2 node_e603cde7 47: _merge_type_alias_stubs() node_a1490388->node_e603cde7 node_7c804c33->node_ddd73671 node_e603cde7->node_218b6905 node_e603cde7->node_9c3ee34b node_af75c123 147: merge_stubs() node_af75c123->node_ff88e9ec mixins.py This module contains some mixins classes that hold shared methods of the different kinds of objects, and aliases.
G cluster_68c1b5c9 File: mixins cluster_a5be19f9 Class: GetMembersMixin cluster_1c5fd058 Class: DelMembersMixin cluster_eefe647a Class: SetMembersMixin node_d1a26223 87: __delitem__() node_9a139025 22: _get_parts() node_d1a26223->node_9a139025 node_c1471182 114: del_member() node_c1471182->node_c1471182 node_c1471182->node_9a139025 node_a66e4c42 37: __getitem__() node_a66e4c42->node_9a139025 node_a8d73f80 59: get_member() node_a8d73f80->node_a8d73f80 node_a8d73f80->node_9a139025 node_f14f36e8 142: __setitem__() node_f14f36e8->node_9a139025 node_f6356260 168: set_member() node_f6356260->node_f6356260 node_f6356260->node_9a139025 models.py This module contains our models definitions, to represent Python objects (and other aspects of Python APIs)... in Python.
G cluster_1d2adbaf File: models cluster_7edc07ea Class: Docstring cluster_3b6004fe Class: Parameter cluster_85f3ca61 Class: Parameters cluster_db93d6a9 Class: TypeParameters cluster_4ebb3fd0 Class: Object cluster_45cdc5f5 Class: Alias cluster_c8ed0c52 Class: Class cluster_1c64b9d2 Class: Function node_0fb72020 1350: __init__() node_32a588a9 2167: _update_target_aliases() node_0fb72020->node_32a588a9 node_bded12d8 2151: _resolve_target() node_6a1f0b88 2118: resolve_target() node_bded12d8->node_6a1f0b88 node_21f8ec89 1541: as_json() node_21f8ec89->node_21f8ec89 node_88cdb8b2 1777: filter_members() node_88cdb8b2->node_88cdb8b2 node_a617f835 1764: has_labels() node_a617f835->node_a617f835 node_89f06011 1519: inherited_members() node_89f06011->node_0fb72020 node_364ea2c7 1677: is_kind() node_364ea2c7->node_364ea2c7 node_ef5f6840 1499: members() node_ef5f6840->node_0fb72020 node_b19b37d6 1480: parent() node_b19b37d6->node_32a588a9 node_ebd0cc82 1886: resolve() node_ebd0cc82->node_ebd0cc82 node_2f0b81aa 2069: target() node_2f0b81aa->node_6a1f0b88 node_2d1dc2c0 2451: _mro() node_2d1dc2c0->node_2d1dc2c0 node_e6d4b3de 2462: mro() node_e6d4b3de->node_2d1dc2c0 node_64131791 2399: parameters() node_cc8bb453 308: __init__() node_64131791->node_cc8bb453 node_ad5060c5 165: parse() node_8f27a4f5 161: parsed() node_8f27a4f5->node_ad5060c5 node_b8f49d76 2492: __init__() node_b8f49d76->node_cc8bb453 node_e602ec59 579: __init__() node_6c7c6976 488: __init__() node_e602ec59->node_6c7c6976 node_dede23cd 821: inherited_members() node_dede23cd->node_0fb72020 node_f28e4058 1197: resolve() node_f28e4058->node_f28e4058 node_b701b88f 274: as_dict() node_b701b88f->node_b701b88f stats.py This module contains utilities to compute loading statistics, like time spent visiting modules statically or dynamically.
G cluster_ee63b476 File: stats cluster_028a33f7 Class: Stats node_7c50e5df 20: __init__() node_19028da2 74: _itercount() node_7c50e5df->node_19028da2 node_19028da2->node_19028da2 tests.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_c959d899 File: tests node_817615e7 403: module_vtree() node_0c4ee759 360: vtree() node_817615e7->node_0c4ee759 node_7e627166 309: temporary_inspected_module() node_5ef581ef 54: temporary_pyfile() node_7e627166->node_5ef581ef node_4f282b7f 189: temporary_inspected_package() node_d21ac4ac 72: temporary_pypackage() node_4f282b7f->node_d21ac4ac node_bcf0433f 263: temporary_visited_module() node_bcf0433f->node_5ef581ef node_e683c97b 121: temporary_visited_package() node_e683c97b->node_d21ac4ac