Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fastrequest

A Python C extension module for fast HTTP requests with SSL/TLS support

Installation

To build and install the extension, you just need to run the install.sh script. The script then installs required packages, builds the extension using setuptools and then installs it using pip.

chmod +x install.sh
./install.sh

Example Usage

Just import fastrequest module. It's usage is as easy as ABC!

import fastrequest.http

res = fastrequest.http.get("https://www.google.com")
res.save_to("index.html")

Also, JSON (application/json) responses can be handled easily too.

import json
import fastrequest.http

res = fastrequest.http.get("https://jsonplaceholder.typicode.com/comments?postId=1")

with open("data.json", "w") as fp:
  json.dump(fp, res.json())

Module Reference

HTTPResponse

HTTPResponse is the generic HTTP/HTTPS response object returned from the GET/POST functions.

Pythonic definition of HTTPResponse is as follows,

class HTTPResponse(object):
  def __init__(self, data, size, url=""):
    self.data = data
    self.size = size
    self.url = url

  def text(self):
    return self.data.decode()

  def json(self):
    return json.loads(self.text())

http.get

http.get(url: str[, headers:dict]) -> HTTPResponse

HTTP/GET request function using libcurl as backend.

API Reference

HTTPResponse

HTTPResponse is the generic HTTP/HTTPS response object returned from the GET/POST functions.

The data structure of HTTPResponse object is as follows,

typedef struct {
    PyObject_HEAD
    PyObject *response_size;
    PyObject *response_data;
    PyObject *request_url;
} HTTPResponseObject;

Where

  • response_size is byte-size of the response body (PyLong)
  • response_body is the response body (PyBytes)
  • request_url is the requested URI (PyUnicode)

StringBuffer

StringBuffer is the generic 'string' object implementation to be used in Fast Request API functions.

The data structure of StringBuffer object is as follows,

typedef struct {
    char *buf;
    int_fast64_t index;
    int_fast64_t size;
} StringBuffer;

FastRequestAPI_LibcurlHttpGet

StringBuffer *FastRequestAPI_LibcurlHttpGet(char *url, PyObject *headers)

Send HTTP/GET request to machine with the url specified with optional custom headers. This function uses libcurl as the backend.

Metadata

Release files for fastrequest 1.6.3b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastrequest 1.6.3b0
File Size Uploaded Provenance Actions
fastrequest-1.6.3b0.tar.gz 9.1 kB Without provenance Details for fastrequest-1.6.3b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastrequest 1.6.3b0
File Interpreter ABI Platform Actions
fastrequest-1.6.3b0-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details for fastrequest-1.6.3b0-cp37-cp37m-macosx_10_14_x86_64.whl

Total release size: 32.9 kB

Release files / fastrequest-1.6.3b0.tar.gz

Download URL fastrequest-1.6.3b0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dd01fa09888e16d8cee83e055286d4f8e5d63d28b5ec5dc882e2da75fa664b51
BLAKE2b-256 checksum
How to use checksums
6438ba3a1275041ce9a17eb4e5c96a215fd40c80a005a2d76b04d33c7cd9b0b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Release files / fastrequest-1.6.3b0-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL fastrequest-1.6.3b0-cp37-cp37m-macosx_10_14_x86_64.whl
Size 23.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
a1e52394a1b6efc7b0a358ca5db6bcdb3a9a3079a75e037877a60a52609c7bc2
BLAKE2b-256 checksum
How to use checksums
80fa96f4469261169d09c49f2332cc9fb510d7b6f690b4e1be80e69c9f423bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Security for fastrequest 1.6.3b0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page