Skip to main content

Minimalist Flask Addon for slapping bots using Proof-of-Work

Project description

July

Proof-of-Work (PoW) Security Measure to protect your flask apps from Bots and Scrapers

Setup

Simply set up July in a Flask App by typing

from flask import Flask
from flask_july import Flask_July

app = Flask(__name__)
app.config["SECRET_KEY"] = "Super Secret!"
july = Flask_July(app)

By default, once your app runs, it will show something like this

(Don't worry! Anything under /static is always allowed to be accessed)

But what if you don't wanna include every Path? Well, using the below code, you can set up exclusions

july = Flask_July(app)


@july.validate
def validate_fn():
    if request.path.startswith("/no-bots-pls"): return True

In the Age of AI Scrapers, it's a feature that has almost been forgotten about, since it was only a sign, never a cop. However, in the Times of Web 2.0, developers would put up a little something called "robots.txt".

Now, Flask-July was originally meant to be a solution that did not allow entry to anywhere except for explicitly allowed paths. However, I've come to the conclusion that it would be smart for July to allow entry to the places robots.txt allows.

july = Flask_July(app, enable_robots=True, robotsfile="robots.txt", create_route=True) # Robots.txt should exist in that path.
# If "create_route" is set to true, July *will* create a route at /robots.txt, if not it won't.

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_july-0.2.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

flask_july-0.2.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file flask_july-0.2.1.tar.gz.

File metadata

  • Download URL: flask_july-0.2.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for flask_july-0.2.1.tar.gz
Algorithm Hash digest
SHA256 53d9a52828ab4751746e7dae1a78365fb44394ecf1825b734d6faa676ed3e922
MD5 f723da80b1d2489db181153249db6300
BLAKE2b-256 3fae0e30af74084e5c396b885599387e4df1f3b045e34062e0ce904aa33ad3b0

See more details on using hashes here.

File details

Details for the file flask_july-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: flask_july-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for flask_july-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12f3af9a3d3c7a363d654376e679902265a3fa37df4be15c47a3ce97967d1037
MD5 b6f6de7267ed1ff6b851f1ef762defe5
BLAKE2b-256 f8c8a8f8aea2162e54bc28c529f97ead34bcc22bdafb39d9b8ee49447d220c6a

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