Skip to main content

Python bindings for the BoostAIO C++ HTTP client library

Project description

BoostAIO

BoostAIO is a high-performance, modern HTTP/1.1/2 networking library with native Python bindings. It provides a simple, fast way to perform HTTP requests in Python by leveraging an optimized C++ backend (shipped as a shared library).


Features

  • HTTP/1.1 & HTTP/2 support
  • Fast, native code (C++ backend via shared library)
  • Simple Python API: import BoostAIO
  • Supports GET, POST, custom methods, custom headers, and more
  • Automatic SSL/TLS (https) support

Project Layout

BoostAIO/
├── LICENSE
├── README.md
├── BoostAIO/
│   └── __init__.py            # Python API and binding loader
├── src/
│   └── BoostAIO/
│       ├── libhtrio.so        # Compiled C++ shared library (Linux)
│       └── libhtrio.dylib     # Compiled C++ shared library (macOS, optional)

Installation

  1. Build/obtain the shared library
    Make sure libhtrio.so (or libhtrio.dylib on macOS) is present in src/BoostAIO/.

  2. Install the Python package
    You can use this package directly without pip install. Just ensure your working directory structure matches the above and your script points to the right location.

  3. (Optional): Add BoostAIO/ to your PYTHONPATH if calling from outside the directory.


Usage Example

from BoostAIO import HttpClient

# Simple GET request
response = HttpClient.get("https://api.github.com/users/octocat")
print("Status:", response.status)
print("Body:", response.body)
print("Headers:", response.headers)

# POST request with custom headers and JSON body
headers = {"Content-Type": "application/json"}
body = '{"name": "test", "description": "test repo"}'
response = HttpClient.post("https://httpbin.org/post", body=body, headers=headers)
print("Status:", response.status)
print("Body:", response.body)

# Custom method (e.g., PATCH)
from BoostAIO import HttpMethod
response = HttpClient.request(
    method=HttpMethod.PATCH,
    url="https://httpbin.org/patch",
    body='{"key": "value"}',
    headers={"Content-Type": "application/json"}
)
print("PATCH Status:", response.status)
print("PATCH Body:", response.body)

API

HttpClient.get(url: str, headers: dict = None) -> Response

Perform an HTTP GET request.

HttpClient.post(url: str, body: str = None, headers: dict = None) -> Response

Perform an HTTP POST request.

HttpClient.request(method: HttpMethod, url: str, body: str = None, headers: dict = None) -> Response

Custom HTTP request with any method.

Response

  • .status: HTTP status code (int)
  • .body: Response body (str)
  • .headers: Response headers (dict)

HttpMethod

Enum for HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, etc.)


How It Works

On import, the BoostAIO Python package will automatically load the C++ shared library (libhtrio.so/libhtrio.dylib) and expose the HTTP client API using Python classes. No source code or C++ compilation is necessary in the user's project.


License

MIT License (see LICENSE file).


Acknowledgements

  • Boost (Asio, Beast)
  • OpenSSL
  • Inspired by Python's requests and high-performance networking best practices.

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

boostaio-0.0.2.tar.gz (520.4 kB view details)

Uploaded Source

Built Distribution

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

boostaio-0.0.2-py3-none-any.whl (522.8 kB view details)

Uploaded Python 3

File details

Details for the file boostaio-0.0.2.tar.gz.

File metadata

  • Download URL: boostaio-0.0.2.tar.gz
  • Upload date:
  • Size: 520.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for boostaio-0.0.2.tar.gz
Algorithm Hash digest
SHA256 73b0274f2dd357bc574426d21da2f5ce710fb71e76c4ea5c9cc54e7240aa5d32
MD5 8c2864617e83e982a056c632430376e1
BLAKE2b-256 fdcc0da301dc4afc4451d66b7eb2b078ca6fc3063e4ebb9e3428d13cfa69b128

See more details on using hashes here.

File details

Details for the file boostaio-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: boostaio-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 522.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for boostaio-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2802f6a6389ba38ad0a88315af2ae91cd9820b13e947b810bf1646e6de119a
MD5 b8ddd26ea163f8d2d7e9a9e7f0a60b5c
BLAKE2b-256 26d17fec32d6565381a23009f31e754a76afbf9d876e18706cd307bbed6de09e

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