Metadata-Version: 2.4
Name: reqcrypt-dev
Version: 0.1.0
Summary: Advanced HTTP client with encryption and caching support
Author: Hamachi296
License: MIT
Keywords: http,client,encryption,caching,requests,security
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0

reqcrypt

Advanced HTTP client with built-in encryption, caching, and secure communication protocols

Version: 1.0.0
Author: Hamachi295
License: MIT

Installation

pip install reqcrypt

Or install from source:

git clone https://github.com/Hamachi295/reqcrypt.git
cd reqcrypt
pip install -e .

Quick Start

from reqcrypt import get, post, set_base_url

set_base_url("https://api.example.com")

response = get("/users", cipher="aes")
print(response)

response = post("/users", json_data={"name": "John", "email": "john@example.com"})
print(response)

Features

Encryption Support
XOR encryption - Fast and lightweight
AES encryption - Industry standard
Custom encryption keys

Caching
Automatic response caching
Configurable TTL
Cache statistics

Rate Limiting
Built-in rate limiter
Configurable limits
Per-key limiting

File Operations
Download files
Upload files
Progress tracking

Security Features
Request validation
Header validation
HTTPS verification

HTTP Methods
GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH
Custom headers support
Query parameters
Form data and JSON payloads

Documentation

Basic Usage

GET Request

from reqcrypt import get

response = get("https://api.example.com/data")

response = get("https://api.example.com/search", params={"q": "python", "limit": 10})

response = get("https://api.example.com/secure", cipher="aes")

POST Request

from reqcrypt import post

response = post("https://api.example.com/users", json_data={
"name": "Alice",
"email": "alice@example.com"
})

response = post("https://api.example.com/upload", data={
"title": "My File",
"description": "Important document"
})

response = post("https://api.example.com/secure", json_data={"data": "sensitive"}, cipher="aes")

PUT Request

from reqcrypt import put

response = put("https://api.example.com/users/1", data={
"name": "Alice Updated",
"email": "alice.new@example.com"
})

DELETE Request

from reqcrypt import delete

response = delete("https://api.example.com/users/1")

HEAD Request

from reqcrypt import head

response = head("https://api.example.com/large-file")
print(response['headers']['Content-Length'])

OPTIONS Request

from reqcrypt import options

response = options("https://api.example.com/api")
print(response['allow'])

PATCH Request

from reqcrypt import patch

response = patch("https://api.example.com/users/1", data={
"email": "alice.updated@example.com"
})

File Operations

Download File

from reqcrypt import download_file

result = download_file(
"https://api.example.com/files/document.pdf",
"document.pdf"
)
print(f"Downloaded {result['size']} bytes")

Upload File

from reqcrypt import upload_file

result = upload_file(
"https://api.example.com/upload",
"image.jpg",
fields={"category": "photos", "public": "true"}
)
print(result)

Configuration

Set Base URL

from reqcrypt import set_base_url

set_base_url("https://api.example.com/v1")
response = get("/users")

Custom Headers

from reqcrypt import set_header

set_header("X-API-Key", "your-api-key")
set_header("X-Custom-Header", "custom-value")

Timeout Configuration

from reqcrypt import set_timeout

set_timeout(60)

Proxy Configuration

from reqcrypt import set_proxy

set_proxy("http://proxy.example.com:8080")

Cache Management

from reqcrypt import clear_cache, get_cache_stats

clear_cache()

stats = get_cache_stats()
print(f"Cache size: {stats['size']}")
print(f"Max size: {stats['max_size']}")
print(f"TTL: {stats['ttl']} seconds")

Rate Limiting

from reqcrypt import reset_rate_limit

reset_rate_limit("api_key_123")

Advanced Usage

Custom Request Handler

from reqcrypt import create_handler

handler = create_handler(
base_url="https://api.example.com",
timeout=60
)

response = handler.get("/users", cipher="aes")

Encryption with Custom Key

from reqcrypt import CryptoManager

key = CryptoManager.generate_key(32)

encrypted = CryptoManager.encrypt("secret data", key)

decrypted = CryptoManager.decrypt(encrypted, key)

print(decrypted)

AES Encryption

from reqcrypt import CryptoManager

key = "my-secret-key-123"
encrypted = CryptoManager.aes_encrypt("sensitive data", key)
decrypted = CryptoManager.aes_decrypt(encrypted, key)

Performance

Caching - Reduces response time by 80-95%
XOR Encryption - Minimal overhead
AES Encryption - Moderate overhead
Rate Limiting - No significant overhead

Security Considerations

Always use HTTPS in production
Store API keys securely
Enable rate limiting to prevent abuse
Use strong encryption for sensitive data
Validate all inputs before sending

Development

Testing

pytest tests/
pytest --cov=reqcrypt tests/

Building

python -m build
python -m mkdocs build

Examples

Complete API Client

from reqcrypt import set_base_url, set_header, get, post

class APIClient:
def init(self, base_url, api_key):
set_base_url(base_url)
set_header("X-API-Key", api_key)

client = APIClient("https://api.example.com", "your-api-key")
user = client.get_user(123)

File Upload with Progress

from reqcrypt import upload_file

def upload_with_progress(file_path, endpoint):
print(f"Uploading {file_path}...")
result = upload_file(endpoint, file_path)

License

MIT License - see LICENSE file for details.

Contributing

1. Fork the repository
2. Create a feature branch
3. Commit changes
4. Push to branch
5. Open a Pull Request

Support

Issues: GitHub Issues
Email: hamachi295@example.com
Documentation: reqcrypt.readthedocs.io

Disclaimer

This library is provided as-is. Use at your own risk. The authors are not responsible for any damages or losses caused by using this software.

Made with love by Hamachi295
