Skip to main content

The Universal API Framework. High-performance Custom JSON-over-TCP Protocol. Zero Dependencies.

Project description

RUSH ๐Ÿš€

The Zero-Dependency, AI-Native Protocol Framework for Python

RUSH is a complete HTTP framework that replaces requests, FastAPI, and BeautifulSoup with zero external dependencies. It is designed for the future of the web: Autonomous AI Agents.


๐ŸŒŸ Features

Feature Description
Zero Dependencies Works with pure Python. No pip install required.
Full HTTP Control GET, POST, PUT, DELETE, PATCH with custom headers.
Stealth Mode Anti-blocking: User-Agent rotation, Jitter, Auto-429 handling.
Enterprise Ready Middleware, Scheduler, Strict Mode for production.
Agent Protocol Semantic messaging (Intent, Context) for AI-to-AI communication.
Discovery Mesh Agents find each other automatically via UDP Beacons.
Cryptographic Trust HMAC-SHA256 signed messages for identity verification.

โšก Quick Start

1. Basic HTTP Client (Replace requests)

from rush import Rush

app = Rush()

# Simple GET
data = app.get("https://jsonplaceholder.typicode.com/todos/1")
print(data)

# POST with JSON
resp = app.post("https://api.example.com/data", json={"key": "value"})
print(resp.json())

2. Stealth Mode (Anti-Blocking)

from rush import Rush

# Enable Stealth: Auto User-Agent rotation, Jitter, 429 handling
app = Rush(stealth=True)

data = app.get("https://protected-api.com/data")

3. HTTP Server (Replace FastAPI)

from rush import Rush

app = Rush()

@app.route("/api/hello")
def hello():
    return {"message": "Hello from RUSH!"}

app.start(port=8000)

4. Enterprise Features

from rush import Rush

app = Rush(strict_mode=True)

# Middleware (Logging, Auth)
def log_request(request):
    print(f"[LOG] {request.method} {request.path}")

app.add_middleware(log_request)

# Scheduled Tasks (Background Jobs)
def backup():
    print("Running backup...")
    
app.schedule(backup, interval_seconds=3600)

app.start(port=8000)

5. AI Agent Mode (The Future)

from rush import Rush

# Enable Agent Mode for AI-to-AI communication
agent = Rush(agent_mode=True)

@agent.route("/api/status")
def status():
    return {"agent_id": agent.agent_id, "status": "online"}

agent.start(port=9000, background=True)

# Agents discover each other automatically via UDP Beacons
# Then they communicate using signed semantic messages

๐Ÿ“ Project Structure

project_rush/
โ”œโ”€โ”€ rush.py              # Main SDK Entry Point
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ rush_http.py     # Raw HTTP Client (Zero-Dep)
โ”‚   โ”œโ”€โ”€ rush_client.py   # High-Level Client (Caching, Retry, Stealth)
โ”‚   โ”œโ”€โ”€ rush_server.py   # Custom HTTP Server (Thread Pool, DDoS Protection)
โ”‚   โ”œโ”€โ”€ rush_router.py   # Routing & Middleware
โ”‚   โ”œโ”€โ”€ rush_parser.py   # HTML Parser (BeautifulSoup replacement)
โ”‚   โ”œโ”€โ”€ rush_protocol.py # Semantic Message Format (Intent, Context)
โ”‚   โ”œโ”€โ”€ rush_discovery.py# Agent Discovery (UDP Beacon)
โ”‚   โ””โ”€โ”€ rush_trust.py    # Cryptographic Signatures (HMAC-SHA256)
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ magic_demo.py    # Quick Demo
โ”‚   โ”œโ”€โ”€ full_control_demo.py # All HTTP Methods
โ”‚   โ”œโ”€โ”€ stealth_demo.py  # Anti-Blocking Demo
โ”‚   โ”œโ”€โ”€ enterprise_demo.py # Middleware & Scheduler
โ”‚   โ””โ”€โ”€ ai_mesh_demo.py  # Agent-to-Agent Communication
โ”œโ”€โ”€ static/              # Static Files for Server
โ”œโ”€โ”€ tests/               # Unit Tests
โ”œโ”€โ”€ README.md            # This File
โ”œโ”€โ”€ USAGE.md             # Detailed Usage Guide
โ”œโ”€โ”€ requirements.txt     # Empty (Zero Dependencies!)
โ”œโ”€โ”€ setup.py             # For pip install
โ””โ”€โ”€ Dockerfile           # For Docker Deployment

๐Ÿ›ก๏ธ Security Features

  • Header Injection Prevention: All header values are sanitized.
  • Anti-Slowloris: Connection timeout (5s) prevents slow attacks.
  • Thread Pool: Limits concurrent connections to prevent DoS.
  • Request Size Limit: 10MB max to prevent memory exhaustion.
  • HMAC Signatures: Agent messages are cryptographically signed.

๐Ÿ“ˆ Comparison

Feature REST (requests + FastAPI) RUSH
Dependencies 50+ packages 0
Stealth/Anti-Block โŒ โœ…
Background Scheduler External (Celery) โœ… Built-in
Middleware Complex ASGI โœ… Simple
AI Agent Protocol โŒ โœ…
Discovery Mesh โŒ โœ…

๐Ÿš€ Deployment

Docker

docker build -t rush-app .
docker run -p 8000:8000 rush-app

Local

python rush.py
# Or run any example:
python examples/magic_demo.py

๐Ÿ‘ค Author

Rushabh Mavani
๐Ÿ“ง rushabhmavani01@gmail.com


๐Ÿ“œ License

MIT License - Use it, modify it, build the future with it.


Built for the Age of AI Agents. ๐Ÿค–

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

rush_api-3.0.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

rush_api-3.0.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file rush_api-3.0.1.tar.gz.

File metadata

  • Download URL: rush_api-3.0.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rush_api-3.0.1.tar.gz
Algorithm Hash digest
SHA256 8e54a85618af9e08cc4b2dff281ce445098f67a637234654a71cbb1cb1c4d2fb
MD5 7a9e6ae02f03270763a6e2e6fb055d78
BLAKE2b-256 8d7db54db924a515ea6ad3eba6d81489b91e99c4b6e032a4c851da6f81f28542

See more details on using hashes here.

File details

Details for the file rush_api-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: rush_api-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rush_api-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ccf294bc54fa54032fea2ecf86a8a2d32db0f3ae0293186d478092071550e34
MD5 9ed76c10a4dcd03d4d8bc9785fcda9b2
BLAKE2b-256 457dd15dc6a012fd0e0738fdeffca0120033094041f7c7e901361fab3969f6fb

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