<@U04UQ68083H> Can you give me an example usage of...
# ory-copilot
c
@chilly-king-10285 Can you give me an example usage of the Ory Keto SDK with code samples?
c
A message from kapa.ai
Sure, here are some examples of how to use the Ory Keto SDK in Go and Python. For Go, you can install the gRPC API and REST API with the following commands:
Copy code
bash go get <http://github.com/ory/keto/proto|github.com/ory/keto/proto>   go get <http://github.com/ory/keto-client-go|github.com/ory/keto-client-go>
Then, you can create minimal permission rules with the following code:
Copy code
javascript import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"      class User implements Namespace { }      class Blog implements Namespace {    related: {    viewers: User[]    }       permits = {    view: (ctx: Context): boolean =>    this.related.viewers.includes(ctx.subject)    }   }
For Python, you can install the Ory Python SDK with the following commands:
Copy code
bash pip install git+<https://github.com/ory/sdk.git>   python setup.py install --user
Then, you can import the package with the following code:
Copy code
python import ory_client
For more examples of SDK usage, you can refer to the auto-generated documentation for [
keto-client-go
](https://github.com/ory/keto-client-go/tree/master/docs) and [
ory-client
](https://github.com/ory/sdk/blob/master/clients/client/python/README.md). Sources: - [Go SDK](https://www.ory.sh/docs/keto/self-hosted/go) - [Python SDK](https://www.ory.sh/docs/keto/sdk/python)