{"id":23131154,"url":"https://github.com/friendlycaptcha/friendly-captcha-python","last_synced_at":"2025-08-17T08:31:01.885Z","repository":{"id":239957447,"uuid":"718108908","full_name":"FriendlyCaptcha/friendly-captcha-python","owner":"FriendlyCaptcha","description":"Python SDK for Friendly Captcha v2","archived":false,"fork":false,"pushed_at":"2024-10-21T15:05:17.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-08T19:59:02.580Z","etag":null,"topics":["captcha","captcha-python","friendly-captcha","library","python-sdk","sdk","sdk-python"],"latest_commit_sha":null,"homepage":"","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/FriendlyCaptcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-13T11:57:28.000Z","updated_at":"2024-11-29T17:25:52.000Z","dependencies_parsed_at":"2024-12-17T12:32:57.967Z","dependency_job_id":null,"html_url":"https://github.com/FriendlyCaptcha/friendly-captcha-python","commit_stats":null,"previous_names":["friendlycaptcha/friendly-captcha-python"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/FriendlyCaptcha/friendly-captcha-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendlyCaptcha","download_url":"https://codeload.github.com/FriendlyCaptcha/friendly-captcha-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270822815,"owners_count":24651990,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["captcha","captcha-python","friendly-captcha","library","python-sdk","sdk","sdk-python"],"created_at":"2024-12-17T11:12:11.994Z","updated_at":"2025-08-17T08:31:01.602Z","avatar_url":"https://github.com/FriendlyCaptcha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Friendly Captcha Python SDK\n\nA Python client for the [Friendly Captcha](https://friendlycaptcha.com) service. This client allows for easy integration and verification of captcha responses with the Friendly Captcha API.\n\n\u003e This library is for [Friendly Captcha V2](https://developer.friendlycaptcha.com) only. If you are looking for V1, look [here](https://docs.friendlycaptcha.com)\n\n## Installation\n\n```bash\npip install friendly-captcha-client\n```\n\n## Usage\n\nBelow are some basic examples of how to use the client.\n\nFor a more detailed example, take a look at the [example](./example) directory.\n\n### Initialization\n\nTo start using the client:\n\n```python\nfrom friendly_client import FriendlyCaptchaClient\n\nclient = FriendlyCaptchaClient(\n    api_key=\"YOUR_API_KEY\",\n    sitekey=\"YOUR_SITEKEY\"\n)\n```\n\n### Verifying a Captcha Response\n\nAfter calling `verify_captcha_response` with the captcha response there are two functions on the result object that you should check:\n\n- `was_able_to_verify` indicates whether we were able to verify the captcha response. This will be `False` in case there was an issue with the network/our service or if there was a mistake in the configuration.\n- `should_accept` indicates whether the captcha response was correct. If the client is running in non-strict mode (default) and `was_able_to_verify` returned `False`, this will be `True`.\n\nBelow are some examples of this behaviour.\n\n#### Verifying a correct captcha response without issues when veryfing:\n\n```python\nresult = client.verify_captcha_response(\"CORRECT?CAPTCHA_RESPONSE_HERE\")\nprint(result.was_able_to_verify) # True\nprint(result.should_accept) # True\n```\n\n#### Verifying an incorrect captcha response without issues when veryfing:\n\n```python\nresult = client.verify_captcha_response(\"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nprint(result.was_able_to_verify) # True\nprint(result.should_accept) # False\n```\n\n#### Verifying an incorrect captcha response with issues (network issues or bad configuration) when veryfing in non-strict mode (default):\n\n```python\nresult = client.verify_captcha_response(\"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nprint(result.was_able_to_verify) # False\nprint(result.should_accept) # True\n```\n\n#### Verifying an incorrect captcha response with issues (network/service issues or bad configuration) when veryfing in strict mode:\n\n```python\nclient.strict = True\nresult = client.verify_captcha_response(\"INCORRECT_CAPTCHA_RESPONSE_HERE\")\nprint(result.should_accept)  # False\nprint(result.was_able_to_verify)  # False\n```\n\n### Configuration\n\nThe client offers several configuration options:\n\n- **api_key**: Your Friendly Captcha API key.\n- **sitekey**: Your Friendly Captcha sitekey.\n- **strict**: (Optional) In case the client was not able to verify the captcha response at all (for example if there is a network failure or a mistake in configuration), by default the `verify_captcha_response` returns `True` regardless. By passing `strict=True`, it will return `False` instead: every response needs to be strictly verified.\n- **siteverify_endpoint**: (Optional) The endpoint URL for the site verification API. Shorthands `eu` or `global` are also accepted. Default is `global`.\n- **verbose**: (Optional) Default is False. Turn on basic logging.\n- Error Handling: The client has built-in error handling mechanisms. In case of unexpected responses or errors from the Friendly Captcha API, the client will log the error and provide a default response.\n\n## Development\n\nTo install it locally:\n\n```bash\npip install -e .\npip install -r requirements-dev.txt\n```\n\nRun the tests:\n\n```bash\n# Run the unit tests\npython -m pytest\n\n# Run the SDK integration tests (requires that you have the SDK test mock server running)\ndocker run -p 1090:1090 friendlycaptcha/sdk-testserver:latest\npython -m pytest integration_tests\n```\n\n## License\n\nOpen source under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-python/lists"}