Skip to main content

A lightweight, dependency-free, requests-like HTTP client with safe defaults

Project description

no-requests

Author: gatopeich ~ https://github.com/gatopeich/no-requests

A lightweight, safe, dependency-free HTTP client for Python 3, inspired by requests, but with no dependencies outside the standard library.

Features

  • Only the most-used API: get, post, put, delete
  • No dependencies outside Python 3 standard library
  • Default timeout is 9 seconds
  • Warns (but does not fail) on non-SSL (non-HTTPS) requests
  • Simple Response object with .status_code, .headers, .url, .content, .text, .json()

Usage

import norequests as requests

resp = requests.get('https://httpbin.org/get')
print(resp.status_code)
print(resp.json())

How to use no-requests in place of requests

If you want to replace the requests module in your project with no-requests, you can do so by adding the following line to your requirements.txt:

requests @ git+https://github.com/gatopeich/no-requests.git

This will install no-requests as if it were requests, letting you import it as usual:

import requests

resp = requests.get('https://example.com')
print(resp.status_code)

Note:
This works because the package provides a requests-like API and will be installed as the requests package in your environment, overriding the original. Be sure to remove any other lines referring to requests in your requirements.txt to avoid conflicts.

License

MIT

Project details


Download files

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

Source Distribution

no_requests-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

no_requests-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file no_requests-0.1.0.tar.gz.

File metadata

  • Download URL: no_requests-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for no_requests-0.1.0.tar.gz
Algorithm Hash digest
SHA256 696a758028c9a440b8c1e27d58fe2860d8d5c75cfdcb6c1184a78e098cd5e382
MD5 8bf8744cf8a23b6e5657922a2ba73055
BLAKE2b-256 f95d1d6835ee8a49d91d3b878df2becdb82059a48b17502e2d0240f420f84ab2

See more details on using hashes here.

File details

Details for the file no_requests-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: no_requests-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for no_requests-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39692685d7b2fdd4b8944871b53169ffc45d5aa1553a1355ea26ff122c0daacf
MD5 b7a5817be3a26cf63b90fc3cd37df839
BLAKE2b-256 8be0a4c51fc2447f9785c2e987fbc95ab8098ca55247923920d063d36243a011

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page