├── .coveragerc ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── sonar.yaml │ └── tests.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .pylintrc ├── CONTRIBUTING.md ├── LICENSE.md ├── MANIFEST.in ├── README.md ├── examples ├── aml │ ├── .env.example │ ├── README.md │ ├── app.py │ └── requirements.txt ├── doc_scan │ ├── .env.example │ ├── .gitignore │ ├── README.md │ ├── __init__.py │ ├── app.py │ ├── requirements.in │ ├── requirements.txt │ ├── settings.py │ ├── static │ │ ├── images │ │ │ ├── favicon.png │ │ │ └── logo.svg │ │ └── style.css │ └── templates │ │ ├── error.html │ │ ├── index.html │ │ ├── layout │ │ ├── footer.html │ │ └── header.html │ │ ├── partials │ │ ├── check.html │ │ └── task.html │ │ └── success.html ├── yoti_example_django │ ├── .env.example │ ├── Dockerfile │ ├── README.md │ ├── app_settings.py │ ├── docker-compose.yml │ ├── manage.py │ ├── requirements.in │ ├── requirements.txt │ └── yoti_example │ │ ├── __init__.py │ │ ├── settings.py │ │ ├── static │ │ ├── .keep │ │ ├── assets │ │ │ ├── app-store-badge.png │ │ │ ├── app-store-badge@2x.png │ │ │ ├── company-logo.jpg │ │ │ ├── google-play-badge.png │ │ │ ├── google-play-badge@2x.png │ │ │ ├── icons │ │ │ │ ├── address.svg │ │ │ │ ├── calendar.svg │ │ │ │ ├── chevron-down-grey.svg │ │ │ │ ├── document.svg │ │ │ │ ├── email.svg │ │ │ │ ├── gender.svg │ │ │ │ ├── nationality.svg │ │ │ │ ├── phone.svg │ │ │ │ ├── profile.svg │ │ │ │ └── verified.svg │ │ │ ├── logo.png │ │ │ └── logo@2x.png │ │ ├── index.css │ │ └── profile.css │ │ ├── templates │ │ ├── attribute_snippet.html │ │ ├── dynamic-share.html │ │ ├── index.html │ │ └── profile.html │ │ ├── urls.py │ │ ├── views.py │ │ └── wsgi.py └── yoti_example_flask │ ├── .env.example │ ├── Dockerfile │ ├── README.md │ ├── app.py │ ├── docker-compose.yml │ ├── requirements.in │ ├── requirements.txt │ ├── settings.py │ ├── static │ ├── .keep │ ├── assets │ │ ├── app-store-badge.png │ │ ├── app-store-badge@2x.png │ │ ├── company-logo.jpg │ │ ├── google-play-badge.png │ │ ├── google-play-badge@2x.png │ │ ├── icons │ │ │ ├── address.svg │ │ │ ├── calendar.svg │ │ │ ├── chevron-down-grey.svg │ │ │ ├── document.svg │ │ │ ├── email.svg │ │ │ ├── gender.svg │ │ │ ├── nationality.svg │ │ │ ├── phone.svg │ │ │ ├── profile.svg │ │ │ └── verified.svg │ │ ├── logo.png │ │ └── logo@2x.png │ ├── index.css │ └── profile.css │ └── templates │ ├── dynamic-share.html │ ├── index.html │ └── profile.html ├── login_flow.png ├── pytest.ini ├── requirements.in ├── requirements.txt ├── setup.cfg ├── setup.py ├── sonar-project.properties └── yoti_python_sdk ├── __init__.py ├── activity_details.py ├── age_verification.py ├── aml.py ├── anchor.py ├── attribute.py ├── attribute_issuance_details.py ├── attribute_parser.py ├── client.py ├── config.py ├── crypto.py ├── date_parser.py ├── doc_scan ├── __init__.py ├── client.py ├── constants.py ├── endpoint.py ├── exception │ ├── __init__.py │ └── doc_scan_exception.py ├── session │ ├── __init__.py │ ├── create │ │ ├── __init__.py │ │ ├── check │ │ │ ├── __init__.py │ │ │ ├── document_authenticity.py │ │ │ ├── document_comparison.py │ │ │ ├── face_match.py │ │ │ ├── liveness.py │ │ │ └── requested_check.py │ │ ├── filter │ │ │ ├── __init__.py │ │ │ ├── document_filter.py │ │ │ ├── document_restrictions_filter.py │ │ │ ├── orthogonal_restrictions_filter.py │ │ │ ├── required_document.py │ │ │ ├── required_id_document.py │ │ │ └── required_supplementary_document.py │ │ ├── notification_config.py │ │ ├── objective │ │ │ ├── __init__.py │ │ │ ├── objective.py │ │ │ └── proof_of_address_objective.py │ │ ├── sdk_config.py │ │ ├── session_spec.py │ │ └── task │ │ │ ├── __init__.py │ │ │ ├── requested_task.py │ │ │ ├── supplementary_doc_text_extraction.py │ │ │ └── text_extraction.py │ └── retrieve │ │ ├── __init__.py │ │ ├── breakdown_response.py │ │ ├── check_response.py │ │ ├── create_session_result.py │ │ ├── document_fields_response.py │ │ ├── document_id_photo_response.py │ │ ├── face_map_response.py │ │ ├── file_response.py │ │ ├── frame_response.py │ │ ├── generated_check_response.py │ │ ├── generated_media.py │ │ ├── get_session_result.py │ │ ├── id_document_resource_response.py │ │ ├── liveness_resource_response.py │ │ ├── media_response.py │ │ ├── media_value.py │ │ ├── page_response.py │ │ ├── recommendation_response.py │ │ ├── report_response.py │ │ ├── resource_container.py │ │ ├── resource_response.py │ │ ├── supplementary_document_resource_response.py │ │ └── task_response.py └── support │ ├── __init__.py │ └── supported_documents.py ├── document_details.py ├── dynamic_sharing_service ├── __init__.py ├── dynamic_scenario_builder.py ├── extension │ ├── __init__.py │ ├── extension_builder.py │ ├── location_constraint_extension_builder.py │ ├── third_party_attribute_extension.py │ └── transactional_flow_extension_builder.py ├── policy │ ├── __init__.py │ ├── dynamic_policy_builder.py │ ├── source_constraint_builder.py │ ├── wanted_anchor_builder.py │ └── wanted_attribute_builder.py └── share_url.py ├── endpoint.py ├── exceptions.py ├── http.py ├── image.py ├── multivalue.py ├── profile.py ├── protobuf ├── __init__.py ├── attribute_public_api │ ├── Attribute_pb2.py │ ├── Attribute_pb2_grpc.py │ ├── ContentType_pb2.py │ ├── ContentType_pb2_grpc.py │ ├── List_pb2.py │ ├── List_pb2_grpc.py │ ├── Signing_pb2.py │ ├── Signing_pb2_grpc.py │ └── __init__.py ├── common_public_api │ ├── EncryptedData_pb2.py │ ├── EncryptedData_pb2_grpc.py │ ├── SignedTimestamp_pb2.py │ ├── SignedTimestamp_pb2_grpc.py │ └── __init__.py ├── protobuf.py └── share_public_api │ ├── DataEntry_pb2.py │ ├── DataEntry_pb2_grpc.py │ ├── ExtraData_pb2.py │ ├── ExtraData_pb2_grpc.py │ ├── IssuingAttributes_pb2.py │ ├── IssuingAttributes_pb2_grpc.py │ ├── ThirdPartyAttribute_pb2.py │ ├── ThirdPartyAttribute_pb2_grpc.py │ └── __init__.py ├── share ├── __init__.py └── extra_data.py ├── tests ├── __init__.py ├── anchor_fixture_parser.py ├── attribute_fixture_parser.py ├── conftest.py ├── doc_scan │ ├── __init__.py │ ├── conftest.py │ ├── exception │ │ ├── __init__.py │ │ └── test_doc_scan_exception.py │ ├── fixtures │ │ ├── failed_request.txt │ │ ├── retrieve_session_success.txt │ │ ├── session_create_success.txt │ │ └── supported_documents_success.txt │ ├── mocks.py │ ├── session │ │ ├── __init__.py │ │ ├── create │ │ │ ├── __init__.py │ │ │ ├── check │ │ │ │ ├── __init__.py │ │ │ │ ├── test_face_match_check.py │ │ │ │ ├── test_liveness_check.py │ │ │ │ ├── test_requested_document_authenticity_check.py │ │ │ │ └── test_requested_document_comparison_check.py │ │ │ ├── filter │ │ │ │ ├── __init__.py │ │ │ │ ├── test_document_restriction_builder.py │ │ │ │ ├── test_document_restrictions_filter.py │ │ │ │ ├── test_orthogonal_restrictions_filter.py │ │ │ │ ├── test_required_document.py │ │ │ │ ├── test_required_id_document.py │ │ │ │ └── test_required_supplementary_document.py │ │ │ ├── objective │ │ │ │ ├── __init__.py │ │ │ │ └── test_proof_of_address_objective.py │ │ │ ├── task │ │ │ │ ├── __init__.py │ │ │ │ ├── test_supplementary_doc_text_extraction_task.py │ │ │ │ └── test_text_extraction_task.py │ │ │ ├── test_notification_config.py │ │ │ ├── test_sdk_config.py │ │ │ └── test_session_spec.py │ │ └── retrieve │ │ │ ├── __init__.py │ │ │ ├── test_breakdown_response.py │ │ │ ├── test_check_response.py │ │ │ ├── test_create_session_result.py │ │ │ ├── test_document_fields_response.py │ │ │ ├── test_document_id_photo_response.py │ │ │ ├── test_face_map_response.py │ │ │ ├── test_file_response.py │ │ │ ├── test_frame_response.py │ │ │ ├── test_generated_check_response.py │ │ │ ├── test_generated_media.py │ │ │ ├── test_get_session_result.py │ │ │ ├── test_id_document_resource_response.py │ │ │ ├── test_liveness_resource_response.py │ │ │ ├── test_media_response.py │ │ │ ├── test_media_value.py │ │ │ ├── test_page_response.py │ │ │ ├── test_recommendation_response.py │ │ │ ├── test_report_response.py │ │ │ ├── test_resource_container.py │ │ │ ├── test_resource_response.py │ │ │ ├── test_supplementary_document_resource_response.py │ │ │ └── test_task_response.py │ ├── support │ │ ├── __init__.py │ │ └── test_supported_documents.py │ └── test_doc_scan_client.py ├── dynamic_sharing_service │ ├── __init__.py │ ├── extension │ │ ├── __init__.py │ │ ├── test_extension_builder.py │ │ ├── test_location_constraint_extension_builder.py │ │ ├── test_third_party_attribute_extension.py │ │ └── test_transactional_flow_extension_builder.py │ ├── policy │ │ ├── __init__.py │ │ ├── test_dynamic_policy_builder.py │ │ ├── test_source_constraint_builder.py │ │ ├── test_wanted_anchor_builder.py │ │ └── test_wanted_attribute_builder.py │ ├── test_dynamic_scenario_builder.py │ └── test_share_url.py ├── file_helper.py ├── fixtures │ ├── aml_response.txt │ ├── anchor_critical_last.txt │ ├── anchor_driving_license.txt │ ├── anchor_passport.txt │ ├── anchor_yoti_admin.txt │ ├── attribute_document_images.txt │ ├── auth_digest_get.txt │ ├── auth_digest_post.txt │ ├── auth_key.txt │ ├── encrypted_yoti_token.txt │ ├── response.txt │ ├── response_create_docs_scan_session.txt │ ├── response_empty_profile.txt │ ├── response_get_docs_scan_media_image.txt │ ├── response_get_docs_scan_media_json.txt │ ├── response_get_docs_scan_session.txt │ ├── response_missing_profile.txt │ ├── response_null_profile.txt │ ├── response_share_url.txt │ ├── sdk-test.pem │ ├── testthirdpartyattribute.txt │ └── unknown_anchor.txt ├── image_helper.py ├── mocks.py ├── protobuf_attribute.py ├── share │ ├── __init__.py │ ├── fixtures │ │ └── testextradata.txt │ └── test_extra_data.py ├── test_activity_details.py ├── test_age_verification.py ├── test_aml.py ├── test_anchor.py ├── test_attribute.py ├── test_attribute_issuance_details.py ├── test_attribute_parser.py ├── test_client.py ├── test_crypto.py ├── test_date_parser.py ├── test_document_details.py ├── test_http.py ├── test_image.py ├── test_multivalue.py └── test_profile.py ├── utils.py └── version.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = 3 | yoti_python_sdk/version.py 4 | yoti_python_sdk/tests/** 5 | yoti_python_sdk/protobuf/**/* 6 | examples/** 7 | 8 | [report] 9 | exclude_lines = 10 | raise NotImplementedError -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: " There's a better way to get help!" 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | # 11 | # Wait ✋ 12 | # 13 | # There's a better way to get help! 14 | # 15 | # Send your questions or issues to sdksupport@yoti.com 16 | # 17 | # 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | open-pull-requests-limit: 3 8 | target-branch: development 9 | -------------------------------------------------------------------------------- /.github/workflows/sonar.yaml: -------------------------------------------------------------------------------- 1 | name: Sonar Scan 2 | on: [push, pull_request_target] 3 | 4 | jobs: 5 | sonar: 6 | name: Sonar Scan 7 | runs-on: ubuntu-latest 8 | # always run on push events 9 | # only run on pull_request_target event when pull request pulls from fork repository 10 | if: > 11 | github.event_name == 'push' || 12 | github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | with: 17 | fetch-depth: 0 18 | 19 | - uses: actions/setup-python@v2.1.4 20 | with: 21 | python-version: 3.9 22 | 23 | - run: pip install -r requirements.txt 24 | 25 | - run: pip install -e .[dev] 26 | 27 | - run: pytest --cov=yoti_python_sdk yoti_python_sdk/tests --cov-report=xml:coverage-reports/coverage-new.xml 28 | 29 | - run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage-reports/coverage-new.xml 30 | 31 | - uses: sonarsource/sonarcloud-github-action@master 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 35 | 36 | -------------------------------------------------------------------------------- /.github/workflows/tests.yaml: -------------------------------------------------------------------------------- 1 | name: Unit Tests 2 | on: [push, pull_request_target] 3 | 4 | jobs: 5 | test: 6 | name: Test (Python ${{ matrix.python-version }}) 7 | runs-on: ubuntu-latest 8 | # always run on push events 9 | # only run on pull_request_target event when pull request pulls from fork repository 10 | if: > 11 | github.event_name == 'push' || 12 | github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | python-version: [3.7, 3.8, 3.9, "3.10"] 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | 21 | - uses: actions/setup-python@v2.3.1 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | 25 | - run: pip install -U setuptools 26 | 27 | - run: pip install -r requirements.txt 28 | 29 | - run: pip install -e .[dev] 30 | 31 | - run: pytest -v 32 | 33 | examples: 34 | name: Check Examples 35 | runs-on: ubuntu-latest 36 | if: > 37 | github.event_name == 'push' || 38 | github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository 39 | 40 | steps: 41 | - uses: actions/checkout@v2 42 | 43 | - uses: actions/setup-python@v2.3.1 44 | with: 45 | python-version: 3.9 46 | 47 | - run: pip install --upgrade setuptools 48 | 49 | - run: pushd examples/aml && pip install -r requirements.txt && popd 50 | 51 | - run: pushd examples/yoti_example_django && pip install --upgrade pip && pip install -r requirements.txt && popd 52 | 53 | - run: pushd examples/yoti_example_flask && pip install -r requirements.txt && popd 54 | 55 | - run: pushd examples/doc_scan && pip install -r requirements.txt && popd 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.* 45 | coverage-reports 46 | *,cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # IPython Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # dotenv 80 | .env 81 | 82 | # virtualenv 83 | venv/ 84 | ENV/ 85 | 86 | # Spyder project settings 87 | .spyderproject 88 | 89 | # Rope project settings 90 | .ropeproject 91 | 92 | # IDE 93 | .idea/ 94 | *.un~ 95 | .history/ 96 | .vscode 97 | 98 | # examples files 99 | examples/yoti_example_django/yoti_example/static/YotiSelfie.jpg 100 | examples/yoti_example_django/db.sqlite3 101 | examples/yoti_example_flask/static/YotiSelfie.jpg 102 | 103 | #.pem files for examples 104 | examples/yoti_example_django/*.pem 105 | examples/yoti_example_flask/*.pem 106 | 107 | .scannerwork 108 | .venv/ 109 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: protobuf/ 2 | repos: 3 | - repo: https://github.com/ambv/black 4 | rev: 22.3.0 5 | hooks: 6 | - id: black 7 | 8 | - repo: https://github.com/PyCQA/flake8 9 | rev: 4.0.1 10 | hooks: 11 | - id: flake8 12 | args: 13 | - --ignore=E501,W5 -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | ignore=tests,protobuf 3 | disable=C0330 -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | 1. Fork the repo, develop and test your code changes. 4 | 2. Ensure commit messages clearly define the changes that have been made. 5 | 3. Create a pull request. 6 | 7 | ## Adding Features 8 | 9 | Any features added must be fully tested and documented, with examples supplied in the pull request. 10 | The feature must support the lowest Python version that the SDK supports (see [the GitHub workflow tests file](./.github/workflows/tests.yaml) for all supported versions). The feature 11 | must not introduce any unnecessary dependencies (although introducing a new third party library 12 | is open for discussion if absolutely required). 13 | 14 | ## Pre-commit Hook 15 | 16 | * Install the [pre-commit framework](https://pre-commit.com/) 17 | * Run `pre-commit install` 18 | 19 | ## Testing 20 | 21 | After cloning the repository, run the following to install dependencies: 22 | 23 | ```bash 24 | pip install -r requirements.txt 25 | pip install -e .[dev] 26 | ``` 27 | 28 | Running the tests: 29 | 30 | ```bash 31 | pytest 32 | ``` 33 | 34 | ## Coding Style 35 | 36 | * The pre-commit hook uses the `black` formatter to auto-format any code when committing, 37 | along with `flake8` for style guide enforcement. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | Copyright © 2017 Yoti Ltd 3 | 4 | * * * 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | prune yoti_python_sdk/tests 2 | -------------------------------------------------------------------------------- /examples/aml/.env.example: -------------------------------------------------------------------------------- 1 | YOTI_CLIENT_SDK_ID=yourClientSdkId 2 | YOTI_KEY_FILE_PATH=yourKeyFilePath 3 | -------------------------------------------------------------------------------- /examples/aml/README.md: -------------------------------------------------------------------------------- 1 | ### AML Example Project 2 | 3 | 1. Rename the [.env.example](.env.example) file to `.env` and fill in the required configuration values 4 | 1. Install requirements with `pip install -r requirements.txt` 5 | 1. Run: `python app.py` -------------------------------------------------------------------------------- /examples/aml/app.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from os import environ 3 | from os.path import join, dirname 4 | 5 | from dotenv import load_dotenv 6 | 7 | from yoti_python_sdk import Client 8 | from yoti_python_sdk import aml 9 | 10 | dotenv_path = join(dirname(__file__), ".env") 11 | load_dotenv(dotenv_path) 12 | 13 | YOTI_CLIENT_SDK_ID = environ.get("YOTI_CLIENT_SDK_ID") 14 | YOTI_KEY_FILE_PATH = environ.get("YOTI_KEY_FILE_PATH") 15 | 16 | 17 | # The following exits cleanly on Ctrl-C, 18 | # while treating other exceptions as before. 19 | def cli_exception(exception_type, value, tb): 20 | if not issubclass(exception_type, KeyboardInterrupt): 21 | sys.__excepthook__(exception_type, value, tb) 22 | 23 | 24 | given_names = "Edward Richard George" 25 | family_name = "Heath" 26 | 27 | aml_address = aml.AmlAddress(country="GBR") 28 | aml_profile = aml.AmlProfile(given_names, family_name, aml_address) 29 | 30 | if sys.stdin.isatty(): 31 | sys.excepthook = cli_exception 32 | 33 | client = Client(YOTI_CLIENT_SDK_ID, YOTI_KEY_FILE_PATH) 34 | 35 | aml_result = client.perform_aml_check(aml_profile) 36 | print("AML Result for {0} {1}:".format(given_names, family_name)) 37 | print("On PEP list: " + str(aml_result.on_pep_list)) 38 | print("On fraud list: " + str(aml_result.on_fraud_list)) 39 | print("On watchlist: " + str(aml_result.on_watch_list)) 40 | -------------------------------------------------------------------------------- /examples/aml/requirements.txt: -------------------------------------------------------------------------------- 1 | yoti>=2.13.0 2 | python-dotenv>=0.7.1 3 | -------------------------------------------------------------------------------- /examples/doc_scan/.env.example: -------------------------------------------------------------------------------- 1 | # Required Keys 2 | YOTI_CLIENT_SDK_ID=yourClientSdkId 3 | YOTI_KEY_FILE_PATH=yourKeyFilePath 4 | -------------------------------------------------------------------------------- /examples/doc_scan/.gitignore: -------------------------------------------------------------------------------- 1 | *.pem -------------------------------------------------------------------------------- /examples/doc_scan/README.md: -------------------------------------------------------------------------------- 1 | # Doc Scan Example 2 | 3 | ## Running the example 4 | 5 | 1. Rename the [.env.example](.env.example) file to `.env` and fill in the required configuration values 6 | 1. Install the dependencies with `pip install -r requirements.txt` 7 | 1. Start the server `flask run --cert=adhoc` 8 | 1. Visit `https://localhost:5000` 9 | -------------------------------------------------------------------------------- /examples/doc_scan/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getyoti/yoti-python-sdk/6fe15da5a2f997a8c503d73f9aa145bc79ecc6a7/examples/doc_scan/__init__.py -------------------------------------------------------------------------------- /examples/doc_scan/requirements.in: -------------------------------------------------------------------------------- 1 | flask>=1.1.2 2 | python-dotenv>=0.13.0 3 | yoti>=2.13.0 4 | filetype>=1.0.7 5 | pyopenssl>=19.1.0 6 | -------------------------------------------------------------------------------- /examples/doc_scan/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile 3 | # To update, run: 4 | # 5 | # pip-compile --output-file=requirements.txt requirements.in 6 | # 7 | asn1==2.2.0 # via yoti 8 | certifi==2020.4.5.1 # via requests 9 | cffi==1.14.0 # via cryptography 10 | chardet==3.0.4 # via requests 11 | click==7.1.2 # via flask 12 | cryptography==3.2 # via pyopenssl, yoti 13 | deprecated==1.2.10 # via yoti 14 | filetype==1.0.7 # via -r requirements.in 15 | flask==1.1.2 # via -r requirements.in 16 | future==0.18.2 # via yoti 17 | idna==2.9 # via requests 18 | iso8601==0.1.13 # via yoti 19 | itsdangerous==1.1.0 # via flask 20 | jinja2==2.11.2 # via flask 21 | markupsafe==1.1.1 # via jinja2 22 | protobuf==3.11.3 # via yoti 23 | pycparser==2.20 # via cffi 24 | pyopenssl==19.1.0 # via -r requirements.in, yoti 25 | python-dotenv==0.13.0 # via -r requirements.in 26 | requests==2.23.0 # via yoti 27 | six==1.14.0 # via cryptography, protobuf, pyopenssl 28 | urllib3==1.25.9 # via requests 29 | werkzeug==1.0.1 # via flask 30 | wrapt==1.12.1 # via deprecated 31 | yoti==2.13.0 # via -r requirements.in 32 | 33 | # The following packages are considered to be unsafe in a requirements file: 34 | # setuptools 35 | -------------------------------------------------------------------------------- /examples/doc_scan/settings.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from os.path import dirname, join 3 | 4 | from dotenv import load_dotenv 5 | 6 | dotenv_path = join(dirname(__file__), ".env") 7 | load_dotenv(dotenv_path) 8 | 9 | YOTI_CLIENT_SDK_ID = environ.get("YOTI_CLIENT_SDK_ID", None) 10 | YOTI_KEY_FILE_PATH = environ.get("YOTI_KEY_FILE_PATH", None) 11 | 12 | if YOTI_CLIENT_SDK_ID is None or YOTI_KEY_FILE_PATH is None: 13 | raise ValueError("YOTI_CLIENT_SDK_ID or YOTI_KEY_FILE_PATH is None") 14 | 15 | YOTI_APP_BASE_URL = environ.get("YOTI_APP_BASE_URL", "https://localhost:5000") 16 | -------------------------------------------------------------------------------- /examples/doc_scan/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getyoti/yoti-python-sdk/6fe15da5a2f997a8c503d73f9aa145bc79ecc6a7/examples/doc_scan/static/images/favicon.png -------------------------------------------------------------------------------- /examples/doc_scan/static/images/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/doc_scan/static/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | padding-top: 4.5rem; 4 | } 5 | 6 | table td:first-child { 7 | width: 30%; 8 | } -------------------------------------------------------------------------------- /examples/doc_scan/templates/error.html: -------------------------------------------------------------------------------- 1 | {% include "layout/header.html" %} 2 |
{{ error }}
6 |