Skip to main content

Flask-Clacks

https://img.shields.io/pypi/v/flask-clacks.svg https://img.shields.io/travis/WilliamMayor/flask-clacks.svg Documentation Status

A man is not dead while his name is still spoken.

This is a very simple Flask extension that adds ‘X-Clacks-Overhead’ headers to your website’s responses.

Features

This package exposes a Flask extension which by default adds the header X-Clacks-Overhead: GNU Terry Pratchett on all routes, for all origins and methods.

  • You can add extra names to your overhead

  • You can decorate individual routes to have the overhead

Installation

Install the extension with using pip, or easy_install.

$ pip install -U flask-clacks

Usage

Apply to all routes, sending only Terry Pratchett’s name in the overhead.

from flask import Flask
from flask-clacks import Clacks

app = Flask(__name__)
Clacks(app)

@app.route("/")
def index():
    # Will have the header added to the response
    return "OK"

Apply to all routes, sending Terry Pratchett and John Dearheart’s names in the overhead.

from flask import Flask
from flask-clacks import Clacks

app = Flask(__name__)
Clacks(app, names=('John Dearheart', ))

@app.route("/")
def index():
    # Will have the the clacks overhead header for both Terry and John
    return "OK"

Apply to specific routes, sending different names back on different responses.

from flask import Flask
from flask-clacks import clacks

app = Flask(__name__)

@app.route("/terry/")
@clacks
def terry():
    # Will have a clacks overhead header for Terry
    return "OK"

@app.route("/terry-and-john/")
@clacks(names=('John Dearheart', ))
def terry_and_john():
    # Will have a clacks overhead header for both Terry and John
    return "OK"

@app.route("/no-one/")
def no_one():
    # Will not have clacks overhead headers
    return "OK"

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Thanks go to the Flask-CORS extension for providing decent examples of how to package an extension.

History

1.0.0 (2017-04-26)

  • First release on PyPI.

1.0.1 (2017-04-26)

  • Learning how things like travis, PyPI, and tox work

  • Fixing small config things

Metadata

Release files for flask-clacks 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-clacks 1.0.1
File Size Uploaded Provenance
flask-clacks-1.0.1.tar.gz 12.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-clacks 1.0.1
File Interpreter ABI Platform
flask_clacks-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 17.9 kB

Release files / flask-clacks-1.0.1.tar.gz

Download URL flask-clacks-1.0.1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2468f8e870749a382be220baf5407c68f9c51c8b7bf5f37fbc76a17fc531e432
BLAKE2b-256 checksum
How to use checksums
1e6f59882c14441241b0b0f738db5f6e9e0945e6f3d74cf25312fe387d1ff9d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / flask_clacks-1.0.1-py2.py3-none-any.whl

Download URL flask_clacks-1.0.1-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ed641435a22c7a9f3034123437a1d37fc275c20d4f0a0bdfb53bfcf3bc0a8e59
BLAKE2b-256 checksum
How to use checksums
8d65117c0786cf589c9fc58fb145d02099ebc667769b8ec3cd82e69750fe2f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for flask-clacks 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page