{"id":21215295,"url":"https://github.com/romis2012/is-bot","last_synced_at":"2025-07-15T11:09:11.242Z","repository":{"id":57792006,"uuid":"527929270","full_name":"romis2012/is-bot","owner":"romis2012","description":"Detect bots/crawlers/spiders via user-agent string","archived":false,"fork":false,"pushed_at":"2024-09-07T05:49:54.000Z","size":37,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T13:56:25.931Z","etag":null,"topics":["bot-detection","bots","crawlers","python","user-agent","user-agent-parser","web-crawlers"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romis2012.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":null,"security":null,"support":null}},"created_at":"2022-08-23T09:56:27.000Z","updated_at":"2024-10-10T09:26:59.000Z","dependencies_parsed_at":"2022-08-25T21:52:58.995Z","dependency_job_id":null,"html_url":"https://github.com/romis2012/is-bot","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romis2012%2Fis-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romis2012%2Fis-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romis2012%2Fis-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romis2012%2Fis-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romis2012","download_url":"https://codeload.github.com/romis2012/is-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225634051,"owners_count":17500089,"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":["bot-detection","bots","crawlers","python","user-agent","user-agent-parser","web-crawlers"],"created_at":"2024-11-20T21:36:42.039Z","updated_at":"2024-11-20T21:36:42.729Z","avatar_url":"https://github.com/romis2012.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## is-bot\n\n[![CI](https://github.com/romis2012/is-bot/actions/workflows/ci.yml/badge.svg)](https://github.com/romis2012/is-bot/actions/workflows/ci.yml)\n[![Coverage Status](https://codecov.io/gh/romis2012/is-bot/branch/master/graph/badge.svg)](https://codecov.io/gh/romis2012/is-bot)\n[![PyPI version](https://badge.fury.io/py/is-bot.svg)](https://pypi.python.org/pypi/is-bot)\n\nPython package to detect bots/crawlers/spiders via user-agent string.\nThis is a port of the [isbot](https://github.com/omrilotan/isbot) JavaScript module.\n\n\n## Requirements\n- Python \u003e= 3.7\n- regex \u003e= 2022.8.17\n\n## Installation\n```\npip install is-bot\n```\n\n## Usage\n\n### Simple usage\n\n```python\nfrom is_bot import Bots\n\nbots = Bots()\n\nua = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/104.0.5112.79 Safari/537.36'\nassert bots.is_bot(ua)\n\nua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'\nassert not bots.is_bot(ua)\n```\n\n### Add/remove parsing rules\n\n```python\nfrom is_bot import Bots\n\nbots = Bots()\n\n# Exclude Chrome-Lighthouse from default bot list\nua = 'Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse'\nassert bots.is_bot(ua)\nbots.exclude(['chrome-lighthouse'])\nassert not bots.is_bot(ua)\n\n# Add some browser to default bot list\nua = 'SomeAwesomeBrowser/10.0 (Linux; Android 7.0)'\nassert not bots.is_bot(ua)\nbots.extend(['SomeAwesomeBrowser'])\nassert bots.is_bot(ua)\n```\n\n### Get additional parsing information\n\n```python\nfrom is_bot import Bots\n\nbots = Bots()\n\nua = 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SearchRobot/1.0'\n\n# view the respective match for bot user agent rule\nprint(bots.find(ua))\n#\u003e Search\n\n# list all patterns that match the user agent string\nprint(bots.matches(ua))\n#\u003e ['(?\u003c! (ya|yandex))search', '(?\u003c! cu)bot']\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromis2012%2Fis-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromis2012%2Fis-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromis2012%2Fis-bot/lists"}