Metadata-Version: 2.4
Name: hyper-io3
Version: 0.1.0
Summary: A fast and flexible HTTP client for Python with sync and async support.
Home-page: https://github.com/yourusername/hyperio
Author: imAnesYT Dev
Author-email: imanesytdev.contact@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: aiohttp>=3.7.0
Requires-Dist: beautifulsoup4>=4.9.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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:

```bash
pip install hyperio
```
## Usage

```python
# 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
```
