You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,10 +13,10 @@ Harness Feature Flag Python SDK
13
13
14
14
## Intro
15
15
16
-
Harness Feature Flags (FF) is a feature management solution that enables users to change the software’s functionality, without deploying new code. FF uses feature flags to hide code or behaviours without having to ship new versions of the software. A feature flag is like a powerful if statement.
17
-
* For more information, seehttps://harness.io/products/feature-flags/
18
-
* To read more, see https://ngdocs.harness.io/category/vjolt35atg-feature-flags
19
-
* To sign up, https://app.harness.io/auth/#/signup/
16
+
Use this README to get started with our Feature Flags (FF) SDK for Python. This guide outlines the basics of getting started with the SDK and provides a full code sample for you to try out.
17
+
This sample doesn’t include configuration options, for in depth steps and configuring the SDK, for example, disabling streaming or using our Relay Proxy, see the [Python SDK Reference](https://ngdocs.harness.io/article/hwoxb6x2oe-python-sdk-reference).
18
+
19
+
For a sample FF Python SDK project, see our test [test Golang project](examples/getting_started/getting_started.py).
@@ -29,20 +29,22 @@ Harness Feature Flags (FF) is a feature management solution that enables users t
29
29
30
30
31
31
## Quickstart
32
-
The Feature Flag SDK provides a client that connects to the feature flag service, and fetches the value
33
-
of featue flags. The following section provides an example of how to install the SDK and initalize it from
34
-
an application.
35
-
This quickstart assumes you have followed the instructions to [setup a Feature Flag project and have created a flag called `harnessappdemodarkmode` and created a server API Key](https://ngdocs.harness.io/article/1j7pdkqh7j-create-a-feature-flag#step_1_create_a_project).
32
+
To follow along with our test code sample, make sure you’ve:
36
33
34
+
-[Created a Feature Flag on the Harness Platform](https://ngdocs.harness.io/article/1j7pdkqh7j-create-a-feature-flag) called harnessappdemodarkmode
35
+
-[Created a server SDK key and made a copy of it](https://ngdocs.harness.io/article/1j7pdkqh7j-create-a-feature-flag#step_3_create_an_sdk_key)
36
+
-
37
37
### Install the SDK
38
38
Install the python SDK using pip
39
39
```python
40
40
python -m pip install harness-featureflags
41
41
```
42
42
43
-
### A Simple Example
44
-
Here is a complete example that will connect to the feature flag service and report the flag value every 10 seconds until the connection is closed.
45
-
Any time a flag is toggled from the feature flag service you will receive the updated value.
43
+
### Code Sample
44
+
The following is a complete code example that you can use to test the `harnessappdemodarkmode` Flag you created on the Harness Platform. When you run the code it will:
45
+
- Connect to the FF service.
46
+
- Report the value of the Flag every 10 seconds until the connection is closed. Every time the harnessappdemodarkmode Flag is toggled on or off on the Harness Platform, the updated value is reported.
47
+
- Close the SDK.
46
48
47
49
```python
48
50
from featureflags.client import CfClient
@@ -63,7 +65,7 @@ def main():
63
65
client = CfClient(apiKey)
64
66
65
67
# Create a target (different targets can get different results based on rules. This include a custom attribute 'location')
Further examples and config options are in the further reading section:
103
-
104
-
[Further Reading](docs/further_reading.md)
104
+
For further examples and config options, see the [Python SDK Reference](https://ngdocs.harness.io/article/hwoxb6x2oe-python-sdk-reference).
105
105
106
+
For more information about Feature Flags, see our [Feature Flags documentation](https://ngdocs.harness.io/article/0a2u2ppp8s-getting-started-with-feature-flags).
106
107
107
108
-------------------------
108
109
[Harness](https://www.harness.io/) is a feature management platform that helps teams to build better software and to
| baseUrl | with_base_url("https://config.ff.harness.io/api/1.0")| the URL used to fetch feature flag evaluations. You should change this when using the Feature Flag proxy to http://localhost:7000|https://config.ff.harness.io/api/1.0|
21
+
| eventsUrl | with_events_url("https://events.ff.harness.io/api/1.0"),| the URL used to post metrics data to the feature flag service. You should change this when using the Feature Flag proxy to http://localhost:7000|https://events.ff.harness.io/api/1.0|
22
+
| pollInterval | Config(pull_interval=60) | when running in stream mode, the interval in seconds that we poll for changes. | 60 |
0 commit comments