Skip to main content

High Performance Frameworks, Easy to learn and Ready for Production

Project description

Xyra Framework

Python Version License: MIT PyPI version

A high-performance, asynchronous web framework for Python, built on top of socketify.py. Xyra is designed to be fast, easy to use, and feature-rich, making it an excellent choice for building modern web applications, APIs, and real-time applications.

✨ Key Features

  • 🚀 High Performance: Built on socketify.py for exceptional speed and low latency
  • Asynchronous: Full async/await support for non-blocking operations
  • 🎯 Simple API: Intuitive design inspired by Flask and Express.js
  • 🔧 Middleware Support: Easily add logging, authentication, CORS, and more
  • 📚 Auto API Docs: Built-in Swagger/OpenAPI documentation generation
  • 🔌 WebSocket Support: Real-time communication out of the box
  • 📄 Templating: Jinja2 integration for HTML rendering
  • 📁 Static Files: Efficient static file serving
  • 🛡️ Type Safety: Full type hints support

📦 Installation

Install Xyra using pip:

pip install xyra

Or install from source for the latest features:

git clone https://github.com/xyra-python/xyra.git
cd xyra
pip install -e .

🚀 Quick Start

Create your first Xyra application:

# app.py
from xyra import App, Request, Response

app = App()

@app.get("/")
def hello(req: Request, res: Response):
    res.json({"message": "Hello, Xyra!"})

if __name__ == "__main__":
    app.listen(8000)

Or

# app.py
from xyra import App

app = App()

@app.get("/")
def hello(req, res):
    res.json({"message": "Hello, Xyra!"})

if __name__ == "__main__":
    app.listen(8000)

Run the application:

python app.py

Visit http://localhost:8000 to see your app in action!

📖 Documentation

🎯 Example Applications

REST API

from xyra import App, Request, Response

app = App()

# In-memory storage
users = []

@app.get("/api/users")
def get_users(req: Request, res: Response):
    res.json(users)

@app.post("/api/users")
async def create_user(req: Request, res: Response):
    user_data = await req.json()
    user_data["id"] = len(users) + 1
    users.append(user_data)
    res.status(201).json(user_data)

if __name__ == "__main__":
    app.listen(8000)

WebSocket Chat

from xyra import App

app = App()
clients = set()

def on_open(ws):
    clients.add(ws)
    ws.send("Welcome to chat!")

def on_message(ws, message, opcode):
    for client in clients:
        if client != ws:
            client.send(f"User: {message}")

def on_close(ws, code, message):
    clients.discard(ws)

app.websocket("/chat", {
    "open": on_open,
    "message": on_message,
    "close": on_close
})

if __name__ == "__main__":
    app.listen(8000)

HTML with Templates

from xyra import App, Request, Response

app = App(templates_directory="templates")

@app.get("/")
def home(req: Request, res: Response):
    res.render("home.html", title="My App", users=["Alice", "Bob"])

if __name__ == "__main__":
    app.listen(8000)

🏃 Running Examples

Try the included examples:

# Simple app
python example/simple_app.py

# Full-featured app with templates and WebSocket
python example/app.py

Visit http://localhost:8000 and explore the API docs at http://localhost:8000/docs.

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Setup

git clone https://github.com/xyra-python/xyra.git
cd xyra
pip install -e .[dev]
pytest

Code Style

We use:

  • Black for code formatting
  • isort for import sorting
  • flake8 for linting
  • mypy for type checking

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built on top of socketify.py
  • Inspired by Flask, Express.js, and FastAPI
  • Thanks to all our contributors!

📞 Support


Made with ❤️ for the Python community

📊 Benchmark

We run weekly benchmarks against other popular Python web frameworks. See the full Benchmark Report for details.

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

xyra-0.2.5.tar.gz (244.8 kB view details)

Uploaded Source

Built Distributions

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

xyra-0.2.5-cp314-cp314-win_amd64.whl (795.4 kB view details)

Uploaded CPython 3.14Windows x86-64

xyra-0.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (723.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

xyra-0.2.5-cp314-cp314-macosx_11_0_arm64.whl (679.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

xyra-0.2.5-cp313-cp313-win_amd64.whl (784.3 kB view details)

Uploaded CPython 3.13Windows x86-64

xyra-0.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (723.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

xyra-0.2.5-cp313-cp313-macosx_11_0_arm64.whl (679.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

xyra-0.2.5-cp312-cp312-win_amd64.whl (784.4 kB view details)

Uploaded CPython 3.12Windows x86-64

xyra-0.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (722.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

xyra-0.2.5-cp312-cp312-macosx_11_0_arm64.whl (679.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

xyra-0.2.5-cp311-cp311-win_amd64.whl (783.7 kB view details)

Uploaded CPython 3.11Windows x86-64

xyra-0.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (720.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

xyra-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (679.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file xyra-0.2.5.tar.gz.

File metadata

  • Download URL: xyra-0.2.5.tar.gz
  • Upload date:
  • Size: 244.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5.tar.gz
Algorithm Hash digest
SHA256 76781a2528d9c9eb057612d47e35a873dcdb266a8b9351fcae456fb441580bde
MD5 f7044fd657f98170d9ea6f08371e8bad
BLAKE2b-256 99e25fe1640b2516c80ca62ea49436a5547d519d9022670bdf3b312d7a679a5d

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 795.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c58d8b159b19006d7669037b384296e768041f40bc125dbcc9a4ac2f476ba520
MD5 1ea00569c42fdbde82d63e6b050d07d4
BLAKE2b-256 5b9a07cf7dbc81c1aa41974ad36f7743d922f5473be45031f1d0a1260ef262b8

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 723.1 kB
  • Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac4a1b3b7fb04de324c7106a8cbb6de6923c8e18e560535330b9871c54ec4071
MD5 c38d92ae8280c6c6ea51128697078bc7
BLAKE2b-256 2fd5800335f6a03345c636bb933e61ab2cddf859ffe5168d086d244fcd190bc3

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 679.8 kB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8616977e2a03b746fa854d399c6e10dec45548e05c36f7030855d3c21de03162
MD5 2bfd17f249a58efa04e4fec6c4aa9aaf
BLAKE2b-256 4091b319ffea753104d49be3974ba5c4817c8818ddb8dfb484cfed19b9d108d9

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 784.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5bbd0d0d8c132835b10b199e775def15afa151ae81c46e87fa8b5bee4b5adf0c
MD5 2c4efcbd044caaca754cad7ad2bd26f9
BLAKE2b-256 76d6c97aa6f1b5202c77be5afd9c00d46f9ab1b4d45f2cfa01e8ce7e91c64c7c

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 723.0 kB
  • Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3879990d142bf393c99e60ced874ae9c6251346ecca29aae7140a34aa108885b
MD5 7b66cb5683df8c550be9ca54a76875d7
BLAKE2b-256 599cb4b610b246d0e33d42fb78cc13f71a1f68b041a222ec75e345bff9e53db8

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 679.4 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67ea133c57ac048c4d768c0b09772359788b8ae0468578c3641eed85b6ae1299
MD5 3a9120ee74036fa8e8ff21de7a74b3d0
BLAKE2b-256 67cc9aff3c163ad212e764730d1361357de76f2216e18261aa4703ae07fd7af1

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 784.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bf401f3d4152f874eac9852882c05c745c75c1354849ea35f7d2610b67ecb17c
MD5 0e5fd6ba1505b8cbca5479a02ac28f76
BLAKE2b-256 08ea5cf984f4aba8ef7ad504bc8553fb9c7a8951cfa30345d81a71cea4c5a98c

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 722.9 kB
  • Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0cbec2c5f443ee16eb1e37db176887e386f230ea79c98336e50d3ee0d9d0673
MD5 cce640b463fa597ccf46a026e1bbfbb3
BLAKE2b-256 d93f9ae9cc048ded3ad788c63fa402c1ebaa1db68e3c789dc88bab7d5098b10f

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 679.4 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08e663245c298a7ec6166b034bb604d77751a12e02bb3b79f1dfce5ad44c503f
MD5 4242f3838b275e90b88aae178efbc53c
BLAKE2b-256 7fabf93c371e7129a744d0314dbcdcf6b69275301423d2eecf39a4570b18032c

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 783.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dbd634d4ab8fff14651e4ea111491a447dfea5603542c4296c3ac1f3be4a5fdf
MD5 3a5aa8f2ccb4d131bf6ff19813008119
BLAKE2b-256 a494ae5e643c7c7d7420af6134deb97b899f05a833ec5957cec2c51f0ce612e1

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 720.3 kB
  • Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d7d80953ce05bd2be7e9601828bdd97f1063eab9d8797912ff442279be4caf98
MD5 cd0c9157679f8897af734fafe067b69c
BLAKE2b-256 e50ec67b9865f94cad5f7a788c7e97933eca485ec105331e45ef9849788811ec

See more details on using hashes here.

File details

Details for the file xyra-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: xyra-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 679.3 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xyra-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b559a7355ebc2262afce2b16a98aca32142fb1f66ca5077e30a44985c12275f9
MD5 0757ed6036f5415af1abe83c613f1115
BLAKE2b-256 5ca3d434c88558459d6b6756a86ae04e36b04309588bc4241b1ba7a0ecb8ed33

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