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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: boostaio-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5bf78bcf14202ca3690e394f9cc07928fd4241683452fa998e5cbcd3f1e7a65
MD5 8586ca25c9c65fa62f5d7b6841441f6d
BLAKE2b-256 14f1734eec07ec366401251395a6c5d4225276ae0f5a3beed88a1335efc17efd

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