Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!


Project Description


monsieur is a Django app designed to track/monitor/query arbitrary events over periods of time.


Once installed (instructions below), simply import monsieur and start logging events.

import monsieur

def handler(request):
    except Exception as e:
        # log exception to monsieur and add os/browser attributes
        os, browser = parse_ua(request.META.get('HTTP_USER_AGENT'))
        name = e.message or 'Unknown exception in handler()'
        monsieur.incr(name, 1, 'view errors', os=os, browser=browser)

monsieur has a query system similar to Django’s querysets:

>>> import monsieur
>>> q = monsieur.Q.tag('view errors')
>>> q = q.filter(os='windows')
>>> q = q.granularity('hour')
>>> q.eval()
{'integer division or modulo by zero': [{'dt': datetime.datetime(2013, 1, 7, 20, 0, 0, 0), 'count': 1}, ...]}

Q constructors

Q.tag(x)        # x = TAG | [TAG1, TAG2, ...]     # x = NAME | [NAME1, NAME2, ...]

Q methods

q.filter(**kwargs)   # key=value to filter by

q.start(x)           # x = datetime.datetime

q.end(x)             # x = datetime.datetime

q.granularity(x)     # x = 'minute' | 'hour' | 'day'

Q evaluation methods



Release History

This version
History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(5.4 kB) Copy SHA256 Hash SHA256
Source None Jan 15, 2013

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate