posthoganalytics 6.9.0__py3-none-any.whl → 6.9.1__py3-none-any.whl

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.
@@ -14,6 +14,10 @@ from posthoganalytics.contexts import (
14
14
  set_code_variables_mask_patterns_context as inner_set_code_variables_mask_patterns_context,
15
15
  set_code_variables_ignore_patterns_context as inner_set_code_variables_ignore_patterns_context,
16
16
  )
17
+ from posthoganalytics.exception_utils import (
18
+ DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS,
19
+ DEFAULT_CODE_VARIABLES_MASK_PATTERNS,
20
+ )
17
21
  from posthoganalytics.feature_flags import InconclusiveMatchError, RequiresServerEvaluation
18
22
  from posthoganalytics.types import FeatureFlag, FlagsAndPayloads, FeatureFlagResult
19
23
  from posthoganalytics.version import VERSION
@@ -177,6 +181,10 @@ enable_local_evaluation = True # type: bool
177
181
 
178
182
  default_client = None # type: Optional[Client]
179
183
 
184
+ capture_exception_code_variables = False
185
+ code_variables_mask_patterns = DEFAULT_CODE_VARIABLES_MASK_PATTERNS
186
+ code_variables_ignore_patterns = DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS
187
+
180
188
 
181
189
  # NOTE - this and following functions take unpacked kwargs because we needed to make
182
190
  # it impossible to write `posthog.capture(distinct-id, event-name)` - basically, to enforce
@@ -771,6 +779,9 @@ def setup() -> Client:
771
779
  enable_exception_autocapture=enable_exception_autocapture,
772
780
  log_captured_exceptions=log_captured_exceptions,
773
781
  enable_local_evaluation=enable_local_evaluation,
782
+ capture_exception_code_variables=capture_exception_code_variables,
783
+ code_variables_mask_patterns=code_variables_mask_patterns,
784
+ code_variables_ignore_patterns=code_variables_ignore_patterns,
774
785
  )
775
786
 
776
787
  # always set incase user changes it
@@ -725,21 +725,7 @@ class Client(object):
725
725
  Examples:
726
726
  ```python
727
727
  # Set with distinct id
728
- posthog.capture(
729
- 'event_name',
730
- distinct_id='user-distinct-id',
731
- properties={
732
- '$set': {'name': 'Max Hedgehog'},
733
- '$set_once': {'initial_url': '/blog'}
734
- }
735
- )
736
- ```
737
- ```python
738
- # Set using context
739
- from posthoganalytics import new_context, identify_context
740
- with new_context():
741
- identify_context('user-distinct-id')
742
- posthog.capture('event_name')
728
+ posthog.set(distinct_id='user123', properties={'name': 'Max Hedgehog'})
743
729
  ```
744
730
 
745
731
  Category:
@@ -1,4 +1,4 @@
1
- VERSION = "6.9.0"
1
+ VERSION = "6.9.1"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  print(VERSION, end="") # noqa: T201
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: posthoganalytics
3
- Version: 6.9.0
3
+ Version: 6.9.1
4
4
  Summary: Integrate PostHog into any python application.
5
5
  Home-page: https://github.com/posthog/posthog-python
6
6
  Author: Posthog
@@ -1,6 +1,6 @@
1
- posthoganalytics/__init__.py,sha256=_zAqJWGGR_saWREp2GioAaZM99qoZyXPB8GXct-z_3U,27256
1
+ posthoganalytics/__init__.py,sha256=K35kp-EBDz9fmffAgj9O4G5C639mB4nMIh5nb3yRpvU,27798
2
2
  posthoganalytics/args.py,sha256=iZ2JWeANiAREJKhS-Qls9tIngjJOSfAVR8C4xFT5sHw,3307
3
- posthoganalytics/client.py,sha256=8QTaZN84U_NyWCpNMnO7yQtxYw4vfMJ0ixXVikA6FCg,74670
3
+ posthoganalytics/client.py,sha256=BrVlQWWqh7h-9MtIFFeHvDGWx5X4wVk5vkzkqsTWnHU,74202
4
4
  posthoganalytics/consumer.py,sha256=CiNbJBdyW9jER3ZYCKbX-JFmEDXlE1lbDy1MSl43-a0,4617
5
5
  posthoganalytics/contexts.py,sha256=Qj8eprL71IVGo4nMtHCs7kIEhezOmxfkYpiPTg-rWjU,12618
6
6
  posthoganalytics/exception_capture.py,sha256=1VHBfffrXXrkK0PT8iVgKPpj_R1pGAzG5f3Qw0WF79w,1783
@@ -11,7 +11,7 @@ posthoganalytics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  posthoganalytics/request.py,sha256=Bsl2c5WwONKPQzwWMmKPX5VgOlwSiIcSNfhXgoz62Y8,6186
12
12
  posthoganalytics/types.py,sha256=Dl3aFGX9XUR0wMmK12r2s5Hjan9jL4HpQ9GHpVcEq5U,10207
13
13
  posthoganalytics/utils.py,sha256=-0w-OLcCaoldkbBebPzQyBzLJSo9G9yBOg8NDVz7La8,16088
14
- posthoganalytics/version.py,sha256=qTlEuCWb-slrdA36sMFDZPyA5fyBwCpQaHtWJmuEIgI,87
14
+ posthoganalytics/version.py,sha256=OMdDT60Qk45GJfzp5Rdz7eHHZuu4MYT9YrnOl-Mr1yY,87
15
15
  posthoganalytics/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  posthoganalytics/ai/sanitization.py,sha256=owipZ4eJYtd4JTI-CM_klatclXaeaIec3XJBOUfsOnQ,5770
17
17
  posthoganalytics/ai/types.py,sha256=arX98hR1PIPeJ3vFikxTlACIh1xPp6aEUw1gBLcKoB0,3273
@@ -47,8 +47,8 @@ posthoganalytics/test/test_request.py,sha256=Zc0VbkjpVmj8mKokQm9rzdgTr0b1U44vvMY
47
47
  posthoganalytics/test/test_size_limited_dict.py,sha256=-5IQjIEr_-Dql24M0HusdR_XroOMrtgiT0v6ZQCRvzo,774
48
48
  posthoganalytics/test/test_types.py,sha256=bRPHdwVpP7hu7emsplU8UVyzSQptv6PaG5lAoOD_BtM,7595
49
49
  posthoganalytics/test/test_utils.py,sha256=sqUTbfweVcxxFRd3WDMFXqPMyU6DvzOBeAOc68Py9aw,9620
50
- posthoganalytics-6.9.0.dist-info/licenses/LICENSE,sha256=wGf9JBotDkSygFj43m49oiKlFnpMnn97keiZKF-40vE,2450
51
- posthoganalytics-6.9.0.dist-info/METADATA,sha256=eVZTY6z46Bgtxy3p_6YtoAGXX7Mot6YfEdEKouixpew,6024
52
- posthoganalytics-6.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
- posthoganalytics-6.9.0.dist-info/top_level.txt,sha256=8QsNIqIkBh1p2TXvKp0Em9ZLZKwe3uIqCETyW4s1GOE,17
54
- posthoganalytics-6.9.0.dist-info/RECORD,,
50
+ posthoganalytics-6.9.1.dist-info/licenses/LICENSE,sha256=wGf9JBotDkSygFj43m49oiKlFnpMnn97keiZKF-40vE,2450
51
+ posthoganalytics-6.9.1.dist-info/METADATA,sha256=CWH4tuTz7m8A1jbt0j35Ew1u9T-m2XTzVQUdOMuy-_Y,6024
52
+ posthoganalytics-6.9.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
+ posthoganalytics-6.9.1.dist-info/top_level.txt,sha256=8QsNIqIkBh1p2TXvKp0Em9ZLZKwe3uIqCETyW4s1GOE,17
54
+ posthoganalytics-6.9.1.dist-info/RECORD,,