File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- TODO
1+ # polywrap-client
2+
3+ Python implementation of the polywrap client.
4+
5+ ## Usage
6+
7+ ### Configure and Instantiate
8+
9+ Use the ` polywrap-uri-resolvers ` package to configure resolver and build config for the client.
10+
11+ ``` python
12+ from polywrap_uri_resolvers import FsUriResolver, SimpleFileReader
13+
14+ config = ClientConfig(
15+ resolver = FsUriResolver(file_reader = SimpleFileReader())
16+ )
17+
18+ client = PolywrapClient(config)
19+ ```
20+
21+ ### Invoke
22+
23+ Invoke a wrapper.
24+
25+ ``` python
26+ uri = Uri.from_str(
27+ ' fs/<path to wrapper>' # Example uses simple math wrapper
28+ )
29+ args = {
30+ " arg1" : " 123" , # The base number
31+ " obj" : {
32+ " prop1" : " 1000" , # multiply the base number by this factor
33+ },
34+ }
35+ options: InvokerOptions[UriPackageOrWrapper] = InvokerOptions(
36+ uri = uri, method = " method" , args = args, encode_result = False
37+ )
38+ result = await client.invoke(options)
39+ assert result == " 123000"
40+ ```
You can’t perform that action at this time.
0 commit comments