Package org.openrewrite.python.rpc
Class PythonRewriteRpc
java.lang.Object
org.openrewrite.rpc.RewriteRpc
org.openrewrite.python.rpc.PythonRewriteRpc
public class PythonRewriteRpc
extends org.openrewrite.rpc.RewriteRpc
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PythonRewriteRpc.Builderbuilder()static @Nullable PythonRewriteRpcget()static PythonRewriteRpcinstallRecipes(File recipes) Install recipes from a local file path (e.g., a local pip package).installRecipes(String packageName) Install recipes from a package name.installRecipes(String packageName, @Nullable String version) Install recipes from a package name with a specific version.Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, @Nullable Path relativeTo, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.static voidstatic voidsetFactory(PythonRewriteRpc.Builder builder) voidshutdown()static voidMethods inherited from class org.openrewrite.rpc.RewriteRpc
batchSize, generate, getLanguages, getMarketplace, getObject, livenessCheck, log, parse, prepareRecipe, prepareRecipe, print, print, print, print, reset, send, timeout, traceGetObject, visit, visit
-
Method Details
-
get
-
getOrStart
-
setFactory
-
shutdown
public void shutdown()- Overrides:
shutdownin classorg.openrewrite.rpc.RewriteRpc
-
shutdownCurrent
public static void shutdownCurrent() -
resetCurrent
public static void resetCurrent() -
installRecipes
Install recipes from a local file path (e.g., a local pip package).- Parameters:
recipes- Path to the local package directory- Returns:
- Response with installation details
-
installRecipes
Install recipes from a package name.- Parameters:
packageName- The package name to install- Returns:
- Response with installation details
-
installRecipes
Install recipes from a package name with a specific version.- Parameters:
packageName- The package name to installversion- Optional version specification- Returns:
- Response with installation details
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parsectx- Execution context for parsing- Returns:
- Stream of parsed source files
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parseexclusions- Optional glob patterns to exclude from parsingctx- Execution context for parsing- Returns:
- Stream of parsed source files
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, @Nullable Path relativeTo, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parseexclusions- Optional glob patterns to exclude from parsingrelativeTo- Optional path to make source file paths relative toctx- Execution context for parsing- Returns:
- Stream of parsed source files
-
builder
-