sharedkernel 1.2.0__tar.gz → 1.4.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.
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/PKG-INFO +7 -2
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/README.md +4 -1
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/setup.py +4 -2
- sharedkernel-1.4.0/sharedkernel/date_converter.py +32 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/enum/error_code.py +2 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/exception/exception_handlers.py +4 -3
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel.egg-info/PKG-INFO +7 -2
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel.egg-info/SOURCES.txt +1 -1
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel.egg-info/requires.txt +2 -0
- sharedkernel-1.2.0/sharedkernel/config.py +0 -12
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/setup.cfg +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/common.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/__init__.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/mongo_generic_repository.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/vector_database_repository/__init__.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/vector_database_repository/chroma_startegy.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/vector_database_repository/milvus_strategy.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/vector_database_repository/vector_database_repository.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/database/vector_database_repository/vector_database_strategy.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/enum/__init__.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/enum/vector_database_type.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/exception/__init__.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/exception/exception.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/jwt_service.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/objects/__init__.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/objects/base_document.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/objects/jwt_model.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/objects/result.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/regex_masking.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel/string_extentions.py +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel.egg-info/dependency_links.txt +0 -0
- {sharedkernel-1.2.0 → sharedkernel-1.4.0}/sharedkernel.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sharedkernel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: sharekernel is an shared package between all python projects
|
|
5
5
|
Author: Smilinno
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -12,17 +12,22 @@ Requires-Dist: PyJWT
|
|
|
12
12
|
Requires-Dist: pymilvus
|
|
13
13
|
Requires-Dist: chromadb
|
|
14
14
|
Requires-Dist: persian_tools
|
|
15
|
+
Requires-Dist: sentry-sdk
|
|
16
|
+
Requires-Dist: jdatetime
|
|
15
17
|
|
|
16
18
|
# SharedKernel
|
|
17
19
|
this a shared kernel package
|
|
18
20
|
|
|
19
21
|
# Change Log
|
|
22
|
+
### Version 1.4.0
|
|
23
|
+
- Implement date convertor for jalali and georgian
|
|
24
|
+
### Version 1.3.0
|
|
25
|
+
- Implement Sentry For Log Exceptions
|
|
20
26
|
### Version 1.2.0
|
|
21
27
|
- Implement Regex Masking
|
|
22
28
|
# Create Package
|
|
23
29
|
py -m pip install --upgrade build
|
|
24
30
|
py -m build
|
|
25
|
-
cd dist
|
|
26
31
|
py -m pip install --upgrade twine
|
|
27
32
|
py -m twine upload dist/*
|
|
28
33
|
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
this a shared kernel package
|
|
3
3
|
|
|
4
4
|
# Change Log
|
|
5
|
+
### Version 1.4.0
|
|
6
|
+
- Implement date convertor for jalali and georgian
|
|
7
|
+
### Version 1.3.0
|
|
8
|
+
- Implement Sentry For Log Exceptions
|
|
5
9
|
### Version 1.2.0
|
|
6
10
|
- Implement Regex Masking
|
|
7
11
|
# Create Package
|
|
8
12
|
py -m pip install --upgrade build
|
|
9
13
|
py -m build
|
|
10
|
-
cd dist
|
|
11
14
|
py -m pip install --upgrade twine
|
|
12
15
|
py -m twine upload dist/*
|
|
13
16
|
|
|
@@ -27,10 +27,12 @@ setup(
|
|
|
27
27
|
"PyJWT",
|
|
28
28
|
"pymilvus",
|
|
29
29
|
"chromadb",
|
|
30
|
-
"persian_tools"
|
|
30
|
+
"persian_tools",
|
|
31
|
+
"sentry-sdk",
|
|
32
|
+
"jdatetime"
|
|
31
33
|
],
|
|
32
34
|
# *strongly* suggested for sharing
|
|
33
|
-
version="1.
|
|
35
|
+
version="1.4.0",
|
|
34
36
|
description="sharekernel is an shared package between all python projects",
|
|
35
37
|
long_description=long_description,
|
|
36
38
|
long_description_content_type="text/markdown",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import jdatetime
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
|
|
4
|
+
from sharedkernel.enum import ErrorCode
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DateConverter:
|
|
8
|
+
@staticmethod
|
|
9
|
+
def to_jalali(
|
|
10
|
+
input_datetime: datetime | jdatetime.datetime, format_string: str = "%Y/%m/%d"
|
|
11
|
+
):
|
|
12
|
+
if isinstance(input_datetime, jdatetime.datetime):
|
|
13
|
+
return input_datetime.strftime(format_string)
|
|
14
|
+
|
|
15
|
+
if isinstance(input_datetime, datetime):
|
|
16
|
+
jalali_date = jdatetime.datetime.fromgregorian(date=input_datetime)
|
|
17
|
+
return jalali_date.strftime(format_string)
|
|
18
|
+
|
|
19
|
+
raise ValueError(ErrorCode.Unsupported_Date_Type)
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def to_georgian(
|
|
23
|
+
input_datetime: datetime | jdatetime.datetime, format_string: str = "%Y/%m/%d"
|
|
24
|
+
):
|
|
25
|
+
if isinstance(input_datetime, jdatetime.datetime):
|
|
26
|
+
georgian_date = jdatetime.datetime.togregorian(input_datetime)
|
|
27
|
+
return georgian_date.strftime(format_string)
|
|
28
|
+
|
|
29
|
+
if isinstance(input_datetime, datetime):
|
|
30
|
+
return input_datetime.strftime(format_string)
|
|
31
|
+
|
|
32
|
+
raise ValueError(ErrorCode.Unsupported_Date_Type)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import sentry_sdk
|
|
2
2
|
from fastapi import Request,status
|
|
3
3
|
import requests
|
|
4
4
|
from fastapi.responses import JSONResponse
|
|
@@ -13,8 +13,8 @@ from sharedkernel.objects import Result
|
|
|
13
13
|
from sharedkernel.enum.error_code import ErrorCode
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
async def http_exception_handler(request: Request, exc: HTTPException):
|
|
17
|
+
sentry_sdk.capture_exception(exc)
|
|
18
18
|
if type(exc)==UnAuthorizedException :
|
|
19
19
|
return await custom_http_exception_handler(
|
|
20
20
|
request,
|
|
@@ -39,6 +39,7 @@ async def http_exception_handler(request: Request, exc: HTTPException):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
async def business_http_exception_handler(request: Request, exc: BusinessException):
|
|
42
|
+
sentry_sdk.capture_exception(exc)
|
|
42
43
|
return await custom_http_exception_handler(
|
|
43
44
|
request,
|
|
44
45
|
CustomException
|
|
@@ -61,7 +62,7 @@ async def custom_http_exception_handler(request: Request, exc: CustomException):
|
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
async def exception_handler(request: Request, exc: Exception):
|
|
64
|
-
|
|
65
|
+
sentry_sdk.capture_exception(exc)
|
|
65
66
|
return await custom_http_exception_handler(
|
|
66
67
|
request,
|
|
67
68
|
CustomException(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sharedkernel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: sharekernel is an shared package between all python projects
|
|
5
5
|
Author: Smilinno
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -12,17 +12,22 @@ Requires-Dist: PyJWT
|
|
|
12
12
|
Requires-Dist: pymilvus
|
|
13
13
|
Requires-Dist: chromadb
|
|
14
14
|
Requires-Dist: persian_tools
|
|
15
|
+
Requires-Dist: sentry-sdk
|
|
16
|
+
Requires-Dist: jdatetime
|
|
15
17
|
|
|
16
18
|
# SharedKernel
|
|
17
19
|
this a shared kernel package
|
|
18
20
|
|
|
19
21
|
# Change Log
|
|
22
|
+
### Version 1.4.0
|
|
23
|
+
- Implement date convertor for jalali and georgian
|
|
24
|
+
### Version 1.3.0
|
|
25
|
+
- Implement Sentry For Log Exceptions
|
|
20
26
|
### Version 1.2.0
|
|
21
27
|
- Implement Regex Masking
|
|
22
28
|
# Create Package
|
|
23
29
|
py -m pip install --upgrade build
|
|
24
30
|
py -m build
|
|
25
|
-
cd dist
|
|
26
31
|
py -m pip install --upgrade twine
|
|
27
32
|
py -m twine upload dist/*
|
|
28
33
|
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# MONGO CONFIG
|
|
3
|
-
|
|
4
|
-
# MONGO_CONNECTION_STRING = "mongodb://localhost:27017"
|
|
5
|
-
MONGO_CONNECTION_STRING = "mongodb://admin:Xp!j1h73ALrD@188.121.112.202:27017"
|
|
6
|
-
|
|
7
|
-
# AUTHENTICATION
|
|
8
|
-
|
|
9
|
-
JWT_ISSURE = "enterprise-identity"
|
|
10
|
-
JWT_AUDIENCE = "AdminPortal"
|
|
11
|
-
JWT_SECRETKEY = "ThereR_10_Project$@$milinnoBut50%OfThemRPublished"
|
|
12
|
-
JWT_ALGORITHM= "HS256"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|