1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01: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);`,
Python: `from UnleashClient import UnleashClient
import asyncio
client = UnleashClient(
url="<YOUR_API_URL>",
app_name="unleash-onboarding-python",
custom_headers={'Authorization': '<YOUR_API_TOKEN>"'})
refresh_interval=5,
custom_headers={'Authorization': '<YOUR_API_TOKEN>'})
client.initialize_client()`,
JavaScript: `import { UnleashClient } from 'unleash-proxy-client';
@ -217,7 +219,9 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
Rust: ``,
'.NET': ``,
Java: ``,
Python: ``,
Python: `while True:
print(client.is_enabled("<YOUR_FLAG>"))
asyncio.run(asyncio.sleep(1))`,
JavaScript: ``,
React: ``,
Vue: ``,