{"id":21597408,"url":"https://github.com/cleantalk/python-antispam","last_synced_at":"2025-07-16T13:07:50.615Z","repository":{"id":15930067,"uuid":"12943408","full_name":"CleanTalk/python-antispam","owner":"CleanTalk","description":"Antispam API for Python applications ","archived":false,"fork":false,"pushed_at":"2023-11-26T16:08:49.000Z","size":48,"stargazers_count":25,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T00:52:18.401Z","etag":null,"topics":["anti-spam","antispam","cleantalk","python","python-antispam","spam","spam-protection"],"latest_commit_sha":null,"homepage":"https://cleantalk.org","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/CleanTalk.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}},"created_at":"2013-09-19T07:54:04.000Z","updated_at":"2025-02-12T20:27:33.000Z","dependencies_parsed_at":"2023-11-26T17:25:17.511Z","dependency_job_id":"196a6f25-30e8-4995-9a24-8afc2c99ce19","html_url":"https://github.com/CleanTalk/python-antispam","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fpython-antispam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fpython-antispam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fpython-antispam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanTalk%2Fpython-antispam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanTalk","download_url":"https://codeload.github.com/CleanTalk/python-antispam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322609,"owners_count":21084336,"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":["anti-spam","antispam","cleantalk","python","python-antispam","spam","spam-protection"],"created_at":"2024-11-24T18:08:56.486Z","updated_at":"2025-04-11T00:52:24.255Z","avatar_url":"https://github.com/CleanTalk.png","language":"Python","readme":"python-antispam\n============\n\nPrevents spam in your python web apps. Cloud features allow you to use additional anti-spam functionality. Cloud features allow you to use additional anti-spam functionality, such as: Personal IP/Email lists, blocking by country, language, stop words and etc.\n\nSpam attacks log - allows to view all filtered requests in the \"Log of spam attacks\".\nThe log contains a detailed information about each request for a time period. At any time, you can check the request and make sure that the filtering is correct. A Python API for antispam service cleantalk.org. Invisible protection from spam, no captches, no puzzles, no animals and no math.\n\n## How API stops spam?\nAPI uses several simple tests to stop spammers.\n  * Spam bots signatures.\n  * Blacklists checks by Email, IP, web-sites domain names.\n  * JavaScript availability.\n  * Comment submit time.\n  * Relevance test for the comment.\n\n## How API works?\nAPI sends a comment's text and several previous approved comments to the servers. Servers evaluates the relevance of the comment's text on the topic, tests on spam and finaly provides a solution - to publish or put on manual moderation of comments. If a comment is placed on manual moderation, the plugin adds to the text of a comment explaining the reason for the ban server publishing.\n\n## Requirements\n\n   * Python 2.6 and above\n   * Python 3 and above \n   * CleanTalk account https://cleantalk.org/register?product=anti-spam\n\n## SPAM test for text comment sample \n\n```python\nfrom cleantalk import CleanTalk\nimport json\n\n\nct = CleanTalk(auth_key='yourkey')\nct_result = ct.request(\n                message = 'abc', # Required. Visitor comment\n                sender_ip = '196.19.250.114', # Required. Visitor IP address\n                sender_email = 'stop_email@example.com', # Required. Visitor email\n                sender_nickname = 'spam_bot', # Required. Visitor nickname\n                post_info= json.dumps({'post_url': 'https://yoursite.com'}) # Optional. Additional post info in JSON format.\n                # event_token = 'xxx' # fill it with ct_bot_detector_event_token hidden input from your form (auto generate)\n        )\n#Check\nif ct_result['allow']:\n    print('Comment allowed. Reason ' + ct_result['comment'])\nelse:\n    print('Comment blocked. Reason ' + ct_result['comment'])\n```\n\n## API Response description\nAPI returns Python dictionary object, where keys:\n  * allow (0|1) - allow to publish or not, in other words spam or ham\n  * comment (string) - server comment for requests.\n  * id (string MD5 HEX hash) - unique request idenifier.\n\n## Installing via PyPi\nRun the next command in the terminal:\n\n```python\npip install cleantalk-python-antispam\n```\nThen you can use Cleantalk class import:\n```python\nfrom cleantalk_python_antispam.cleantalk import CleanTalk\n```\n\nFor improve protection include javascript to your layout before \\\u003c\\/body\\\u003e tag:\n```html\n\u003cscript type=\"text/javascript\" src=\"https://moderate.cleantalk.org/ct-bot-detector-wrapper.js\"\u003e\u003c/script\u003e\n```\n\n## Changelog\nVersion 1.2\n  * New. Now page URL could be added to the request.\n  * Mod. Tests file updated.\n  * Mod. Readme updated.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleantalk%2Fpython-antispam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleantalk%2Fpython-antispam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleantalk%2Fpython-antispam/lists"}