![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
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.
Don't:
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 status.py
file.
>>> import status
>>> status.HTTP_200_OK == 200
True
For list of available status codes check status.py
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):
print('yay!')
>>>
yay!
For every project I was creating a status.py
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.
FAQs
HTTP Status for Humans
We found that python-status demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.