HyperIO
HyperIO is a fast and flexible HTTP client for Python, supporting both synchronous and asynchronous requests. It includes built-in methods for handling login, registration, file downloads, and HTML rendering. Perfect for making fast and clean HTTP requests in any Python project.
Features
- Synchronous and Asynchronous HTTP Requests (GET, POST, PUT, DELETE)
- Login and Register Functions
- HTML Rendering with BeautifulSoup
- File Downloads (Sync and Async)
- Customizable Headers and Sessions
Installation
To install HyperIO, you can use pip:
pip install hyperio
Usage
# Importing the required classes from the hyperio package
import hyperio
from hyperio import HyperIO, AsyncHyperIO
# Synchronous Example - Using HyperIO
def sync_usage():
print("Synchronous HTTP Request Example:")
# Create a synchronous client
client = HyperIO()
# Making a GET request
response = client.get("https://jsonplaceholder.typicode.com/posts/1")
if response.ok:
print("GET Response:", response.json())
else:
print("Failed to retrieve data")
# Making a POST request
data = {"title": "foo", "body": "bar", "userId": 1}
post_response = client.post("https://jsonplaceholder.typicode.com/posts", json=data)
if post_response.ok:
print("POST Response:", post_response.json())
else:
print("Failed to post data")
# HTML rendering using the view_html function
html_content = client.view_html("https://example.com")
print("HTML Content (first 200 chars):", html_content[:200])
# File download example (sync)
client.download_file("https://www.example.com/somefile.txt", "somefile.txt")
print("File downloaded successfully.")
# Asynchronous Example - Using AsyncHyperIO
import asyncio
async def async_usage():
print("\nAsynchronous HTTP Request Example:")
# Create an asynchronous client
client = AsyncHyperIO()
# Making a GET request asynchronously
response = await client.get("https://jsonplaceholder.typicode.com/posts/1")
if response['ok']:
print("GET Response:", response['json'])
else:
print("Failed to retrieve data")
# Making a POST request asynchronously
data = {"title": "foo", "body": "bar", "userId": 1}
post_response = await client.post("https://jsonplaceholder.typicode.com/posts", json=data)
if post_response['ok']:
print("POST Response:", post_response['json'])
else:
print("Failed to post data")
# HTML rendering asynchronously using the view_html function
html_content = await client.view_html("https://example.com")
print("HTML Content (first 200 chars):", html_content[:200])
# File download example (async)
await client.download_file("https://www.example.com/somefile.txt", "somefile_async.txt")
print("File downloaded successfully.")
# Closing the client session
await client.close()
# Running the examples
if __name__ == "__main__":
sync_usage() # Run the synchronous example
asyncio.run(async_usage()) # Run the asynchronous example
Metadata
Release files for hyper-io3 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hyper_io3-0.1.0.tar.gz | 4.7 kB | Without provenance | Details for hyper_io3-0.1.0.tar.gz |
Release files / hyper_io3-0.1.0.tar.gz
| Download URL | hyper_io3-0.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5005e6915967f4181b302ba8e79ba47ad9233d0bbf210ee310e4f1288ae89543
|
|
BLAKE2b-256 checksum How to use checksums |
a495a7af48946a7c075c92044e753305f55ecfc13da93cb5252c6ee8ce1ebd4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for hyper-io3 0.1.0
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.