Registry / http-networking / python-status

python-status

JSON →
library1.0.1pypypi✓ verified 87d ago

A very simple Python library providing human-understandable HTTP status codes and helper methods to improve code readability. Originally forked from Django Rest Framework, it reached version 1.0.1 in October 2015 and has not seen further updates since, making it an effectively abandoned project.

pip install python-status
INSTALL
IMPORT
SIG · PYTHON-STATUS
P
python-status
http-networkingpythonv1.0.1
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

status
import status
HTTP_200_OK
status.HTTP_200_OK
is_success
status.is_success(code)
status.is_success(response.status_code)
The function expects a numeric status code, not a response object directly.

This quickstart demonstrates how to import and use the `status` library with HTTP status codes and helper functions, often in conjunction with a library like `requests`.

import requests import status import os # Example usage with a requests response response = requests.get(os.environ.get('TEST_URL', 'https://httpbin.org/status/200')) if status.is_success(code=response.status_code): print(f"Request successful: {response.status_code} {status.phrase(response.status_code)}") elif status.is_client_error(code=response.status_code): print(f"Client error: {response.status_code} {status.phrase(response.status_code)}") elif status.is_server_error(code=response.status_code): print(f"Server error: {response.status_code} {status.phrase(response.status_code)}") # Direct access to status codes print(f"HTTP OK: {status.HTTP_200_OK}") print(f"HTTP Not Found: {status.HTTP_404_NOT_FOUND}")
Debug
Known issues
breakingThe `python-status` library is effectively abandoned. Its last release was in October 2015, with official compatibility listed only up to Python 3.5. It is highly unlikely to function correctly or be maintained on modern Python versions (3.6+).
fix
Migrate to the standard library's `http.HTTPStatus` (available in Python 3.5+), which provides similar functionality and is actively maintained. Alternatively, consider `requests.Response.raise_for_status()` for basic error checking or `httpx` for modern HTTP client needs.
affects: All versions on Python 3.6+.
deprecatedThis library has been superseded by the `http.HTTPStatus` enum in the Python standard library, introduced in Python 3.5.
fix
Replace `import status` with `from http import HTTPStatus`. Use `HTTPStatus.OK` instead of `status.HTTP_200_OK` and `HTTPStatus.OK.value` for the integer code. For `is_success`, `is_client_error`, etc., you may need to implement custom helper functions or use integer comparisons, e.g., `200 <= code < 300`.
affects: All versions of `python-status` on Python 3.5+.
gotchaThe library's `requires_python` metadata on PyPI is `None`, which might suggest broad compatibility. However, the project classifiers and last commit date indicate support explicitly for Python 2.7, 3.3, 3.4, and 3.5. Using it on newer Python versions is not officially supported and may lead to unexpected behavior or `ImportError`.
fix
Check your Python environment and if it's 3.5 or newer, prefer `http.HTTPStatus`. If you must use `python-status` for legacy reasons, ensure your environment is Python 3.5 or older.
affects: All versions of `python-status` on Python 3.6+.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'status'
The `python-status` library is not installed in the current environment.
fix
Run `pip install python-status` to install the library.
AttributeError: module 'status' has no attribute 'HTTP_XXX_YYY' (e.g., HTTP_422_UNPROCESSABLE_ENTITY)
The `python-status` library might not have all newer HTTP status codes or you are using it in a context where a newer status code is expected that wasn't defined in its 2015 release.
fix
Upgrade to `http.HTTPStatus` from the standard library. Newer Python versions' `HTTPStatus` enum will include more recently defined codes. If using an old Python and stuck with `python-status`, you might need to use the raw integer value for less common or newer status codes.
TypeError: 'module' object is not callable (e.g., `status(200)` is called)
The `status` import provides a module with attributes (like `status.HTTP_200_OK`) and functions (like `status.is_success`), but the `status` module itself is not a callable class or function to instantiate.
fix
Access status codes as attributes (e.g., `status.HTTP_200_OK`) or call helper functions with arguments (e.g., `status.is_success(code=200)`). Do not attempt to call `status()` directly.
Upgrade
Version history
1.0.1latest on PyPI · released Oct 17, 2015
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
python-status — pip install python-status · libregistry