Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- run: pip install -r requirements.txt

- run: pip install -e .[dev]
- run: pip install -e ".[dev]"

- run: pytest --cov=yoti_python_sdk yoti_python_sdk/tests --cov-report=xml:coverage-reports/coverage-new.xml

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:

- run: pip install --upgrade setuptools

- run: pip install -e .

- run: pushd examples/aml && pip install -r requirements.txt && popd

- run: pushd examples/yoti_example_django && pip install --upgrade pip && pip install -r requirements.txt && popd
Expand Down
14 changes: 7 additions & 7 deletions examples/doc_scan/requirements.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Core requirements
flask>=2.2.0
python-dotenv>=0.21.0
yoti==2.14.0
# yoti will be installed separately in CI from local source
filetype>=1.0.7
pyopenssl==23.2.0
click >=8.0
pyopenssl>=24.0.0
click>=8.0
future>=1.0.0

# Required for yoti compatibility
deprecated==1.2.10
iso8601==0.1.13
pytz==2020.4

deprecated>=1.2.14
iso8601>=1.1.0
pytz>=2025.2
31 changes: 14 additions & 17 deletions examples/doc_scan/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ cryptography==41.0.7
# via
# pyopenssl
# yoti
deprecated==1.2.10

deprecated>=1.2.14
# via
# -r requirements.in
# yoti
filetype==1.0.7
# via -r requirements.in
flask==3.1.0
flask>=2.2.0
# via -r requirements.in
future==1.0.0
# via yoti
future>=1.0.0
# via
# -r requirements.in
# yoti
idna==2.9
# via requests
iso8601==0.1.13

iso8601>=1.1.0
# via
# -r requirements.in
# yoti
Expand All @@ -51,34 +51,31 @@ markupsafe==3.0.2
# jinja2
# werkzeug

protobuf==3.11.3
protobuf==4.21.12
# via yoti
pycparser==2.20
pycparser==2.22
# via cffi

pyopenssl==23.2.0
pyopenssl>=24.0.0
# via
# -r requirements.in
# yoti
python-dotenv==1.1.0
# via -r requirements.in
pytz==2020.4
pytz>=2025.2
# via
# -r requirements.in
# yoti
requests==2.23.0
requests>=2.31.0
# via yoti
six==1.14.0
six>=1.16.0
# via protobuf
urllib3==1.25.9
# via requests
werkzeug==3.1.3
# via flask
wrapt==1.17.2

# via deprecated
yoti==2.14.0
# via -r requirements.in
# yoti will be installed separately in CI from local source

# The following packages are considered to be unsafe in a requirements file:
# setuptools
10 changes: 6 additions & 4 deletions examples/yoti_example_flask/requirements.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
click>=7
cffi>=1.15.0
cryptography>=42.0.0
flask>=1.0.4
future>=1.0.0
jinja2>=3.0.3
pyopenssl>=19.0.0
pyopenssl>=24.0.0
python-dotenv>=0.7.1
requests>=2.20.0
requests>=2.31.0
urllib3>=1.24.2
yoti>=2.14.0
# yoti will be installed separately in CI from local source
werkzeug>=1.0.1
six==1.16.0
six==1.16.0
27 changes: 14 additions & 13 deletions examples/yoti_example_flask/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,43 @@ click==8.1.2
# via
# -r requirements.in
# flask
cryptography==3.2
cryptography>=42.0.0
# via
# pyopenssl
# yoti
deprecated==1.2.10
deprecated==1.2.18
# via yoti
flask==1.1.1
# via -r requirements.in
future==0.16.0
# via yoti
future==1.0.0
# via
# -r requirements.in
# yoti
idna==2.7
# via requests
iso8601==0.1.13
iso8601>=1.1.0
# via yoti
itsdangerous==0.24
itsdangerous==1.1.0
# via flask
jinja2==3.0.3
# via
# -r requirements.in
# flask
markupsafe==2.0.1
# via jinja2
protobuf==3.6.0
protobuf==4.21.12
# via yoti
pycparser==2.18
# via cffi
pyopenssl==19.0.0
pyopenssl>=24.0.0
# via
# -r requirements.in
# yoti
python-dotenv==0.8.2
python-dotenv>=0.7.1
# via -r requirements.in
pytz==2020.4
pytz>=2025.2
# via yoti
requests==2.21.0
requests>=2.31.0
# via
# -r requirements.in
# yoti
Expand All @@ -72,8 +74,7 @@ werkzeug==1.0.1
# flask
wrapt==1.12.1
# via deprecated
yoti==2.14.0
# via -r requirements.in
# yoti will be installed separately in CI from local source

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cffi>=1.16.0
future>=0.18.3
itsdangerous>=2.1.2
pbr>=5.11.1
protobuf==3.20.3
protobuf>=4.21.12
pyopenssl>=24.0.0
PyYAML>=6.0
pytz>=2025.2
Expand Down
13 changes: 1 addition & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#

# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:

#
# pip-compile --output-file=requirements.txt requirements.in
#
asn1==2.2.0
# via -r requirements.in
certifi==2018.11.29
# via requests

cffi==1.17.1
# via
# -r requirements.in
Expand All @@ -21,18 +18,15 @@ cryptography==44.0.2
# via
# -r requirements.in
# pyopenssl

deprecated==1.2.18
# via -r requirements.in
future==1.0.0
# via -r requirements.in
idna==2.7
# via requests

iso8601==2.1.0
# via -r requirements.in
itsdangerous==2.2.0

# via -r requirements.in
pbr==6.1.1
# via -r requirements.in
Expand All @@ -44,9 +38,7 @@ pycparser==2.18
# via cffi
pyopenssl==25.0.0
# via -r requirements.in

pytz==2025.2

# via -r requirements.in
pyyaml==6.0.2
# via -r requirements.in
Expand All @@ -67,6 +59,3 @@ wrapt==1.17.2

# The following packages are considered to be unsafe in a requirements file:
# setuptools



4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
url="https://github.com/getyoti/yoti-python-sdk",
author="Yoti",
author_email="websdk@yoti.com",
python_requires=">=3.9",
install_requires=[

"asn1==2.2.0", # still pinned due to enum34 issue
"cryptography>=42.0.0",
"protobuf==3.20.3",
"protobuf>=4.21.12",
"requests>=2.31.0",
"pyopenssl>=24.0.0",
"pytz>=2025.2",
Expand Down Expand Up @@ -57,7 +58,6 @@
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Programming Language :: Python",

"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sonar.host.url = https://sonarcloud.io
sonar.organization = getyoti
sonar.projectKey = getyoti:python
sonar.projectName = Python SDK
sonar.projectVersion = 2.14.3
sonar.projectVersion = 2.14.5
sonar.exclusions = yoti_python_sdk/tests/**,examples/**,yoti_python_sdk/protobuf/**/*

sonar.python.pylint.reportPath = coverage.out
Expand Down
2 changes: 1 addition & 1 deletion yoti_python_sdk/anchor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import OpenSSL
import asn1
import yoti_python_sdk.protobuf.common_public_api.SignedTimestamp_pb2 as compubapi
import yoti_python_sdk.protobuf.compubapi_v1.SignedTimestamp_pb2 as compubapi
from OpenSSL import crypto

from yoti_python_sdk import config
Expand Down
1 change: 1 addition & 0 deletions yoti_python_sdk/doc_scan/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION = (
"SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION"
)
VERIFY_SHARE_CODE_TASK = "VERIFY_SHARE_CODE_TASK"

CAMERA = "CAMERA"
CAMERA_AND_UPLOAD = "CAMERA_AND_UPLOAD"
Expand Down
2 changes: 1 addition & 1 deletion yoti_python_sdk/doc_scan/session/create/session_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
:param block_biometric_consent: block the collection of biometric consent
:type block_biometric_consent: bool
:param session_deadline: session deadline using a Zoned timestamp
"type session_deadline: str
:type session_deadline: str
"""
if requested_tasks is None:
requested_tasks = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-

from yoti_python_sdk.doc_scan.session.create.filter.document_filter import DocumentFilter
from yoti_python_sdk.utils import YotiSerializable
from .sub_check import SubRequestedCheck
from yoti_python_sdk.utils import YotiSerializable, remove_null_values


class IssuingAuthoritySubCheck(SubRequestedCheck):
class IssuingAuthoritySubCheck(YotiSerializable):
"""
Requests creation of an Issuing Authority Sub Check.
"""
Expand All @@ -21,6 +20,9 @@ def requested(self):
def filter(self):
return self._filter

def to_json(self):
return remove_null_values({"requested": self.requested, "filter": self.filter})


class IssuingAuthoritySubCheckBuilder:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABCMeta
from abc import abstractmethod

from yoti_python_sdk.utils import YotiSerializable
from yoti_python_sdk.utils import YotiSerializable, remove_null_values


class SubRequestedCheck(YotiSerializable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __parse_check(check):
constants.ID_DOCUMENT_FACE_MATCH: FaceMatchCheckResponse,
constants.ID_DOCUMENT_TEXT_DATA_CHECK: TextDataCheckResponse,
constants.LIVENESS: LivenessCheckResponse,
constants.WATCHLIST_SCREENING_CHECK_TYPE: WatchlistScreeningCheckResponse,
constants.WATCHLIST_SCREENING_CHECK_TYPE: WatchlistScreeningCheckResponse,
constants.ID_DOCUMENT_COMPARISON: IDDocumentComparisonCheckResponse,
constants.SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK: SupplementaryDocumentTextDataCheckResponse,
}
Expand Down
18 changes: 18 additions & 0 deletions yoti_python_sdk/doc_scan/session/retrieve/resource_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from yoti_python_sdk.doc_scan.session.retrieve.static_liveness_resource_response import (
StaticLivenessResourceResponse,
)
from yoti_python_sdk.doc_scan.session.retrieve.share_code_resource_response import (
ShareCodeResourceResponse,
)


class ResourceContainer(object):
Expand Down Expand Up @@ -45,6 +48,11 @@ def __init__(self, data=None):
for liveness in data.get("liveness_capture", [])
]

self.__share_codes = [
ShareCodeResourceResponse(share_code)
for share_code in data.get("share_codes", [])
]

@staticmethod
def __parse_liveness_capture(liveness_capture):
"""
Expand Down Expand Up @@ -122,3 +130,13 @@ def static_liveness_resources(self):
for liveness in self.__liveness_capture
if isinstance(liveness, StaticLivenessResourceResponse)
]

@property
def share_codes(self):
"""
Return a list of share code resources

:return: list of share codes
:rtype: list[ShareCodeResourceResponse]
"""
return self.__share_codes
Loading
Loading