Skip to content

Commit

Permalink
chore/python bump to 0.3.0 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Nov 3, 2023
2 parents 660bb33 + bc3a698 commit 4cc5ac6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
7 changes: 7 additions & 0 deletions config/clients/python/CHANGELOG.md.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.3.0

### [0.3.0](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.2.1...v0.3.0) (2023-11-02)
- feat(client): introduce synchronous OpenFgaClient (https://github.com/openfga/python-sdk/commit/c92b436543e263f2c1af6af15f1c4fda1c9dad21)
- refactor(config): extract oauth2 from credentials, removing logic from credentials configuration (https://github.com/openfga/python-sdk/commit/f91d14b25f86dd3f2e4d48229bb53cc7d9b20f1b)
- feat(client): performance improvements to batch_check (https://github.com/openfga/python-sdk/commit/d8f2d429d2c279c0e56d5ef2a6172df8bfadd82b)

## v0.2.1

### [0.2.1](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.2.0...v0.2.1) (2023-09-05)
Expand Down
2 changes: 1 addition & 1 deletion config/clients/python/config.overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sdkId": "python",
"gitRepoId": "python-sdk",
"packageName": "openfga_sdk",
"packageVersion": "0.2.1",
"packageVersion": "0.3.0",
"packageDescription": "Python SDK for OpenFGA",
"packageDetailedDescription": "This is an autogenerated python SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).",
"fossaComplianceNoticeId": "2f8a8629-b46c-435e-b8cd-1174a674fb4b",
Expand Down
23 changes: 23 additions & 0 deletions config/clients/python/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,26 @@ async def main():
await fga_client.close()

```

#### Synchronous Client

To run outside of an async context, the project exports a synchronous client
from `openfga_sdk.sync` that supports all the credential types and calls,
without requiring async/await.

```python
import {{packageName}}
from {{packageName}}.sync.client import OpenFgaClient


def main():
configuration = {{packageName}}.ClientConfiguration(
api_scheme={{appUpperCaseName}}_API_SCHEME, # optional, defaults to "https"
api_host={{appUpperCaseName}}_API_HOST, # required, define without the scheme (e.g. api.{{sampleApiDomain}} instead of https://api.{{sampleApiDomain}})
store_id={{appUpperCaseName}}_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores`
authorization_model_id={{appUpperCaseName}}_AUTHORIZATION_MODEL_ID, # optional, can be overridden per request
)
# Enter a context with an instance of the OpenFgaClient
with OpenFgaClient(configuration) as fga_client:
api_response = fga_client.read_authorization_models()
```

0 comments on commit 4cc5ac6

Please sign in to comment.