SnakeBridge.Adapter (SnakeBridge v0.7.5)
View SourceProvides the use SnakeBridge.Adapter macro for generated Python adapters.
When you use SnakeBridge.Adapter, it imports the __python_call__/2 function
that generated adapters use to call Python functions via Snakepit.
Example
defmodule MyApp.Math do
use SnakeBridge.Adapter
@spec sqrt(number()) :: float()
def sqrt(x) do
__python_call__("sqrt", [x])
end
endThe adapter module tracks the Python module name and provides the runtime bridge to execute Python functions.
Summary
Functions
Calls a Python function with the given arguments using SnakeBridge.Runtime.
Functions
@spec __python_call__(String.t(), list()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Calls a Python function with the given arguments using SnakeBridge.Runtime.