Skip to main content

Protect against bots and DDoS attacks

Project description

flask-Humanify

A strong bot protection system for Flask with many features: rate limiting, special rules for users, web crawler detection, and automatic bot detection.

Github PyPI Libraries.io


from flask import Flask
from flask_Humanify import Humanify

app = Flask(__name__)
humanify = Humanify(app)

# Register the middleware to deny access to bots
humanify.register_middleware(action="deny_access")

@app.route("/")
def index():
    """
    A route that is protected against bots and DDoS attacks.
    """
    return "Hello, Human!"

if __name__ == "__main__":
    app.run()

Not using the middleware:

@app.route("/")
def index():
    """
    A route that is protected against bots and DDoS attacks.
    """
    if humanify.is_bot:
        return humanify.deny_access()
    return "Hello, Human!"

Usage

Installation

Install the package with pip:

pip install flask-humanify --upgrade

Import the extension:

from flask_humanify import Humanify

Add the extension to your Flask app:

app = Flask(__name__)
humanify = Humanify(app)

Project details


Download files

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

Source Distribution

flask_humanify-0.1.4.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

flask_humanify-0.1.4-py3-none-any.whl (6.1 MB view details)

Uploaded Python 3

File details

Details for the file flask_humanify-0.1.4.tar.gz.

File metadata

  • Download URL: flask_humanify-0.1.4.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flask_humanify-0.1.4.tar.gz
Algorithm Hash digest
SHA256 35e7b1202887713ff441c065ad43cc930f2266814ae2ab4c24316005e6b55b11
MD5 65384a5088244ef58155709d24ef405d
BLAKE2b-256 02bb86d77592f4e6cc95bb1f95f779c186e63fe6b9a8ba0e626c0daa34944c89

See more details on using hashes here.

File details

Details for the file flask_humanify-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: flask_humanify-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flask_humanify-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d25353b55dd52718c1bd7e3fd7e82ce126b518ef8b4d711aba2064102e9ba12c
MD5 e9a14575e5a8eadab677b23c917aa52f
BLAKE2b-256 3458c15075db7c16db2813b7c28daef6c5975ccbada076891ab0f3d4cc6a661e

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