{"id":13715165,"url":"https://github.com/lepture/captcha","last_synced_at":"2025-05-14T10:08:11.719Z","repository":{"id":23749423,"uuid":"27123519","full_name":"lepture/captcha","owner":"lepture","description":"A captcha library that generates audio and image CAPTCHAs.","archived":false,"fork":false,"pushed_at":"2024-03-04T22:20:52.000Z","size":255,"stargazers_count":984,"open_issues_count":8,"forks_count":181,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-05-17T12:02:58.951Z","etag":null,"topics":["captcha"],"latest_commit_sha":null,"homepage":"http://captcha.lepture.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lepture.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":"2014-11-25T11:54:19.000Z","updated_at":"2024-06-18T12:25:17.411Z","dependencies_parsed_at":"2022-07-10T10:00:23.485Z","dependency_job_id":"a7781265-1708-4e91-894b-c238e4155a72","html_url":"https://github.com/lepture/captcha","commit_stats":{"total_commits":65,"total_committers":16,"mean_commits":4.0625,"dds":"0.24615384615384617","last_synced_commit":"10a464cc786dd19457c2c859e6391e95557d0995"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Fcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Fcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Fcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Fcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lepture","download_url":"https://codeload.github.com/lepture/captcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335572,"owners_count":21086620,"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":["captcha"],"created_at":"2024-08-03T00:00:55.167Z","updated_at":"2025-04-11T03:32:55.008Z","avatar_url":"https://github.com/lepture.png","language":"Python","funding_links":["https://github.com/sponsors/lepture"],"categories":["Generowanie","Python","验证码生成工具"],"sub_categories":[],"readme":"# Captcha\n\nA captcha library that generates audio and image CAPTCHAs.\n\n\n[![GitHub Sponsor](https://badgen.net/badge/support/captcha/blue?icon=github)](https://github.com/sponsors/lepture)\n[![Build Status](https://github.com/lepture/captcha/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/lepture/captcha/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/lepture/captcha/branch/master/graph/badge.svg?token=xLjcXGMaeo)](https://codecov.io/gh/lepture/captcha)\n\n## Install\n\nInstall captcha with pip:\n\n```\npip install captcha\n```\n\n## Features\n\n1. Audio CAPTCHAs\n2. Image CAPTCHAs\n\n## Usage\n\nAudio and Image CAPTCHAs are in separated modules:\n\n```python\nfrom captcha.audio import AudioCaptcha\nfrom captcha.image import ImageCaptcha\n\naudio = AudioCaptcha(voicedir='/path/to/voices')\nimage = ImageCaptcha(fonts=['/path/A.ttf', '/path/B.ttf'])\n\ndata = audio.generate('1234')\naudio.write('1234', 'out.wav')\n\ndata = image.generate('1234')\nimage.write('1234', 'out.png')\n```\n\nThis is the APIs for your daily works. We do have built-in voice data and font\ndata. But it is suggested that you use your own voice and font data.\n\n### Use Custom Colors\n\nIn order to change colors you have to specify your desired color as a tuple of Red, Green and Blue value.\nExample:- `(255, 255, 0)` for yellow color, (255, 0, 0)` for red color.\n\n```python\nfrom captcha.image import ImageCaptcha\n\nimage = ImageCaptcha(fonts=['/path/A.ttf', '/path/B.ttf'])\n\ndata = image.generate('1234')\nimage.write('1234', 'out.png', bg_color=(255, 255, 0), fg_color=(255, 0, 0)) # red text in yellow background\n```\n\n\n## Useful Links\n\n1. GitHub: https://github.com/lepture/captcha\n2. Docs: https://captcha.lepture.com/\n\n## Demo\n\nHere are some demo results:\n\n![Image Captcha](https://github.com/lepture/captcha/releases/download/v0.5.0/demo.png)\n\n[Audio Captcha](https://github.com/lepture/captcha/releases/download/v0.5.0/demo.wav)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepture%2Fcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flepture%2Fcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepture%2Fcaptcha/lists"}