{"id":19541319,"url":"https://github.com/wingify/vwo-python-sdk-example","last_synced_at":"2025-04-26T17:30:43.547Z","repository":{"id":44770980,"uuid":"214439766","full_name":"wingify/vwo-python-sdk-example","owner":"wingify","description":"Provides a basic demo of how server-side works with VWO Python SDK","archived":false,"fork":false,"pushed_at":"2023-10-04T09:26:09.000Z","size":23,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-02T00:02:27.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.vwo.com/docs/fullstack-overview","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wingify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-10-11T13:11:15.000Z","updated_at":"2023-10-04T09:26:12.000Z","dependencies_parsed_at":"2023-10-04T16:05:24.727Z","dependency_job_id":null,"html_url":"https://github.com/wingify/vwo-python-sdk-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-python-sdk-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-python-sdk-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-python-sdk-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-python-sdk-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/vwo-python-sdk-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224040502,"owners_count":17245758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T03:09:38.550Z","updated_at":"2024-11-11T03:09:39.203Z","avatar_url":"https://github.com/wingify.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## VWO Python SDK Example\n\n[vwo-python-sdk](https://github.com/wingify/vwo-python-sdk) allows you to A/B Test your Website at server-side.\n\nThis repository provides a basic demo of how server-side works with VWO Python SDK.\n\n### Requirements\n\n- python 2.7+\n\n### Documentation\n\nRefer [VWO Official FullStack Documentation](https://developers.vwo.com/reference#fullstack-introduction)\n\n### Scripts\n\n1. Install dependencies\n\n```\npip install -r requirements.txt\n```\n\n2. Update your app with your settings present in `config.py`\n\n```python\nAccountDetails = {\n    'account_id': '',\n    'sdk_key': '',\n    # webhook_auth_key: Optional, used when webhooks is enabled\n}\n\nAbCampaignData = {\n    'campaign_key': '',\n    'campaign_goal_identifier': '',\n    'user_id': '',\n    'revenue_value': '',\n    # custom_variables: Optional param, used for pre-segmentation\n}\n\nFeatureRolloutData =  {\n    'campaign_key': '',\n    'user_id': '',\n    # custom_variables: Optional param, used for pre-segmentation\n}\n\nFeatureTestData = {\n    'campaign_key': '',\n    'campaign_goal_identifier': '',\n    'revenue_value': '',\n    'user_id': '',\n    # custom_variables: Optional param, used for pre-segmentation\n\n    'string_variable_key': '',\n    'integer_variable_key': '',\n    'double_variable_key': '',\n    'boolean_variable_key': '',\n}\n\nPushData = {\n    'tag_key': '',\n    'tag_value': '',\n    'user_id': '',\n}\n```\n\n3. Run application\n\n```\npython server.py\n```\n\n### Basic usage\n\n**Importing and Instantiation**\n\n```python\nimport vwo\n\nsettings_file = vwo.get_settings_file(account_id, sdk_key)\nvwo_client_instance = vwo.launch(settings_file)\n```\n\n**API usage**\n\n```python\n# activate API\nvariation_name = vwo_client_instance.activate(ab_campaign_key, user_id)\n\n# get_variation_name API\nvariation_name = vwo_client_instance.get_variation_name(ab_campaign_key, user_id)\n\n# track API\nvwo_client_instance.track(ab_campaign_key, user_id, ab_campaign_goal_identifeir, revenue_value)\n```\n\n**Log Level** - pass log level to SDK\n\n```python\nimport vwo\nfrom vwo import LogLevels\n\nsettings_file = vwo.get_settings_file(account_id, sdk_key)\nvwo_client_instance = vwo.VWO(settings_file, log_level = LogLevels.DEBUG)\n```\n\n**Custom Logger** - implement your own logger method\n\n```python\nimport vwo\n\nclass CustomLogger:\n   def log(self, level, message):\n      print(level, message)\n      # ...write to file or database or integrate with any third-party service\n\nsettings_file = vwo.get_settings_file(account_id, sdk_key)\nvwo_client_instance = vwo.VWO(settings_file, logger = CustomLogger())\n```\n\n**User Storage Service**\n\n```python\nimport vwo\nfrom vwo import UserStorage\n\nclass user_storage(UserStorage):\n  def get(self, user_id, campaign_key):\n    # ...code here for getting data\n    # return data\n\n  def set(self, user_storage_data):\n    # ...code to persist data\n\nuser_storage_instance = user_storage()\n\nsettings_file = vwo.get_settings_file(account_id, sdk_key)\nvwo_client_instance = vwo.VWO(settings_file, user_storage = user_storage_instance)\n```\n\n## License\n\n[Apache License, Version 2.0](https://github.com/wingify/vwo-python-sdk-example/blob/master/LICENSE)\n\nCopyright 2019-2021 Wingify Software Pvt. Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-python-sdk-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fvwo-python-sdk-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-python-sdk-example/lists"}