kameleoon-client-python 3.17.1__tar.gz → 3.19.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/PKG-INFO +15 -15
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/data_file.py +42 -15
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/variation.py +2 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/__init__.py +2 -0
- kameleoon_client_python-3.19.0/kameleoon/data/application_version.py +39 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/data.py +1 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/visitor.py +20 -3
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/visitor_manager.py +40 -15
- kameleoon_client_python-3.19.0/kameleoon/helpers/sem_version.py +60 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/kameleoon_client.py +48 -54
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/kameleoon_client_config.py +2 -2
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/data/data_manager.py +7 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/tracking/tracking_builder.py +1 -1
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/access_token_source.py +9 -1
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/net_provider.py +8 -2
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/automation_service.py +1 -1
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/automation_service_impl.py +7 -8
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/url_provider.py +10 -6
- kameleoon_client_python-3.19.0/kameleoon/sdk_version.py +12 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/browser_condition.py +4 -2
- kameleoon_client_python-3.19.0/kameleoon/targeting/conditions/sdk_language_condition.py +38 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/targeting_condition.py +1 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/unknown_condition.py +3 -0
- kameleoon_client_python-3.19.0/kameleoon/targeting/conditions/version_condition.py +61 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/targeting_manager.py +3 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/tree_condition_factory.py +4 -0
- kameleoon_client_python-3.19.0/kameleoon/types/data_file.py +38 -0
- kameleoon_client_python-3.19.0/kameleoon/types/feature_flag.py +69 -0
- kameleoon_client_python-3.19.0/kameleoon/types/rule.py +40 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/types/variable.py +7 -3
- kameleoon_client_python-3.19.0/kameleoon/types/variation.py +89 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon_client_python.egg-info/PKG-INFO +15 -15
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon_client_python.egg-info/SOURCES.txt +6 -0
- kameleoon_client_python-3.17.1/kameleoon/sdk_version.py +0 -40
- kameleoon_client_python-3.17.1/kameleoon/targeting/conditions/sdk_language_condition.py +0 -79
- kameleoon_client_python-3.17.1/kameleoon/types/variation.py +0 -46
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/MANIFEST.in +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/README.md +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/client_readiness/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/client_readiness/async_readiness.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/client_readiness/threading_readiness.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/consent_blocking_behaviour.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/custom_data_info.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/experiment.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/feature_flag.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/me_group.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/rule.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/rule_type.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/settings.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/variable.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/configuration/variation_by_exposition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/browser.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/cbscores.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/conversion.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/cookie.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/custom_data.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/device.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/geolocation.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/kcs_heat.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/assigned_variation.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/forced_experiment_variation.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/forced_feature_variation.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/forced_variation.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/legal_consent.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/page_view_visit.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/visitor_slot.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/mapping_identifier.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/operating_system.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/page_view.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/personalization.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/targeted_segment.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/unique_identifier.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/user_agent.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/visitor_visits.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/defaults.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/exceptions.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/domain.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/functions.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/hasher.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/logger.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/multi_threading.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/nonce.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/repeat_timer.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/scheduler.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/string_utils.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/helpers/visitor_code.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/hybrid/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/hybrid/hybrid_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/hybrid/hybrid_manager_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/kameleoon_client_factory.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/logging/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/logging/kameleoon_logger.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/logging/log_level.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/logging/logger.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/asyncexec/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/asyncexec/async_executor.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/data/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/evaluation/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/evaluation/evaluated_experiment.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/remote_data/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/remote_data/remote_data_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/remote_data/remote_visitor_data.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/tracking/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/tracking/tracking_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/tracking/visitor_tracking_registry.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/warehouse/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/managers/warehouse/warehouse_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/middleware.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/access_token_source_factory.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/activity_event.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/cookie/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/cookie/cookie_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/net_provider_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/network_manager.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/network_manager_factory.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/network_manager_factory_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/network_manager_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/query_builder.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/query_encodable.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/sendable.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/service_initialize_context.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/service_initialize_context_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/configuration_service.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/configuration_service_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/data_service.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/data_service_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/service.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/services/service_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/network/uri_helper.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/real_time/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/real_time/real_time_configuration_service.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/real_time/real_time_event.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/storage/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/storage/cache.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/storage/cache_factory.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/storage/cache_factory_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/storage/cache_impl.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/constants.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/conversion_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/cookie_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/custom_datum.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/device_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/exclusive_experiment_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/geolocation_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/kcs_heat_range_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/number_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/operating_system_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/page_title_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/page_url_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/page_view_number_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/previous_page_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/segment_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/string_value_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/target_experiment_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/target_feature_flag_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/target_personalization_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/time_elapsed_since_visit_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/visit_number_today_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/visit_number_total_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/visitor_code_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/conditions/visitor_new_return_condition.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/models.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/targeting/tree_builder.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/types/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/types/remote_visitor_data_filter.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon_client_python.egg-info/dependency_links.txt +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon_client_python.egg-info/requires.txt +14 -14
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon_client_python.egg-info/top_level.txt +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/setup.cfg +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/setup.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/admin.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/apps.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/migrations/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/models.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/tests.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/kameleoon_app/views.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/manage.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/proj/__init__.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/proj/asgi.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/proj/settings.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/proj/urls.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/integration/proj/proj/wsgi.py +0 -0
- {kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/tests/resources/config.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kameleoon-client-python
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.19.0
|
|
4
4
|
Summary: Kameleoon Client Python Software Development Kit.
|
|
5
5
|
Home-page: https://developers.kameleoon.com/python-sdk.html
|
|
6
6
|
Author: Kameleoon
|
|
@@ -20,27 +20,27 @@ Requires-Dist: requests<3.0.0,>=2.25
|
|
|
20
20
|
Requires-Dist: sseclient-py<1.9.0,>=1.7.0
|
|
21
21
|
Requires-Dist: aiohttp<4.0.0,>=3.8.0
|
|
22
22
|
Provides-Extra: test
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: wheel==0.36.2; extra == "test"
|
|
24
|
+
Requires-Dist: Werkzeug==2.0.1; extra == "test"
|
|
25
|
+
Requires-Dist: aiohttp<4.0.0,>=3.8.0; extra == "test"
|
|
26
|
+
Requires-Dist: pylint==2.12.*; extra == "test"
|
|
25
27
|
Requires-Dist: types-requests==2.25.0; extra == "test"
|
|
26
28
|
Requires-Dist: pytest-asyncio==0.21.*; extra == "test"
|
|
29
|
+
Requires-Dist: sseclient-py<1.9.0,>=1.7.0; extra == "test"
|
|
30
|
+
Requires-Dist: pytest-cov==2.12.1; extra == "test"
|
|
27
31
|
Requires-Dist: types-python-dateutil==2.8.2; extra == "test"
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: aioresponses==0.7.*; extra == "test"
|
|
30
|
-
Requires-Dist: wheel==0.36.2; extra == "test"
|
|
31
|
-
Requires-Dist: requests<3.0.0,>=2.25; extra == "test"
|
|
32
|
-
Requires-Dist: twine==3.4.1; extra == "test"
|
|
33
|
-
Requires-Dist: pytest-django==4.4.0; extra == "test"
|
|
34
|
-
Requires-Dist: types-PyYAML==5.4.3; extra == "test"
|
|
32
|
+
Requires-Dist: freezegun==1.1.0; extra == "test"
|
|
35
33
|
Requires-Dist: pyyaml<6.1.0,>=5.4.0; extra == "test"
|
|
36
|
-
Requires-Dist: pytest-
|
|
34
|
+
Requires-Dist: pytest-django==4.4.0; extra == "test"
|
|
37
35
|
Requires-Dist: pytest-ordering==0.6; extra == "test"
|
|
38
|
-
Requires-Dist: sseclient-py<1.9.0,>=1.7.0; extra == "test"
|
|
39
|
-
Requires-Dist: Werkzeug==2.0.1; extra == "test"
|
|
40
|
-
Requires-Dist: pylint==2.12.*; extra == "test"
|
|
41
36
|
Requires-Dist: Django==3.2.4; extra == "test"
|
|
37
|
+
Requires-Dist: types-PyYAML==5.4.3; extra == "test"
|
|
38
|
+
Requires-Dist: flake8==4.0.1; extra == "test"
|
|
39
|
+
Requires-Dist: pytest-pythonpath==0.7.3; extra == "test"
|
|
42
40
|
Requires-Dist: mypy==0.991; extra == "test"
|
|
43
|
-
Requires-Dist:
|
|
41
|
+
Requires-Dist: requests<3.0.0,>=2.25; extra == "test"
|
|
42
|
+
Requires-Dist: twine==3.4.1; extra == "test"
|
|
43
|
+
Requires-Dist: aioresponses==0.7.*; extra == "test"
|
|
44
44
|
Dynamic: author
|
|
45
45
|
Dynamic: author-email
|
|
46
46
|
Dynamic: classifier
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Kameleoon Configuration"""
|
|
2
2
|
|
|
3
3
|
from typing import Any, Dict, Iterable, List, Optional, Set
|
|
4
|
+
|
|
4
5
|
from kameleoon.configuration import Variable
|
|
5
6
|
from kameleoon.configuration.custom_data_info import CustomDataInfo
|
|
6
7
|
from kameleoon.configuration.experiment import Experiment
|
|
@@ -20,7 +21,7 @@ class DataFile:
|
|
|
20
21
|
@staticmethod
|
|
21
22
|
def default(environment: Optional[str]) -> "DataFile":
|
|
22
23
|
"""Creates new instance of `DataFile` initialized with default values"""
|
|
23
|
-
data_file = DataFile(environment, None, Settings(), {}, {}, CustomDataInfo(None))
|
|
24
|
+
data_file = DataFile(environment, None, Settings(), {}, {}, CustomDataInfo(None), None, 0)
|
|
24
25
|
return data_file
|
|
25
26
|
|
|
26
27
|
@staticmethod
|
|
@@ -33,23 +34,29 @@ class DataFile:
|
|
|
33
34
|
custom_data_info = CustomDataInfo(configuration.get("customData"))
|
|
34
35
|
feature_flags = DataFile.__parse_feature_flags(configuration, segments, custom_data_info)
|
|
35
36
|
holdout = Experiment.from_json(configuration["holdout"]) if "holdout" in configuration else None
|
|
36
|
-
|
|
37
|
+
date_modified = int(configuration.get("dateModified", 0))
|
|
38
|
+
data_file = DataFile(
|
|
39
|
+
environment,
|
|
40
|
+
last_modified,
|
|
41
|
+
settings,
|
|
42
|
+
segments,
|
|
43
|
+
feature_flags,
|
|
44
|
+
custom_data_info,
|
|
45
|
+
holdout,
|
|
46
|
+
date_modified,
|
|
47
|
+
)
|
|
37
48
|
return data_file
|
|
38
49
|
|
|
39
50
|
@staticmethod
|
|
40
51
|
def __parse_segments(configuration: Dict[str, Any]) -> Dict[int, Segment]:
|
|
41
|
-
return {
|
|
42
|
-
(seg := Segment.from_json(jobj)).id_: seg
|
|
43
|
-
for jobj in configuration.get("segments") or []
|
|
44
|
-
}
|
|
52
|
+
return {(seg := Segment.from_json(jobj)).id_: seg for jobj in configuration.get("segments") or []}
|
|
45
53
|
|
|
46
54
|
@staticmethod
|
|
47
55
|
def __parse_feature_flags(
|
|
48
56
|
configuration: Dict[str, Any], segments: Dict[int, Segment], cdi: CustomDataInfo
|
|
49
57
|
) -> Dict[str, FeatureFlag]:
|
|
50
58
|
return {
|
|
51
|
-
(ff := FeatureFlag(jobj, segments, cdi)).feature_key: ff
|
|
52
|
-
for jobj in configuration.get("featureFlags") or []
|
|
59
|
+
(ff := FeatureFlag(jobj, segments, cdi)).feature_key: ff for jobj in configuration.get("featureFlags") or []
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
# pylint: disable=R0913
|
|
@@ -61,15 +68,22 @@ class DataFile:
|
|
|
61
68
|
segments: Dict[int, Segment],
|
|
62
69
|
feature_flags: Dict[str, FeatureFlag],
|
|
63
70
|
custom_data_info: CustomDataInfo,
|
|
64
|
-
holdout: Optional[Experiment]
|
|
71
|
+
holdout: Optional[Experiment],
|
|
72
|
+
date_modified: int,
|
|
65
73
|
) -> None:
|
|
66
74
|
KameleoonLogger.debug(
|
|
67
75
|
"CALL: DataFile(environment: %s, last_modified: %s, settings: %s, segments, feature_flags,"
|
|
68
|
-
" custom_data_info: %s, holdout: %s)",
|
|
69
|
-
environment,
|
|
76
|
+
" custom_data_info: %s, holdout: %s, date_modified: %s)",
|
|
77
|
+
environment,
|
|
78
|
+
last_modified,
|
|
79
|
+
settings,
|
|
80
|
+
custom_data_info,
|
|
81
|
+
holdout,
|
|
82
|
+
date_modified,
|
|
70
83
|
)
|
|
71
84
|
self.__environment = environment # pylint: disable=W0238
|
|
72
85
|
self.__last_modified = last_modified
|
|
86
|
+
self.__date_modified = date_modified
|
|
73
87
|
self.__settings = settings
|
|
74
88
|
self.__segments = segments
|
|
75
89
|
self.__audience_tracking_segments = [seg for seg in segments.values() if seg.audience_tracking]
|
|
@@ -90,8 +104,13 @@ class DataFile:
|
|
|
90
104
|
self.__holdout = holdout
|
|
91
105
|
KameleoonLogger.debug(
|
|
92
106
|
"RETURN: DataFile(environment: %s, last_modified: %s, settings: %s, segments, feature_flags,"
|
|
93
|
-
" custom_data_info: %s, holdout: %s)",
|
|
94
|
-
environment,
|
|
107
|
+
" custom_data_info: %s, holdout: %s, date_modified: %s)",
|
|
108
|
+
environment,
|
|
109
|
+
last_modified,
|
|
110
|
+
settings,
|
|
111
|
+
custom_data_info,
|
|
112
|
+
holdout,
|
|
113
|
+
date_modified,
|
|
95
114
|
)
|
|
96
115
|
|
|
97
116
|
@property
|
|
@@ -99,6 +118,11 @@ class DataFile:
|
|
|
99
118
|
"""Returns last modified string"""
|
|
100
119
|
return self.__last_modified
|
|
101
120
|
|
|
121
|
+
@property
|
|
122
|
+
def date_modified(self) -> int:
|
|
123
|
+
"""Returns the last data-file update timestamp from the configuration."""
|
|
124
|
+
return self.__date_modified
|
|
125
|
+
|
|
102
126
|
@property
|
|
103
127
|
def settings(self) -> Settings:
|
|
104
128
|
"""Returns settings"""
|
|
@@ -152,10 +176,12 @@ class DataFile:
|
|
|
152
176
|
feature_flag = self.__feature_flags.get(feature_key)
|
|
153
177
|
if feature_flag is None:
|
|
154
178
|
raise FeatureNotFound(feature_key)
|
|
179
|
+
return feature_flag
|
|
180
|
+
|
|
181
|
+
def _ensure_environment_enabled(self, feature_flag: FeatureFlag):
|
|
155
182
|
if not feature_flag.environment_enabled:
|
|
156
183
|
env = "default" if self.__environment is None else f"'{self.__environment}'"
|
|
157
|
-
raise FeatureEnvironmentDisabled(f"Feature '{feature_key}' is disabled for {env} environment")
|
|
158
|
-
return feature_flag
|
|
184
|
+
raise FeatureEnvironmentDisabled(f"Feature '{feature_flag.feature_key}' is disabled for {env} environment")
|
|
159
185
|
|
|
160
186
|
@property
|
|
161
187
|
def custom_data_info(self) -> CustomDataInfo:
|
|
@@ -211,6 +237,7 @@ class DataFile:
|
|
|
211
237
|
"DataFile{"
|
|
212
238
|
f"environment:'{self.__environment}',"
|
|
213
239
|
f"last_modified:'{self.__last_modified}',"
|
|
240
|
+
f"date_modified:{self.__date_modified},"
|
|
214
241
|
f"feature_flags:{len(self.__feature_flags)},"
|
|
215
242
|
f"settings:{self.__settings}"
|
|
216
243
|
"}"
|
|
@@ -23,6 +23,7 @@ class Variation:
|
|
|
23
23
|
|
|
24
24
|
def __init__(self, dict_json: Dict[str, Any]):
|
|
25
25
|
self.key: str = dict_json.get("key", "")
|
|
26
|
+
self.name: str = dict_json.get("name", "")
|
|
26
27
|
self.variables: List[Variable] = Variable.from_array(
|
|
27
28
|
dict_json.get("variables", [])
|
|
28
29
|
)
|
|
@@ -33,4 +34,5 @@ class Variation:
|
|
|
33
34
|
|
|
34
35
|
def __str__(self):
|
|
35
36
|
return (f"Variation{{key:'{self.key}',"
|
|
37
|
+
f"name:'{self.name}',"
|
|
36
38
|
f"variables:{StringUtils.object_to_string(self.variables)}}}")
|
{kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/__init__.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
""" Imports all kameleoon data objects """
|
|
2
2
|
|
|
3
|
+
from .application_version import ApplicationVersion
|
|
3
4
|
from .browser import Browser, BrowserType
|
|
4
5
|
from .conversion import Conversion
|
|
5
6
|
from .cookie import Cookie
|
|
@@ -13,6 +14,7 @@ from .user_agent import UserAgent
|
|
|
13
14
|
from .unique_identifier import UniqueIdentifier
|
|
14
15
|
|
|
15
16
|
__all__ = [
|
|
17
|
+
"ApplicationVersion",
|
|
16
18
|
"Browser",
|
|
17
19
|
"BrowserType",
|
|
18
20
|
"Conversion",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Application version data"""
|
|
2
|
+
|
|
3
|
+
from kameleoon.data.data import Data, DataType
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApplicationVersion(Data):
|
|
7
|
+
"""Application version data for targeting by application version.
|
|
8
|
+
|
|
9
|
+
The ApplicationVersion class represents the version of a user's application
|
|
10
|
+
and is used for targeting users based on semantic versioning (major, major.minor,
|
|
11
|
+
or major.minor.patch).
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, version: str) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Creates a new ApplicationVersion.
|
|
17
|
+
|
|
18
|
+
:param version: The application version string (semantic versioning: major, major.minor, or
|
|
19
|
+
major.minor.patch). Examples: "1", "1.2", "1.2.3"
|
|
20
|
+
|
|
21
|
+
Example:
|
|
22
|
+
|
|
23
|
+
.. code-block:: python3
|
|
24
|
+
|
|
25
|
+
kameleoon_client.add_data(visitor_code, ApplicationVersion("1.2.3"))
|
|
26
|
+
"""
|
|
27
|
+
self.__version = version
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def version(self) -> str:
|
|
31
|
+
"""Returns the application version string."""
|
|
32
|
+
return self.__version
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def data_type(self) -> DataType:
|
|
36
|
+
return DataType.APPLICATION_VERSION
|
|
37
|
+
|
|
38
|
+
def __str__(self):
|
|
39
|
+
return f"ApplicationVersion{{version:{self.__version}}}"
|
{kameleoon_client_python-3.17.1 → kameleoon_client_python-3.19.0}/kameleoon/data/manager/visitor.py
RENAMED
|
@@ -6,6 +6,7 @@ from typing import Any, Callable, Optional, Dict, List, Iterator, Iterable, cast
|
|
|
6
6
|
|
|
7
7
|
from kameleoon.data.visitor_visits import VisitorVisits
|
|
8
8
|
from kameleoon.data.data import Data
|
|
9
|
+
from kameleoon.data.application_version import ApplicationVersion
|
|
9
10
|
from kameleoon.data.browser import Browser
|
|
10
11
|
from kameleoon.data.cbscores import CBScores
|
|
11
12
|
from kameleoon.data.conversion import Conversion
|
|
@@ -102,6 +103,14 @@ class Visitor: # pylint: disable=R0904
|
|
|
102
103
|
KameleoonLogger.debug('CALL/RETURN: Visitor.operating_system -> (operating_system: %s)', operating_system)
|
|
103
104
|
return operating_system
|
|
104
105
|
|
|
106
|
+
@property
|
|
107
|
+
def application_version(self) -> Optional[ApplicationVersion]:
|
|
108
|
+
"""Returns the application version information associated with this Visitor."""
|
|
109
|
+
application_version = self._data.application_version
|
|
110
|
+
KameleoonLogger.debug('CALL/RETURN: Visitor.application_version -> (application_version: %s)',
|
|
111
|
+
application_version)
|
|
112
|
+
return application_version
|
|
113
|
+
|
|
105
114
|
@property
|
|
106
115
|
def cookie(self) -> Optional[Cookie]:
|
|
107
116
|
"""Returns the cookie information associated with this Visitor."""
|
|
@@ -223,20 +232,22 @@ class Visitor: # pylint: disable=R0904
|
|
|
223
232
|
self._data.variations[variation.experiment_id] = variation
|
|
224
233
|
KameleoonLogger.debug('RETURN: Visitor.assign_variation(variation: %s)', variation)
|
|
225
234
|
|
|
226
|
-
def add_data(self, *args, overwrite: bool = True) -> None:
|
|
235
|
+
def add_data(self, *args, overwrite: bool = True, track: bool = True) -> None:
|
|
227
236
|
"""Adds data to the Visitor."""
|
|
228
|
-
KameleoonLogger.debug('CALL: Visitor.add_data(args: %s, overwrite: %s)', args, overwrite)
|
|
237
|
+
KameleoonLogger.debug('CALL: Visitor.add_data(args: %s, overwrite: %s, track: %s)', args, overwrite, track)
|
|
229
238
|
with self._data.lock:
|
|
230
239
|
for data in args:
|
|
231
240
|
if data is None:
|
|
232
241
|
continue
|
|
242
|
+
if not track and isinstance(data, Sendable):
|
|
243
|
+
data.mark_as_sent()
|
|
233
244
|
data_type = type(data)
|
|
234
245
|
data_adder = self.DATA_ADDERS.get(data_type)
|
|
235
246
|
if data_adder:
|
|
236
247
|
data_adder(self, self.DataAddingContext(data, overwrite))
|
|
237
248
|
else:
|
|
238
249
|
KameleoonLogger.warning("Data has unsupported type %s", data_type)
|
|
239
|
-
KameleoonLogger.debug('RETURN: Visitor.add_data(args: %s, overwrite: %s)', args, overwrite)
|
|
250
|
+
KameleoonLogger.debug('RETURN: Visitor.add_data(args: %s, overwrite: %s, track: %s)', args, overwrite, track)
|
|
240
251
|
|
|
241
252
|
@property
|
|
242
253
|
def mapping_identifier(self) -> Optional[str]:
|
|
@@ -302,6 +313,7 @@ class Visitor: # pylint: disable=R0904
|
|
|
302
313
|
self.visitor_visits: Optional[VisitorVisits] = None
|
|
303
314
|
self.mapping_identifier: Optional[str] = None
|
|
304
315
|
self.legal_consent = LegalConsent.UNKNOWN
|
|
316
|
+
self.application_version: Optional[ApplicationVersion] = None
|
|
305
317
|
|
|
306
318
|
def enumerate_sendable_data(self) -> Iterator[Sendable]:
|
|
307
319
|
"""Iterates over all sendable data associated with the visitor."""
|
|
@@ -420,6 +432,10 @@ class Visitor: # pylint: disable=R0904
|
|
|
420
432
|
if context.overwrite or self._data.operating_system is None:
|
|
421
433
|
self._data.operating_system = cast(OperatingSystem, context.data)
|
|
422
434
|
|
|
435
|
+
def _set_application_version(self, context: DataAddingContext) -> None:
|
|
436
|
+
if context.overwrite or self._data.application_version is None:
|
|
437
|
+
self._data.application_version = cast(ApplicationVersion, context.data)
|
|
438
|
+
|
|
423
439
|
def _set_cookie(self, context: DataAddingContext) -> None:
|
|
424
440
|
self._data.cookie = cast(Cookie, context.data)
|
|
425
441
|
|
|
@@ -482,6 +498,7 @@ class Visitor: # pylint: disable=R0904
|
|
|
482
498
|
Browser: _set_browser,
|
|
483
499
|
Geolocation: _set_geolocation,
|
|
484
500
|
OperatingSystem: _set_operating_system,
|
|
501
|
+
ApplicationVersion: _set_application_version,
|
|
485
502
|
Cookie: _set_cookie,
|
|
486
503
|
CustomData: _add_custom_data,
|
|
487
504
|
MappingIdentifier: _add_custom_data,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""Visitor Manager"""
|
|
2
|
+
|
|
2
3
|
import collections
|
|
3
4
|
import time
|
|
4
5
|
from typing import Any, Dict, Iterator, List, Optional
|
|
6
|
+
|
|
5
7
|
from kameleoon.configuration.custom_data_info import CustomDataInfo
|
|
6
8
|
from kameleoon.data import Conversion, CustomData
|
|
7
|
-
from kameleoon.data.mapping_identifier import MappingIdentifier
|
|
8
9
|
from kameleoon.data.manager.visitor import Visitor
|
|
9
10
|
from kameleoon.data.manager.visitor_slot import VisitorSlot
|
|
11
|
+
from kameleoon.data.mapping_identifier import MappingIdentifier
|
|
10
12
|
from kameleoon.helpers.scheduler import Scheduler
|
|
11
13
|
from kameleoon.logging.kameleoon_logger import KameleoonLogger
|
|
12
14
|
from kameleoon.managers.data.data_manager import DataManager
|
|
@@ -14,17 +16,16 @@ from kameleoon.managers.data.data_manager import DataManager
|
|
|
14
16
|
|
|
15
17
|
class VisitorManager:
|
|
16
18
|
"""Visitor manager"""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
KameleoonLogger.debug("CALL: VisitorManager(data_manager, expiration_period: %s, scheduler)",
|
|
21
|
-
expiration_period)
|
|
19
|
+
|
|
20
|
+
def __init__(self, data_manager: DataManager, expiration_period: float, scheduler: Scheduler) -> None:
|
|
21
|
+
KameleoonLogger.debug("CALL: VisitorManager(data_manager, expiration_period: %s, scheduler)", expiration_period)
|
|
22
22
|
self._data_manager = data_manager
|
|
23
23
|
self.__expiration_period = expiration_period
|
|
24
24
|
self._slots: Dict[str, VisitorSlot] = collections.defaultdict(VisitorSlot)
|
|
25
25
|
scheduler.schedule_job("VisitorManager.purge", expiration_period, self.__purge)
|
|
26
|
-
KameleoonLogger.debug(
|
|
27
|
-
|
|
26
|
+
KameleoonLogger.debug(
|
|
27
|
+
"RETURN: VisitorManager(data_manager, expiration_period: %s, scheduler)", expiration_period
|
|
28
|
+
)
|
|
28
29
|
|
|
29
30
|
def __iter__(self) -> Iterator[str]:
|
|
30
31
|
yield from list(self._slots)
|
|
@@ -44,8 +45,9 @@ class VisitorManager:
|
|
|
44
45
|
visitor = slot.visitor
|
|
45
46
|
finally:
|
|
46
47
|
slot.lock.release()
|
|
47
|
-
KameleoonLogger.debug(
|
|
48
|
-
|
|
48
|
+
KameleoonLogger.debug(
|
|
49
|
+
"RETURN: VisitorManager.get_visitor(visitor_code: %s) -> (visitor: %s)", visitor_code, visitor
|
|
50
|
+
)
|
|
49
51
|
return visitor
|
|
50
52
|
|
|
51
53
|
def get_or_create_visitor(self, visitor_code: str) -> Visitor:
|
|
@@ -62,7 +64,21 @@ class VisitorManager:
|
|
|
62
64
|
slot.lock.release()
|
|
63
65
|
KameleoonLogger.debug("RETURN: VisitorManager.get_or_create_visitor(visitor_code: %s)", visitor_code)
|
|
64
66
|
|
|
65
|
-
def
|
|
67
|
+
def peek_visitor(self, visitor_code: str) -> Optional[Visitor]:
|
|
68
|
+
"""Retrieves a visitor by their code if it exists, otherwise returns `None`."""
|
|
69
|
+
KameleoonLogger.debug(f"CALL: VisitorManager.peekVisitor(visitor_code: {visitor_code})")
|
|
70
|
+
if (slot := self.__try_acquire_slot(visitor_code)) is None:
|
|
71
|
+
visitor = None
|
|
72
|
+
else:
|
|
73
|
+
try:
|
|
74
|
+
visitor = slot.visitor
|
|
75
|
+
finally:
|
|
76
|
+
slot.lock.release()
|
|
77
|
+
KameleoonLogger.debug(
|
|
78
|
+
f"RETURN: VisitorManager.peekVisitor(visitor_code: {visitor_code}) -> "f"(visitor: {visitor})")
|
|
79
|
+
return visitor
|
|
80
|
+
|
|
81
|
+
def add_data(self, visitor_code: str, *args, track: bool = True) -> Visitor:
|
|
66
82
|
"""
|
|
67
83
|
Adds data to a visitor.
|
|
68
84
|
|
|
@@ -70,8 +86,13 @@ class VisitorManager:
|
|
|
70
86
|
* marks custom data of the local scope as unsent
|
|
71
87
|
* converts custom data with the mapping identifier index to the mapping identifier
|
|
72
88
|
* maps a visitor by its mapping identifier
|
|
89
|
+
|
|
90
|
+
:param track: A boolean indicating whether the data should be tracked (sent to server).
|
|
91
|
+
If False, sendable data will be marked as sent immediately. Default is True.
|
|
73
92
|
"""
|
|
74
|
-
KameleoonLogger.debug(
|
|
93
|
+
KameleoonLogger.debug(
|
|
94
|
+
"CALL: VisitorManager.add_data(visitor_code: %s, args: %s, track: %s)", visitor_code, args, track
|
|
95
|
+
)
|
|
75
96
|
visitor = self.get_or_create_visitor(visitor_code)
|
|
76
97
|
custom_data_info = self._data_manager.data_file.custom_data_info
|
|
77
98
|
data_to_add: List[Any] = [None] * len(args)
|
|
@@ -81,9 +102,13 @@ class VisitorManager:
|
|
|
81
102
|
elif isinstance(data, Conversion):
|
|
82
103
|
data = self.__process_conversion(data, custom_data_info)
|
|
83
104
|
data_to_add[i] = data
|
|
84
|
-
visitor.add_data(*data_to_add)
|
|
85
|
-
KameleoonLogger.debug(
|
|
86
|
-
|
|
105
|
+
visitor.add_data(*data_to_add, track=track)
|
|
106
|
+
KameleoonLogger.debug(
|
|
107
|
+
"RETURN: VisitorManager.add_data(visitor_code: %s, args: %s, track: %s) -> (visitor)",
|
|
108
|
+
visitor_code,
|
|
109
|
+
args,
|
|
110
|
+
track,
|
|
111
|
+
)
|
|
87
112
|
return visitor
|
|
88
113
|
|
|
89
114
|
def __process_custom_data(
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Version utility for parsing and comparing semantic versions"""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from kameleoon.logging.kameleoon_logger import KameleoonLogger
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SemVersion:
|
|
9
|
+
"""SemVersion (Semantic versions) is a utility class for parsing and comparing semantic versions.
|
|
10
|
+
|
|
11
|
+
Supports semantic versioning with major, minor, and patch components.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def from_string(version_string: str) -> Optional["SemVersion"]:
|
|
16
|
+
"""
|
|
17
|
+
Parses a version string into a Version object.
|
|
18
|
+
|
|
19
|
+
:param version_string: The version string to parse (e.g., "1", "1.2", "1.2.3")
|
|
20
|
+
:return: Version object or None if parsing failed
|
|
21
|
+
"""
|
|
22
|
+
versions = [0, 0, 0]
|
|
23
|
+
version_parts = version_string.split(".")
|
|
24
|
+
|
|
25
|
+
for i in range(min(len(versions), len(version_parts))):
|
|
26
|
+
try:
|
|
27
|
+
versions[i] = int(version_parts[i])
|
|
28
|
+
except ValueError:
|
|
29
|
+
KameleoonLogger.error("Invalid version component, index: %s, value: %s", i, version_parts[i])
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
return SemVersion(versions[0], versions[1], versions[2])
|
|
33
|
+
|
|
34
|
+
def __init__(self, major: int = 0, minor: int = 0, patch: int = 0) -> None:
|
|
35
|
+
"""
|
|
36
|
+
Creates a new Version.
|
|
37
|
+
|
|
38
|
+
:param major: Major version number
|
|
39
|
+
:param minor: Minor version number
|
|
40
|
+
:param patch: Patch version number
|
|
41
|
+
"""
|
|
42
|
+
self.major = major
|
|
43
|
+
self.minor = minor
|
|
44
|
+
self.patch = patch
|
|
45
|
+
|
|
46
|
+
def compare_to(self, other: "SemVersion") -> int:
|
|
47
|
+
"""
|
|
48
|
+
Compares SemVersion instances
|
|
49
|
+
"""
|
|
50
|
+
a = (self.major, self.minor, self.patch)
|
|
51
|
+
b = (other.major, other.minor, other.patch)
|
|
52
|
+
return (a > b) - (a < b)
|
|
53
|
+
|
|
54
|
+
def to_float(self) -> float:
|
|
55
|
+
"""
|
|
56
|
+
Converts the version to a float (only major and minor are considered).
|
|
57
|
+
|
|
58
|
+
:return: Float representation of the version (e.g., 1.2)
|
|
59
|
+
"""
|
|
60
|
+
return float(f"{self.major}.{self.minor}")
|