Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 960 Bytes

README.rst

File metadata and controls

61 lines (43 loc) · 960 Bytes

http://i.imgur.com/YuqGF.png

Flask-StatHat

http://img.shields.io/pypi/v/Flask-StatHat.png

StatHat extension for Flask

Install

python
pip install Flask-StatHat

Setup

from flask_stathat import StatHat
stathat = StatHat()
stathat.init_app(app)  # or stathat = StatHat(app)

Usage

@app.route('/')
def index():
    stathat.count('some_stat', 1)
    stathat.value('some_value', 9001)
    # The stathat requests won't be sent until the flask request
    # has been processed and no exceptions were raised
    ...

Configuration

app.config.update(STATHAT_EZ_KEY='STAHAT_EZ_KEY')

Async

Flask-StatHat will use grequests if it's installed

License

http://marksteve.mit-license.org