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!

HTTP User-Agent parser for Pyramid

Project Description

Project Info

Provides an HTTP User-Agent parser and classifier for the Pyramid web framework.


Once pyramid_useragent is installed, you typically use the config.include mechanism to include it into your Pyramid project’s configuration. In your Pyramid project’s

config = Configurator(.....)

Alternately, instead of using the Configurator’s include method, you can activate Pyramid by changing your application’s .ini file, use the following line:

pyramid.includes = pyramid_useragent


def demo(request):

    client = request.user_agent_classified

    if client.is_mobile or client.is_tablet:
        return "Download our mobile app!"

    if client.is_bot:
        return "Are you human? I'am human."

    ua = request.user_agent_parsed

    if == 'Links':
        return "Did you REALLY use Links?"

    if 'AdobeAIR' in ua.components:
        if ua.components['AdobeAIR'].version == '':
            return "Much unsecure, so flaws"

    if == "Mozilla":
        return "This is supposed to describe your platform: %s" % (
            '; '.join(ua.maincomponent.comments))

    return [ for c in ua.components.values()]


pip install -e .[testing]


pip install -e .[docs]
cd docs
make html



  • Add a User-Agent classifier using the user-agents project


  • Continuous testing
  • Documentation


  • Initial release.
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyramid_useragent-0.3-py27-none-any.whl (16.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Feb 9, 2014
pyramid_useragent-0.3.tar.gz (14.5 kB) Copy SHA256 Checksum SHA256 Source Feb 9, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting