Skip to content

Commit

Permalink
chore: update example project README
Browse files Browse the repository at this point in the history
  • Loading branch information
booniepepper committed Dec 30, 2023
1 parent 31cde1a commit fbee6b6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
32 changes: 32 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Examples of using the OpenFGA Python SDK

A set of examples on how to call the OpenFGA Python SDK

### Examples
Example 1:
A bare-bones example. It creates a store, and runs a set of calls against it including creating a model, writing tuples and checking for access.

### Running the Examples

Prerequisites:
- `docker`
- `make`
- `python` 3.11+

#### Run using a published SDK

Steps:
1. Clone/Copy the example folder
2. If you have an OpenFGA server running, you can use it, otherwise run `make run-openfga` to spin up an instance (you'll need to switch to a different terminal after - don't forget to close it when done)
3. Run `make run` to run the example

#### Run using a local unpublished SDK build

Steps:
1. Build the SDK
2. Change to the example directory
3. Install the local SDK `pip install -e $LOCAL_DIR`
- For example, if your local SDK is located at `$HOME/projects/python-sdk`, run `pip install -e $HOME/projects/python-sdk`
- For advanced users: The above just updates `requirements.txt` and the source of openfga-sdk. If you know how to manually edit this, feel free to do that as well.
4. If you have an OpenFGA server running, you can use it, otherwise run `make run-openfga` to spin up an instance (you'll need to switch to a different terminal after - don't forget to close it when done)
5. Run `make run` to run the example
1 change: 0 additions & 1 deletion example/example1/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
aiohttp==3.9.1
aiosignal==1.3.1
attrs==23.1.0
example1 @ file:///Users/justin.hill/workplace/sdk-generator/clients/fga-python-sdk/example/example1
frozenlist==1.4.1
idna==3.6
multidict==6.0.4
Expand Down

0 comments on commit fbee6b6

Please sign in to comment.