https://github.com/wingify/vwo-openfeature-provider-python
Openfeature Provider for VWO FME Python SDK
https://github.com/wingify/vwo-openfeature-provider-python
Last synced: 4 months ago
JSON representation
Openfeature Provider for VWO FME Python SDK
- Host: GitHub
- URL: https://github.com/wingify/vwo-openfeature-provider-python
- Owner: wingify
- License: apache-2.0
- Created: 2024-10-07T12:47:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-08T08:30:28.000Z (about 1 year ago)
- Last Synced: 2025-03-29T08:32:59.629Z (9 months ago)
- Language: Python
- Homepage: https://developers.vwo.com/v2/docs/python-openfeature-provider
- Size: 17.6 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## VWO OpenFeature Provider Python
[](https://pypi.org/project/vwo-openfeature-provider-python)
[](http://www.apache.org/licenses/LICENSE-2.0)
## Requirements
* Works with Python: 3.8+
## Installation
It's recommended you use [virtualenv](https://virtualenv.pypa.io/en/latest/) to create isolated Python environments.
```bash
pip install vwo-openfeature-provider-python
```
## Usage
```python
from openfeature import api
from vwo_provider import VWOProvider
from openfeature.evaluation_context import EvaluationContext
from vwo import init
options = {
'sdk_key': '32-alpha-numeric-sdk-key', # SDK Key
'account_id': '123456' # VWO Account ID
}
# Initialize the VWO client
vwo_client = init(options)
# Initialize the VWO provider
vwo_provider = VWOProvider(vwo_client)
# Registering the default provider
api.set_provider(vwo_provider)
# A client bound to the default provider
default_client = api.get_client()
def start():
print('BOOL', default_client.get_boolean_value('unique_feature_key', False, EvaluationContext(attributes={'id': 'user_id', 'key': 'boolean_variable'})))
print('STRING', default_client.get_string_value('unique_feature_key', '', EvaluationContext(attributes={'id': 'user_id', 'key': 'string_variable'})))
print('INTEGER', default_client.get_integer_value('unique_feature_key', 10, EvaluationContext(attributes={'id': 'user_id', 'key': 'number_variable'})))
print('FLOAT', default_client.get_float_value('unique_feature_key', 10.0, EvaluationContext(attributes={'id': 'user_id', 'key': 'float_variable'})))
print('OBJECT', default_client.get_object_value('unique_feature_key', {}, EvaluationContext(attributes={'id': 'user_id', 'key': 'json-variable'})))
start()
```
## Authors
* [Abhishek Joshi](https://github.com/Abhi591)
## Changelog
Refer [CHANGELOG.md](https://github.com/wingify/vwo-openfeature-provider-python/blob/master/CHANGELOG.md)
## Contributing
Please go through our [contributing guidelines](https://github.com/wingify/vwo-openfeature-provider-python/blob/master/CONTRIBUTING.md)
## Code of Conduct
[Code of Conduct](https://github.com/wingify/vwo-openfeature-provider-python/blob/master/CODE_OF_CONDUCT.md)
## License
[Apache License, Version 2.0](https://github.com/wingify/vwo-openfeature-provider-python/blob/master/LICENSE)
Copyright 2024 Wingify Software Pvt. Ltd.