Skip to main content

⚠️ [DEPRECATED] VWO Python SDK

⚠️ This project is no longer actively developed. ⚠️

✅ We are only fixing critical bugs and security issues.

❌ No new features, enhancements, or non-critical updates will be added.

Switch to VWO Feature Management & Experimentation(FME) – The Better Alternative! 🚀

VWO’s FME product empowers teams to seamlessly test, release, optimize, and roll back features across their entire tech stack while minimizing risk and maximizing business impact.

  • Check out FME developer documentation here.
  • Check this for the list of all FME-supported SDKs.

💡 Need Help? For migration assistance or any questions, contact us at support@vwo.com


PyPI version CI codecov License

This open source library allows you to A/B Test your Website at server-side.

Requirements

  • Works with Python: 2.7 onwards. Python 3 is also supported.

Installation

It's recommended you use virtualenv to create isolated Python environments.

pip install vwo-python-sdk

Basic usage

Importing and Instantiation

import vwo

settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(settings_file)

API usage

# activate API
variation_name = vwo_client_instance.activate(ab_campaign_key, user_id)

# get_variation_name API
variation_name = vwo_client_instance.get_variation_name(ab_campaign_key, user_id)

# track API
vwo_client_instance.track(ab_campaign_key, user_id, ab_campaign_goal_identifeir, revenue_value)

Log Level - pass log_level to SDK

import vwo
from vwo import LogLevels

settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(settings_file, log_level=LogLevels.DEBUG)

Custom Logger - implement your own logger method

import vwo

class CustomLogger:
   def log(self, level, message):
      print(level, message)
      # ...write to file or database or integrate with any third-party service

settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(settings_file, logger = CustomLogger())

User Storage Service

import vwo
from vwo import logger

class user_storage(UserStorage):
  def get(self, user_id, campaign_key):
    # ...code here for getting data
    # return data

  def set(self, user_storage_data):
    # ...code to persist data

us = user_storage()

settings_file = vwo.get_settings_file(account_id, sdk_key)
vwo_client_instance = vwo.launch(settings_file, user_storage = us)

Documentation

Refer Official VWO Documentation

Local development

python setup.py develop

Running Unit Tests

python setup.py test

Demo Python application

vwo-python-sdk-example

Third-party Resources and Credits

Refer third-party-attributions.txt

Authors

Changelog

Refer CHANGELOG.md

Contributing

Please go through our contributing guidelines

Code of Conduct

Code of Conduct

License

Apache License, Version 2.0

Copyright 2019-2022 Wingify Software Pvt. Ltd.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vwo_python_sdk-1.68.2.tar.gz (56.9 kB view details)

Uploaded Source

File details

Details for the file vwo_python_sdk-1.68.2.tar.gz.

File metadata

  • Download URL: vwo_python_sdk-1.68.2.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for vwo_python_sdk-1.68.2.tar.gz
Algorithm Hash digest
SHA256 e667ad801c04a317afffcf44641f1cf5fc84d722d42a73e941ca356cd0e3b3d9
MD5 d09402df9dae987a10b55e97290f7887
BLAKE2b-256 959875696ed284030ee447859a32a8b3580c06ba938c2fceb1a9a0f7c51d0573

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.68.2 This release

1 file

1.68.1

1 file

1.66.1

1 file

1.66.0

1 file

1.64.0

1 file

1.62.0

1 file

1.60.1

1 file

1.60.0

1 file

1.58.0

1 file

1.55.0

1 file

1.51.0

1 file

1.50.0

1 file

1.46.1

1 file

1.36.0

1 file

1.35.1

1 file

1.35.0

1 file

1.34.1

1 file

1.34.0

1 file

1.33.0

1 file

1.32.0

1 file

1.31.0

1 file

1.30.0

1 file

1.28.0

1 file

1.25.0

1 file

1.23.2

1 file

1.23.1

1 file

1.23.0

1 file

1.22.0

1 file

1.21.0

1 file

1.20.0

1 file

1.19.0

1 file

1.18.0

1 file

1.17.2

1 file

1.17.1

1 file

1.17.0

1 file

1.14.0

1 file

1.13.0

1 file

1.12.0

1 file

1.11.0

1 file

1.10.1

1 file

1.10.0

1 file

1.9.0

1 file

1.8.2

1 file

1.8.1

1 file

1.8.0

1 file

1.6.3

1 file

1.6.2

1 file

1.6.1

1 file

1.6.0

1 file

1.5.0

1 file

1.4.0

1 file

1.3.1

1 file

1.3.0

1 file

1.2.0

1 file

1.1.2

1 file

1.1.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page