Skip to content
HTTP Status for Humans
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml Add .travis.yml Nov 8, 2015
LICENSE Update LICENSE and README Oct 16, 2015 Initial import Oct 14, 2015 version bump and use same license as DRF in Oct 17, 2015
requirements-dev.txt version bump and use same license as DRF in Oct 17, 2015 Squashed commit of the following: Mar 5, 2016

status - HTTP Status for Humans

version supported license

status is a very simple python library which provides human understandable HTTP status codes and improves readability of your code. You don't have to use those ugly HTTP status numbers, but use easily understandable status names.


class PythonPeople(RequestHandler):
    def post(self):
        # do stuff
        return ('That worked!', 201)

But, do this:

class PythonPeople(RequestHandler):
    def post(self):
        # do stuff
        return ('That worked!', status.HTTP_201_CREATED)

See, that looks so much better. You can use this library wherever you want, from custom python scripts to Django, Flask etc apps. For example, if you were playing with Requests:

>>> response = requests.delete('http://some-url')
>>> response.status_code == status.HTTP_204_NO_CONTENT


pip install python-status


status comes with HTTP response status codes and also some helpful methods to check the response status. Under the hood, status codes are merely an integer variable with meaningful variable names. Check file.

>>> import status
>>> status.HTTP_200_OK == 200

For list of available status codes check file.

status also comes with some helpful methods to check the status of a response. They are status.is_informational, status.is_success, status.is_redirect, status.is_client_error and status.is_server_error.

>>> import status
>>> response = requests.delete('http://some-url')
>>> if status.is_success(code=response.status_code):


For every project I was creating a file in the root directory. So I thought it's better to release this as a package on PyPi and use it.


Please check LICENSE for more details.


status is a fork of Django Rest Framework(DRF) and is independently maintained. The fork is entirely stripped of all DRF features and is not a submodule of DRF. And it doesn't come with any DRF functionalities.

You can’t perform that action at this time.