{"id":15532627,"url":"https://github.com/misl6/py4web-recaptcha","last_synced_at":"2025-08-10T19:15:30.316Z","repository":{"id":89607070,"uuid":"262794195","full_name":"misl6/py4web-recaptcha","owner":"misl6","description":"Recaptcha field for py4web","archived":false,"fork":false,"pushed_at":"2020-05-10T13:36:34.000Z","size":2,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T22:16:44.527Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/misl6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-05-10T13:34:07.000Z","updated_at":"2024-10-27T07:45:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1c0f4f3-f517-4851-8ddb-21412791d8af","html_url":"https://github.com/misl6/py4web-recaptcha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misl6%2Fpy4web-recaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misl6%2Fpy4web-recaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misl6%2Fpy4web-recaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misl6%2Fpy4web-recaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misl6","download_url":"https://codeload.github.com/misl6/py4web-recaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188240,"owners_count":20250457,"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-10-02T11:32:03.207Z","updated_at":"2025-03-12T09:15:52.211Z","avatar_url":"https://github.com/misl6.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\n```python\n..\nfrom py4web_recaptcha import ReCaptchaV3Field\n..\n\n@action(\"captcha_form\", method=[\"GET\", \"POST\"])\n@action.uses(\"captcha_form.html\", session)\ndef example_captcha_form():\n    def low_score_callback(score):\n        session.min_captcha_score = score\n        print(\"low_score_callback_called\")\n\n    def get_form(readonly=False):\n        print(\"generating_new_form\")\n        extra_fields = []\n\n        if hasattr(session, \"min_captcha_score\"):\n            min_score = session.min_captcha_score\n            extra_fields = [Field(\"email\", requires=IS_EMAIL())]\n        else:\n            min_score = 1.0\n\n        return Form(\n            [\n                Field(\"name\", requires=IS_NOT_EMPTY()),\n                *extra_fields,\n                ReCaptchaV3Field(\n                    name=\"captcha\",\n                    action=\"form1_submit\",\n                    min_score=min_score,\n                    site_key=\"YOUR_SITE_KEY\",\n                    secret_key=\"YOUR_SECRET_KEY\",\n                    on_captcha_score_low=low_score_callback,\n                ),\n            ],\n            formstyle=FormStyleBulma,\n            readonly=readonly\n        )\n\n    form = get_form()\n    message = \"\"\n    print(\"accepting/erroring form\")\n    if form.accepted:\n        message = \"form accepted with: %s \" % (form.vars)\n    elif form.errors:\n        message = \"form has errors: %s \" % (form.errors)\n        if \"captcha\" in form.errors:\n            form = get_form(readonly=True)\n            form.readonly = False\n            form.errors['captcha'] = 'Bad score! We need some more info about you ...'\n    return dict(form=form, message=message)\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisl6%2Fpy4web-recaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisl6%2Fpy4web-recaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisl6%2Fpy4web-recaptcha/lists"}