
    geE                    x   d Z ddlmZ ddlmZmZ ddlmZmZm	Z	 ddl
mZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZmZ ddlmZ dd	lmZmZ dd
lm Z  ddl!m"Z"m#Z# ddl$m%Z%m&Z&m'Z'm(Z(m)Z) ddl*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0m1Z1 ddl2m3Z3m4Z4 ddl5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZC ddlDmEZE ddlFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZd ddlemfZf ddlgmhZhmiZimjZjmkZkmlZlmmZm ddlnmoZo ddlpmqZqmrZr ddlsmtZtmuZu ddlvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZmZmZ ddlmZ ddlmZmZmZmZmZ ddlmZmZmZmZ ddlmZmZ dd lmZmZmZmZ dd!lmZmZmZmZ dd"lmZ dd#lmZmZmZmZmZ dd$lmZmZmZmZmZmZmZmZmZmZ dd%lmZ dd&lmZmZmZmZmZmZmZmZmZmZ g d'Zy())aE  Griffe package.

Signatures for entire Python programs.
Extract the structure, the frame, the skeleton of your project,
to generate API documentation or find breaking changes in your API.

The entirety of the public API is exposed here, in the top-level `griffe` module.

All messages written to standard output or error are logged using the `logging` module.
Our logger's name is set to `"griffe"` and is public (you can rely on it).
You can obtain the logger from the standard `logging` module: `logging.getLogger("griffe")`.
Actual logging messages are not part of the public API (they might change without notice).

Raised exceptions throughout the package are part of the public API (you can rely on them).
Their actual messages are not part of the public API (they might change without notice).

The following paragraphs will help you discover the package's content.

## CLI entrypoints

Griffe provides a command-line interface (CLI) to interact with the package. The CLI entrypoints can be called from Python code.

- [`griffe.main`][]: Run the main program.
- [`griffe.check`][]: Check for API breaking changes in two versions of the same package.
- [`griffe.dump`][]: Load packages data and dump it as JSON.

## Loaders

To load API data, Griffe provides several high-level functions.

- [`griffe.load`][]: Load and return a Griffe object.
- [`griffe.load_git`][]: Load and return a module from a specific Git reference.
- [`griffe.load_pypi`][]: Load and return a module from a specific package version downloaded using pip.

## Models

The data loaded by Griffe is represented by several classes.

- [`griffe.Module`][]: The class representing a Python module.
- [`griffe.Class`][]: The class representing a Python class.
- [`griffe.Function`][]: The class representing a Python function or method.
- [`griffe.Attribute`][]: The class representing a Python attribute.
- [`griffe.Alias`][]: This class represents an alias, or indirection, to an object declared in another module.

Additional classes are available to represent other concepts.

- [`griffe.Decorator`][]: This class represents a decorator.
- [`griffe.Parameters`][]: This class is a container for parameters.
- [`griffe.Parameter`][]: This class represent a function parameter.

## Agents

Griffe is able to analyze code both statically and dynamically, using the following "agents".
However most of the time you will only need to use the loaders above.

- [`griffe.visit`][]: Parse and visit a module file.
- [`griffe.inspect`][]: Inspect a module.

## Serializers

Griffe can serizalize data to dictionary and JSON.

- [`griffe.Object.as_json`][griffe.Object.as_json]
- [`griffe.Object.from_json`][griffe.Object.from_json]
- [`griffe.JSONEncoder`][]: JSON encoder for Griffe objects.
- [`griffe.json_decoder`][]: JSON decoder for Griffe objects.

## API checks

Griffe can compare two versions of the same package to find breaking changes.

- [`griffe.find_breaking_changes`][]: Find breaking changes between two versions of the same API.
- [`griffe.Breakage`][]: Breakage classes can explain what broke from a version to another.

## Extensions

Griffe supports extensions. You can create your own extension by subclassing the `griffe.Extension` class.

- [`griffe.load_extensions`][]: Load configured extensions.
- [`griffe.Extension`][]: Base class for Griffe extensions.

## Docstrings

Griffe can parse docstrings into structured data.

Main class:

- [`griffe.Docstring`][]: This class represents docstrings.

Docstring section and element classes all start with `Docstring`.

Docstring parsers:

- [`griffe.parse`][]: Parse the docstring.
- [`griffe.parse_auto`][]: Parse a docstring by automatically detecting the style it uses.
- [`griffe.parse_google`][]: Parse a Google-style docstring.
- [`griffe.parse_numpy`][]: Parse a Numpydoc-style docstring.
- [`griffe.parse_sphinx`][]: Parse a Sphinx-style docstring.

## Exceptions

Griffe uses several exceptions to signal errors.

- [`griffe.GriffeError`][]: The base exception for all Griffe errors.
- [`griffe.LoadingError`][]: Exception for loading errors.
- [`griffe.NameResolutionError`][]: Exception for names that cannot be resolved in a object scope.
- [`griffe.UnhandledEditableModuleError`][]: Exception for unhandled editables modules, when searching modules.
- [`griffe.UnimportableModuleError`][]: Exception for modules that cannot be imported.
- [`griffe.AliasResolutionError`][]: Exception for aliases that cannot be resolved.
- [`griffe.CyclicAliasError`][]: Exception raised when a cycle is detected in aliases.
- [`griffe.LastNodeError`][]: Exception raised when trying to access a next or previous node.
- [`griffe.RootNodeError`][]: Exception raised when trying to use siblings properties on a root node.
- [`griffe.BuiltinModuleError`][]: Exception raised when trying to access the filepath of a builtin module.
- [`griffe.ExtensionError`][]: Base class for errors raised by extensions.
- [`griffe.ExtensionNotLoadedError`][]: Exception raised when an extension could not be loaded.
- [`griffe.GitError`][]: Exception raised for errors related to Git.

# Expressions

Griffe stores snippets of code (attribute values, decorators, base class, type annotations) as expressions.
Expressions are basically abstract syntax trees (AST) with a few differences compared to the nodes returned by [`ast`][].
Griffe provides a few helpers to extract expressions from regular AST nodes.

- [`griffe.get_annotation`][]: Get a type annotation as expression.
- [`griffe.get_base_class`][]: Get a base class as expression.
- [`griffe.get_condition`][]: Get a condition as expression.
- [`griffe.get_expression`][]: Get an expression from an AST node.
- [`griffe.safe_get_annotation`][]: Get a type annotation as expression, safely (returns `None` on error).
- [`griffe.safe_get_base_class`][]: Get a base class as expression, safely (returns `None` on error).
- [`griffe.safe_get_condition`][]: Get a condition as expression, safely (returns `None` on error).
- [`griffe.safe_get_expression`][]: Get an expression from an AST node, safely (returns `None` on error).

The base class for expressions.

- [`griffe.Expr`][]

Expression classes all start with `Expr`.

# Loggers

If you want to log messages from extensions, get a logger with `get_logger`.
The `logger` attribute is used by Griffe itself. You can use it to temporarily disable Griffe logging.

- [`griffe.logger`][]: Our global logger, used throughout the library.
- [`griffe.get_logger`][]: Create and return a new logger instance.

# Helpers

To test your Griffe extensions, or to load API data from code in memory, Griffe provides the following helpers.

- [`griffe.temporary_pyfile`][]: Create a Python file containing the given code in a temporary directory.
- [`griffe.temporary_pypackage`][]: Create a package containing the given modules in a temporary directory.
- [`griffe.temporary_visited_module`][]: Create and visit a temporary module with the given code.
- [`griffe.temporary_visited_package`][]: Create and visit a temporary package.
- [`griffe.temporary_inspected_module`][]: Create and inspect a temporary module with the given code.
- [`griffe.temporary_inspected_package`][]: Create and inspect a temporary package.
    )annotations)	Inspectorinspect)get_instance_namesget_name	get_names)	ast_childrenast_first_childast_kindast_last_childast_nextast_next_siblingsast_previousast_previous_siblingsast_siblings)get_docstring)ExportedName
get__all__safe_get__all__)relative_to_absolute)ParametersTypeget_parameters)
ObjectNode)	get_valuesafe_get_value)Visitorbuiltin_decoratorsstdlib_decoratorstyping_overloadvisit)c3linear_merge)DEFAULT_LOG_LEVELcheckdump
get_parsermain)LinesCollectionModulesCollection)AttributeChangedTypeBreakageAttributeChangedValueBreakageBreakageClassRemovedBaseBreakageObjectChangedKindBreakageObjectRemovedBreakageParameterAddedRequiredBreakageParameterChangedDefaultBreakageParameterChangedKindBreakage ParameterChangedRequiredBreakageParameterMovedBreakageParameterRemovedBreakageReturnChangedTypeBreakagefind_breaking_changes)parse_google)DocstringAdmonitionDocstringAttributeDocstringClassDocstringDeprecatedDocstringElementDocstringFunctionDocstringModuleDocstringNamedElementDocstringParameterDocstringRaiseDocstringReceiveDocstringReturnDocstringSectionDocstringSectionAdmonitionDocstringSectionAttributesDocstringSectionClassesDocstringSectionDeprecatedDocstringSectionExamplesDocstringSectionFunctionsDocstringSectionModulesDocstringSectionOtherParametersDocstringSectionParametersDocstringSectionRaisesDocstringSectionReceivesDocstringSectionReturnsDocstringSectionTextDocstringSectionWarnsDocstringSectionYieldsDocstringWarnDocstringYield)parse_numpy)DocstringDetectionMethodDocstringStyleinfer_docstring_styleparse
parse_autoparsers)parse_sphinx)docstring_warningparse_docstring_annotation)JSONEncoderjson_decoder)BreakageKindDocstringSectionKindExplanationStyleKindLogLevel
ObjectKindParameterKindParser)AliasResolutionErrorBuiltinModuleErrorCyclicAliasErrorExtensionErrorExtensionNotLoadedErrorGitErrorGriffeErrorLastNodeErrorLoadingErrorNameResolutionErrorRootNodeErrorUnhandledEditableModuleErrorUnimportableModuleError)(ExprExprAttribute	ExprBinOp
ExprBoolOpExprCallExprCompareExprComprehensionExprConstantExprDictExprDictCompExprExtSliceExprFormattedExprGeneratorExp	ExprIfExpExprJoinedStrExprKeyword
ExprLambdaExprListExprListCompExprNameExprNamedExprExprParameterExprSetExprSetComp	ExprSliceExprSubscript	ExprTupleExprUnaryOpExprVarKeywordExprVarPositional	ExprYieldExprYieldFromget_annotationget_base_classget_conditionget_expressionsafe_get_annotationsafe_get_base_classsafe_get_conditionsafe_get_expression)	Extension
ExtensionsLoadableExtensionTypebuiltin_extensionsload_extensions)DataclassesExtension)ModuleFinderNamePartsAndPathTypeNamePartsTypeNamespacePackagePackage)assert_git_repoget_latest_tagget_repo_roottmp_worktree)dynamic_importsys_path)GriffeLoaderloadload_git	load_pypi)Logger
get_loggerloggerpatch_loggers)merge_stubs)DelMembersMixinGetMembersMixinObjectAliasMixinSerializationMixinSetMembersMixin)
Alias	AttributeClass	Decorator	DocstringFunctionModuleObject	Parameter
Parameters)Stats)

TmpPackagehtreemodule_vtreetemporary_inspected_moduletemporary_inspected_packagetemporary_pyfiletemporary_pypackagetemporary_visited_moduletemporary_visited_packagevtree)r"   r   rj   r   r)   r*   r+   rb   rk   r   r,   rl   r   r   r   r   r8   r9   r:   r;   rW   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rc   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rX   rT   rU   rd   r   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rm   rn   r   r   r   ro   rp   r   r   r`   re   rq   r'   r   rr   rf   r   r   r   r(   r   r   rs   r   r   r   r-   rg   r   r.   r   r   r/   r0   r1   r2   rh   r3   r4   r   r   ri   r5   rt   r   r   r   r   ru   rv   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r!   r#   r^   r$   r   r6   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   r   r   rY   r   ra   r   r   r   r   r   r&   r   r   rZ   r[   r_   r7   rV   r]   r\   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r   N)__doc__
__future__r   _griffe.agents.inspectorr   r    _griffe.agents.nodes.assignmentsr   r   r   _griffe.agents.nodes.astr	   r
   r   r   r   r   r   r   r   _griffe.agents.nodes.docstringsr   _griffe.agents.nodes.exportsr   r   r   _griffe.agents.nodes.importsr   _griffe.agents.nodes.parametersr   r   _griffe.agents.nodes.runtimer   _griffe.agents.nodes.valuesr   r   _griffe.agents.visitorr   r   r   r   r    _griffe.c3linearr!   _griffe.clir"   r#   r$   r%   r&   _griffe.collectionsr'   r(   _griffe.diffr)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   _griffe.docstrings.googler7   _griffe.docstrings.modelsr8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   _griffe.docstrings.numpyrV   _griffe.docstrings.parsersrW   rX   rY   rZ   r[   r\   _griffe.docstrings.sphinxr]   _griffe.docstrings.utilsr^   r_   _griffe.encodersr`   ra   _griffe.enumerationsrb   rc   rd   re   rf   rg   rh   ri   _griffe.exceptionsrj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   _griffe.expressionsrw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   _griffe.extensions.baser   r   r   r   r   _griffe.extensions.dataclassesr   _griffe.finderr   r   r   r   r   _griffe.gitr   r   r   r   _griffe.importerr   r   _griffe.loaderr   r   r   r   _griffe.loggerr   r   r   r   _griffe.mergerr   _griffe.mixinsr   r   r   r   r   _griffe.modelsr   r   r   r   r   r   r   r   r   r   _griffe.statsr   _griffe.testsr   r   r   r   r   r   r   r   r   r   __all__     D/var/www/openai/venv/lib/python3.12/site-packages/griffe/__init__.py<module>r      so  
\| # 7 T T
 
 
 : S R = J 3 A i i + H H B     3       @ 1  3 R 6	 	 	   ) ) ) ) ) ) ) ) ) ) )T  @ g g T T 5 B B D D &       "Qr   