Skip to main content

A simple Flask extension to block AI crawlers.

Project description

flask-noAI

A simple Flask extension to block AI crawlers.

How it works

Flask-noAI adds certain rules to robots.txt expecting it to be respected, and if a violation of those rules is detected, content access is blocked.

How to use it

import flask_noai

flask_noai.noai(app)

Yes, it's this easy.

You can even do it like this:

from flask import Flask
from flask_noai import noai

app = noai(Flask(__name__))

Handling

  • If you want to have a custom message when unauthorised scraping was detected, use noai(..., on_detect="...")
  • If you want to return a non-200 code when it was detected, use noai(..., code=401) or other codes.
  • You can still add custom robots.txt by simply creating a route.
  • You should not make /robots, /robots/, or /robots.txt/ routes since they are handled by this extension.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_noai-1.0.0-py2.py3-none-any.whl (15.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flask_noai-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: flask_noai-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for flask_noai-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c0b4514708e630d8ea252e848ea89747b31aa90c216ae17d0a54e16cfab051ee
MD5 57dbe23be57dd03b8788d003740e917e
BLAKE2b-256 6acc7a1d70f60a5d433abda4a17115b4652dab00f33dee04071ef55cf22bf8ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page