documente_shared 0.1.38__py3-none-any.whl → 0.1.40__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.

Potentially problematic release.


This version of documente_shared might be problematic. Click here for more details.

@@ -0,0 +1,23 @@
1
+ import sentry_sdk
2
+ from functools import wraps
3
+ from typing import Callable, Any, TypeVar
4
+
5
+ F = TypeVar("F", bound=Callable[..., Any])
6
+
7
+ def initialize_sentry(dsn: str, environment: str = 'dev') -> None:
8
+ if not sentry_sdk.Hub.current.client:
9
+ sentry_sdk.init(
10
+ dsn=dsn,
11
+ environment=environment,
12
+ )
13
+
14
+ def track_exceptions(func: F) -> F:
15
+ @wraps(func)
16
+ def wrapper(*args: Any, **kwargs: Any) -> Any:
17
+ try:
18
+ return func(*args, **kwargs)
19
+ except Exception as e:
20
+ sentry_sdk.capture_exception(e)
21
+ sentry_sdk.flush()
22
+ raise
23
+ return wrapper # type: ignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.38
3
+ Version: 0.1.40
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Requires-Dist: boto3 (>=1.34.102,<2.0.0)
15
15
  Requires-Dist: botocore (>=1.34.102,<2.0.0)
16
+ Requires-Dist: sentry-sdk (>=1.0.0,<2.0.0)
16
17
  Description-Content-Type: text/markdown
17
18
 
18
19
 
@@ -1,6 +1,7 @@
1
1
  documente_shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  documente_shared/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  documente_shared/application/digest.py,sha256=Um6E8WfFri2_lly4RFWydJyvSfPZGFcOX-opEOzDCWc,172
4
+ documente_shared/application/exceptions.py,sha256=lQM8m7wmI9OTLGva0gd7s7YT7ldaTk_Ln4t32PpzNf8,654
4
5
  documente_shared/application/time_utils.py,sha256=XDH27cKgoTFO8ad1JgrxKaeT7sZ1fduuJqLkvHUjy-Q,309
5
6
  documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
7
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
@@ -14,6 +15,6 @@ documente_shared/infrastructure/dynamo_repositories.py,sha256=w_AW3IACVxRU7A3mNm
14
15
  documente_shared/infrastructure/dynamo_table.py,sha256=dK05KgFvIYCmOdMpq9-OV_OBrP6cCngiUikCJrxlwt4,2112
15
16
  documente_shared/infrastructure/s3_bucket.py,sha256=Nf4bHSC3TJeaKvOQSVtV1hG8dWqEZZnA-JWU0PNTw24,1940
16
17
  documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
17
- documente_shared-0.1.38.dist-info/METADATA,sha256=oYUcJKoQvWxWiqVrSL5TUVN1SOt9fyzRncRNesDCtSo,640
18
- documente_shared-0.1.38.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
19
- documente_shared-0.1.38.dist-info/RECORD,,
18
+ documente_shared-0.1.40.dist-info/METADATA,sha256=JcqhZkn3tk2e6m7Rn8JnMNDqDTfCqGLZ6gaXsP4xy-U,683
19
+ documente_shared-0.1.40.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
20
+ documente_shared-0.1.40.dist-info/RECORD,,