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!

Parse and order a HTTP Accept header.

Project Description

A simple library for parsing and ordering a HTTP Accept header.

Includes parameter extraction.


pip install accept

Or if you must use easy_install:

alias easy_install="pip install $1"
easy_install accept


>>> import accept
>>> accept.parse("text/*, text/html, text/html;level=1, */*")
[<Media Type: text/html; q=1.0; level=1>, <Media Type: text/html; q=1.0>, <Media Type: text/*; q=1.0>, <Media Type: */*; q=1.0>]
>>> d = accept.parse("application/json; version=1; q=1.0; response=raw")[0]
>>> d.media_type
>>> d.quality
>>> d.q
>>> d.params
{'version': '1', 'response': 'raw'}
>>> d['version']
>>> d['potato']


  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
  2. Fork the repository on Github to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published.


0.1.0 (2015-01-05)

  • Initial Release!

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.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(4.3 kB) Copy SHA256 Hash SHA256
Source Jan 5, 2015

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