{"id":23698059,"url":"https://github.com/inloco/incognia-python","last_synced_at":"2025-07-16T11:33:47.591Z","repository":{"id":39675947,"uuid":"410021452","full_name":"inloco/incognia-python","owner":"inloco","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-30T16:19:25.000Z","size":206,"stargazers_count":4,"open_issues_count":4,"forks_count":2,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-07-06T08:51:25.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inloco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-24T15:53:45.000Z","updated_at":"2025-06-30T16:19:29.000Z","dependencies_parsed_at":"2023-11-10T18:24:53.913Z","dependency_job_id":"a656b41c-d66b-4d92-b817-ac2518913ed1","html_url":"https://github.com/inloco/incognia-python","commit_stats":{"total_commits":140,"total_committers":4,"mean_commits":35.0,"dds":"0.22857142857142854","last_synced_commit":"859eaa91faec03fdf85936e64c24e57c4b4ec660"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/inloco/incognia-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloco%2Fincognia-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloco%2Fincognia-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloco%2Fincognia-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloco%2Fincognia-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inloco","download_url":"https://codeload.github.com/inloco/incognia-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloco%2Fincognia-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265506146,"owners_count":23778664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-30T07:13:27.853Z","updated_at":"2025-07-16T11:33:47.555Z","avatar_url":"https://github.com/inloco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Incognia API Python Client 🐍\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-360/)\n![test workflow](https://github.com/inloco/incognia-api-java/actions/workflows/test.yaml/badge.svg)\n\n## Installation\n\nYou can install the IncogniaAPI using the following command:\n\n```shell\npip install incognia-python\n```\n\n## Usage\n\n### Configuration\n\nBefore calling the API methods, you need to create an instance of the `IncogniaAPI` class.\n\n```python3\nfrom incognia.api import IncogniaAPI\n\napi = IncogniaAPI('client-id', 'client-secret')\n```\n\n### Incognia API\n\nThe implementation is based on the [Incognia API Reference](https://developer.incognia.com/docs/).\n\n#### Authentication\n\nAuthentication is done transparently, so you don't need to worry about it.\n\n#### Registering New Signup\n\nThis method registers a new signup for the given request token and a structured address, an address\nline or coordinates, returning a `dict`, containing the risk assessment and supporting evidence:\n\n```python3\nfrom incognia.api import IncogniaAPI\nfrom incognia.models import StructuredAddress, Coordinates\n\napi = IncogniaAPI('client-id', 'client-secret')\n\n# with structured address, a dict:\nstructured_address: StructuredAddress = {\n    'locale': 'en-US',\n    'country_name': 'United States of America',\n    'country_code': 'US',\n    'state': 'NY',\n    'city': 'New York City',\n    'borough': 'Manhattan',\n    'neighborhood': 'Midtown',\n    'street': 'W 34th St.',\n    'number': '20',\n    'complements': 'Floor 2',\n    'postal_code': '10001'\n}\nassessment: dict = api.register_new_signup('request-token', structured_address=structured_address)\n\n# with address line:\naddress_line: str = '350 Fifth Avenue, Manhattan, New York 10118'\nassessment: dict = api.register_new_signup('request-token', address_line=address_line)\n\n# with coordinates, a dict:\ncoordinates: Coordinates = {\n    'lat': 40.74836007062138,\n    'lng': -73.98509720487937\n}\nassessment: dict = api.register_new_signup('request-token', address_coordinates=coordinates)\n\n# with external_id:\nexternal_id: str = 'external-id'\nassessment: dict = api.register_new_signup('request-token', external_id=external_id)\n\n# with policy_id:\npolicy_id: str = 'policy-id'\nassessment: dict = api.register_new_signup('request-token', policy_id=policy_id)\n\n# with account_id:\naccount_id: str = 'account-id'\nassessment: dict = api.register_new_signup('request-token', account_id=account_id)\n\n```\n\n#### Registering Feedback\n\nThis method registers a feedback event for the given identifiers (optional arguments) related to a\nsignup, login or payment.\n\n```python3\nimport datetime as dt\nfrom incognia.api import IncogniaAPI\nfrom incognia.feedback_events import FeedbackEvents  # feedbacks are strings.\n\napi = IncogniaAPI('client-id', 'client-secret')\n\napi.register_feedback(FeedbackEvents.ACCOUNT_TAKEOVER,\n                      occurred_at=dt.datetime(2024, 7, 22, 15, 20, 0, tzinfo=dt.timezone.utc),\n                      request_token='request-token',\n                      account_id='account-id')\n```\n\n#### Registering Payment\n\nThis method registers a new payment for the given request token and account, returning a `dict`,\ncontaining the risk assessment and supporting evidence.\n\n```python3\nfrom typing import List\nfrom incognia.api import IncogniaAPI\nfrom incognia.models import TransactionAddress, PaymentValue, PaymentMethod\n\napi = IncogniaAPI('client-id', 'client-secret')\n\naddresses: List[TransactionAddress] = [\n    {\n        'type': 'shipping',\n        'structured_address': {\n            'locale': 'pt-BR',\n            'country_name': 'Brasil',\n            'country_code': 'BR',\n            'state': 'SP',\n            'city': 'São Paulo',\n            'borough': '',\n            'neighborhood': 'Bela Vista',\n            'street': 'Av. Paulista',\n            'number': '1578',\n            'complements': 'Andar 2',\n            'postal_code': '01310-200'\n        },\n        'address_coordinates': {\n            'lat': -23.561414,\n            'lng': -46.6558819\n        }\n    }\n]\n\npayment_value: PaymentValue = {\n    'amount': 5.0,\n    'currency': 'BRL'\n}\n\npayment_methods: List[PaymentMethod] = [\n    {\n        'type': 'credit_card',\n        'credit_card_info': {\n            'bin': '123456',\n            'last_four_digits': '1234',\n            'expiry_year': '2027',\n            'expiry_month': '10'\n        }\n    },\n    {\n        'type': 'debit_card',\n        'debit_card_info': {\n            'bin': '123456',\n            'last_four_digits': '1234',\n            'expiry_year': '2027',\n            'expiry_month': '10'\n        }\n    }\n]\n\npolicy_id: str = 'policy-id'\n\nassessment: dict = api.register_payment('request-token',\n                                        'account-id',\n                                        'external-id',\n                                        addresses=addresses,\n                                        payment_value=payment_value,\n                                        payment_methods=payment_methods,\n                                        policy_id=policy_id)\n```\n\n#### Registering Login\n\nThis method registers a new login for the given request token and account, returning a `dict`,\ncontaining the risk assessment and supporting evidence.\n\n```python3\nfrom incognia.api import IncogniaAPI\n\napi = IncogniaAPI('client-id', 'client-secret')\n\npolicy_id: str = 'policy-id'\n\nassessment: dict = api.register_login('request-token', \n                                      'account-id', \n                                      'external-id', \n                                      policy_id='policy_id')\n```\n\n## Error Handling\n\nEvery method call can throw `IncogniaHTTPError` and `IncogniaError`.\n\n`IncogniaHTTPError` is thrown when the API returned an unexpected http status code.\n\n`IncogniaError` represents unknown errors, like required parameters none or empty.\n\n## How to Contribute\n\nYour contributions are highly appreciated. If you have found a bug or if you have a feature request,\nplease report them at this repository\n[issues section](https://github.com/inloco/incognia-python/issues).\n\n### Development\n\n#### Versioning\n\nThis project uses [Semantic Versioning](https://semver.org/), where version follows\n`v{MAJOR}.{MINOR}.{PATCH}` format. In summary:\n\n- _Major version update_ - Major functionality changes. Might not have direct backward\n  compatibility.\n  For example, multiple public API parameter changes.\n- _Minor version update_ - Additional features. Major bug fixes. Might have some minor backward\n  compatibility issues. For example, an extra parameter on a callback function.\n- _Patch version update_ - Minor features. Bug fixes. Full backward compatibility. For example,\n  extra fields added to the public structures with version bump.\n\n#### Release\n\nOn GitHub, you should merge your changes to the `main` branch, create the git\n[versioning](#Versioning) tag and finally push those changes:\n\n```shell\n$ git checkout main\n$ git pull\n$ git merge \u003cyour_branch\u003e\n$ git tag -a v\u003cversion\u003e -m \"\u003cdescription\u003e\"\n$ git push origin HEAD --tags\n```\n\n- example:\n\n```shell\n$ git checkout main\n$ git pull\n$ git merge feat/some-feature\n$ git tag -a v2.1.0 -m \"This release adds some feature...\"\n$ git push origin HEAD --tags\n```\n\nOur CI will build images with the tagged version and publish them\nto [our PyPI repository](https://pypi.org/project/incognia-python/).\n\n## What is Incognia?\n\nIncognia is a location identity platform for mobile apps that enables:\n\n- Real-time address verification for onboarding\n- Frictionless authentication\n- Real-time transaction verification\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finloco%2Fincognia-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finloco%2Fincognia-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finloco%2Fincognia-python/lists"}