diff --git a/config/clients/python/CHANGELOG.md.mustache b/config/clients/python/CHANGELOG.md.mustache index 69e32ac3..f4396f52 100644 --- a/config/clients/python/CHANGELOG.md.mustache +++ b/config/clients/python/CHANGELOG.md.mustache @@ -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) diff --git a/config/clients/python/config.overrides.json b/config/clients/python/config.overrides.json index 456b95db..2b4f0967 100644 --- a/config/clients/python/config.overrides.json +++ b/config/clients/python/config.overrides.json @@ -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", diff --git a/config/clients/python/template/README_initializing.mustache b/config/clients/python/template/README_initializing.mustache index 323bf608..0f29114b 100644 --- a/config/clients/python/template/README_initializing.mustache +++ b/config/clients/python/template/README_initializing.mustache @@ -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() +```