1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-19 01:17:18 +02:00

chore: finalize python sdk example (#8186)

Fix Python example and add isEnabled example.
This commit is contained in:
Jaanus Sellin 2024-09-19 15:03:03 +03:00 committed by GitHub
parent 205b59ddee
commit 95969456f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,11 +99,13 @@ var settings = new UnleashSettings()
Unleash unleash = new DefaultUnleash(config);`, Unleash unleash = new DefaultUnleash(config);`,
Python: `from UnleashClient import UnleashClient Python: `from UnleashClient import UnleashClient
import asyncio
client = UnleashClient( client = UnleashClient(
url="<YOUR_API_URL>", url="<YOUR_API_URL>",
app_name="unleash-onboarding-python", app_name="unleash-onboarding-python",
custom_headers={'Authorization': '<YOUR_API_TOKEN>"'}) refresh_interval=5,
custom_headers={'Authorization': '<YOUR_API_TOKEN>'})
client.initialize_client()`, client.initialize_client()`,
JavaScript: `import { UnleashClient } from 'unleash-proxy-client'; JavaScript: `import { UnleashClient } from 'unleash-proxy-client';
@ -217,7 +219,9 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
Rust: ``, Rust: ``,
'.NET': ``, '.NET': ``,
Java: ``, Java: ``,
Python: ``, Python: `while True:
print(client.is_enabled("<YOUR_FLAG>"))
asyncio.run(asyncio.sleep(1))`,
JavaScript: ``, JavaScript: ``,
React: ``, React: ``,
Vue: ``, Vue: ``,