From 22b4a6539773cc4bf1844b034a7c3a4fbedf0f7c Mon Sep 17 00:00:00 2001 From: rahlk <1433964+rahlk@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:10:44 +0000 Subject: [PATCH] docs(api): sync Python API reference to python-sdk 1.4.3 --- src/content/docs/reference/python-api/core.md | 4 +-- src/content/docs/reference/python-api/java.md | 26 +++++++++---------- .../docs/reference/python-api/python.md | 20 ++++++++++---- .../docs/reference/python-api/typescript.md | 4 +-- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/content/docs/reference/python-api/core.md b/src/content/docs/reference/python-api/core.md index 088bae8..92241af 100644 --- a/src/content/docs/reference/python-api/core.md +++ b/src/content/docs/reference/python-api/core.md @@ -140,9 +140,9 @@ The full generated reference follows. -[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.0](https://img.shields.io/badge/cldk-1.4.0-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.0/) +[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.3](https://img.shields.io/badge/cldk-1.4.3-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.3/) -_API reference generated from cldk 1.4.0._ +_API reference generated from cldk 1.4.3._ Core CLDK module. diff --git a/src/content/docs/reference/python-api/java.md b/src/content/docs/reference/python-api/java.md index 35d4351..a1127ff 100644 --- a/src/content/docs/reference/python-api/java.md +++ b/src/content/docs/reference/python-api/java.md @@ -106,9 +106,9 @@ follows. -[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.0](https://img.shields.io/badge/cldk-1.4.0-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.0/) +[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.3](https://img.shields.io/badge/cldk-1.4.3-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.3/) -_API reference generated from cldk 1.4.0._ +_API reference generated from cldk 1.4.3._ ## Analysis @@ -647,7 +647,7 @@ any inclusion substring AND does not contain any exclusion substring. ##### `JavaAnalysis.get_class` ```python -get_class(qualified_class_name: str) -> JType +get_class(qualified_class_name: str) -> JType | None ``` Return a specific class by its qualified name. @@ -663,9 +663,9 @@ methods, fields, annotations, modifiers, and inheritance information. **Returns:** -- `JType`: class:`~cldk.models.java.JType` object containing all analyzed -- `JType`: information about the class. Returns ``None`` if the class is not -- `JType`: found in the analyzed project. +- `JType \| None`: class:`~cldk.models.java.JType` object containing all analyzed +- `JType \| None`: information about the class. Returns ``None`` if the class is not +- `JType \| None`: found in the analyzed project. > **See Also** > `get_classes`: For all classes in the project. @@ -674,7 +674,7 @@ methods, fields, annotations, modifiers, and inheritance information. ##### `JavaAnalysis.get_method` ```python -get_method(qualified_class_name: str, qualified_method_name: str) -> JCallable +get_method(qualified_class_name: str, qualified_method_name: str) -> JCallable | None ``` Return a specific method by class and method signature. @@ -691,9 +691,9 @@ signature, parameters, return type, annotations, body, and metrics. **Returns:** -- `JCallable`: class:`~cldk.models.java.JCallable` object containing all -- `JCallable`: analyzed information about the method. Returns ``None`` if the -- `JCallable`: method is not found. +- `JCallable \| None`: class:`~cldk.models.java.JCallable` object containing all +- `JCallable \| None`: analyzed information about the method. Returns ``None`` if the +- `JCallable \| None`: method is not found. > **See Also** > `get_methods_in_class`: For all methods of a class. @@ -729,7 +729,7 @@ signature. ##### `JavaAnalysis.get_java_file` ```python -get_java_file(qualified_class_name: str) -> str +get_java_file(qualified_class_name: str) -> str | None ``` Return the file path containing a class with the given name. @@ -746,8 +746,8 @@ to source files. **Returns:** -- `str`: The file path (as a string) containing the class definition. -- `str`: Returns ``None`` if no class with the given name is found. +- `str \| None`: The file path (as a string) containing the class definition. +- `str \| None`: Returns ``None`` if no class with the given name is found. > **See Also** > `get_class`: To get the full class object by name. diff --git a/src/content/docs/reference/python-api/python.md b/src/content/docs/reference/python-api/python.md index 79c1bd1..a3a2636 100644 --- a/src/content/docs/reference/python-api/python.md +++ b/src/content/docs/reference/python-api/python.md @@ -123,9 +123,9 @@ follows. -[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.0](https://img.shields.io/badge/cldk-1.4.0-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.0/) +[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.3](https://img.shields.io/badge/cldk-1.4.3-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.3/) -_API reference generated from cldk 1.4.0._ +_API reference generated from cldk 1.4.3._ ## Analysis @@ -679,23 +679,28 @@ methods (like ``__init__``, ``__str__``, etc.). get_method(qualified_class_name: str, qualified_method_name: str) -> PyCallable | None ``` -Return a specific method by class and method name. +Return a specific method or module-level function by scope and name. Retrieves detailed information about a single method, including its signature, parameters, return type, decorators, and body. +``qualified_class_name`` is looked up the same way as +`get_all_methods_in_application`'s outer keys: a class signature resolves to that +class's methods, and a module name (``PyModule.module_name``) resolves to that module's +top-level functions. + **Parameters:** | Name | Type | Description | | ---- | ---- | ----------- | -| `qualified_class_name` | `str` | The fully qualified name of the class containing the method (e.g., ``"mypackage.models.User"``). | +| `qualified_class_name` | `str` | The fully qualified name of the class containing the method (e.g., ``"mypackage.models.User"``), or a module name for module-level functions. | | `qualified_method_name` | `str` | The name of the method to retrieve (e.g., ``"save"`` or ``"__init__"``). | **Returns:** - `PyCallable \| None`: class:`~cldk.models.python.PyCallable` object containing - `PyCallable \| None`: all analyzed information about the method, or ``None`` if -- `PyCallable \| None`: the method is not found. +- `PyCallable \| None`: neither a matching class nor a matching module resolves. > **See Also** > `get_methods_in_class`: For all methods of a class. @@ -1320,6 +1325,8 @@ Represents a Python application. | `symbol_table` | `Dict[str, PyModule]` | | | `call_graph` | `List[PyCallEdge]` | | | `external_symbols` | `Dict[str, PyExternalSymbol]` | | +| `analyzer` | `Optional[PyAnalyzerInfo]` | | +| `repository` | `Optional[PyRepositoryInfo]` | | ### `PyCallEdge` @@ -1437,6 +1444,7 @@ Represents a Python call site (function or method invocation) with contextual me | `receiver_expr` | `Optional[str]` | | | `receiver_type` | `Optional[str]` | | | `argument_types` | `List[str]` | | +| `arguments` | `List[PyCallArgument]` | | | `return_type` | `Optional[str]` | | | `callee_signature` | `Optional[str]` | | | `is_constructor_call` | `bool` | | @@ -1482,6 +1490,7 @@ Represents a Python class attribute. | ---- | ---- | ----------- | | `name` | `str` | | | `type` | `Optional[str]` | | +| `initializer` | `Optional[str]` | | | `comments` | `List[PyComment]` | | | `start_line` | `int` | | | `end_line` | `int` | | @@ -1520,6 +1529,7 @@ Represents a Python import statement. | `module` | `str` | | | `name` | `str` | | | `alias` | `Optional[str]` | | +| `resolved_module` | `Optional[str]` | | | `start_line` | `int` | | | `end_line` | `int` | | | `start_column` | `int` | | diff --git a/src/content/docs/reference/python-api/typescript.md b/src/content/docs/reference/python-api/typescript.md index 15e7f84..2b793d3 100644 --- a/src/content/docs/reference/python-api/typescript.md +++ b/src/content/docs/reference/python-api/typescript.md @@ -53,9 +53,9 @@ graph = analysis.get_call_graph() # -> networkx.DiGraph -[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.0](https://img.shields.io/badge/cldk-1.4.0-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.0/) +[![Source on GitHub](https://img.shields.io/badge/source-codellm--devkit%2Fpython--sdk-181717?logo=github&logoColor=white)](https://github.com/codellm-devkit/python-sdk) [![cldk 1.4.3](https://img.shields.io/badge/cldk-1.4.3-3776AB?logo=pypi&logoColor=white)](https://pypi.org/project/cldk/1.4.3/) -_API reference generated from cldk 1.4.0._ +_API reference generated from cldk 1.4.3._ ## Analysis