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.

Note: This project is 100% created by AI. 🤖

✨ 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.6.tar.gz (571.2 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.6-cp314-cp314-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.14Windows x86-64

xyra-0.2.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

xyra-0.2.6-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

xyra-0.2.6-cp313-cp313-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.13Windows x86-64

xyra-0.2.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

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

xyra-0.2.6-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

xyra-0.2.6-cp312-cp312-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.12Windows x86-64

xyra-0.2.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

xyra-0.2.6-cp312-cp312-macosx_11_0_arm64.whl (952.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

xyra-0.2.6-cp311-cp311-win_amd64.whl (868.9 kB view details)

Uploaded CPython 3.11Windows x86-64

xyra-0.2.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (974.5 kB view details)

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

xyra-0.2.6-cp311-cp311-macosx_11_0_arm64.whl (899.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: xyra-0.2.6.tar.gz
  • Upload date:
  • Size: 571.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6.tar.gz
Algorithm Hash digest
SHA256 69b0cf2d2b6ac02e5b159270415132cf7e31cd214b4d4e6ba892ce492e8c2fba
MD5 d105d235ac54f3dd07947d48700dc640
BLAKE2b-256 80dc17d2dc5f6d86519651eaf6d3af49a09664f39fce5d678d35bc61276e066b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f462c9feb51565e69c1feae6acbdd451898f54917546de2ca12a141f07e1988a
MD5 261d6828833e020ffa7a36acf916f900
BLAKE2b-256 057e04e8b51e011121abc7d9cbab94f17d817e3a1c7b6d8ac84e5edaef998309

See more details on using hashes here.

File details

Details for the file xyra-0.2.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.14, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 301e4281f81cac99942af60d3646468e5514aa6ddbf9825e6c8a7a5f3b6076cc
MD5 d4fe20a88941ffd0d6484f7d5f16a9a6
BLAKE2b-256 d296254cf6c235fc3c00ef50e8a6e3d47333beae293d0c7841fd7049fe9371c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be721c41951dcbec18293a81a98fe56be8f3804bf6f1898cc3ff93abee1d69ce
MD5 9047c12db28dff9eed38adac5955b4a6
BLAKE2b-256 1f67305decfd23c2306c2a11c922be5ebdcf00b3191329ae8b95a3e9de32e795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a6b330f72dc3b681c8c11f528d3aab3b1cca72251648b09dd8ee228ce15eb1c9
MD5 3886a216b959b1663b6170e89176ccb0
BLAKE2b-256 797e907bd99492b5142c640b0328c2428ab020a122c7be4fc9ac737a9c04b24b

See more details on using hashes here.

File details

Details for the file xyra-0.2.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a18ad50e8ad83c41f1cf3c8c6b98a80de61dbaa13a48edd142167318628ce908
MD5 014907b0db13b3d5ac8a6165aba20356
BLAKE2b-256 a6985a7eeefa4967a46660666c5d1c060c7cbbf077f0477663eac6140cc1bcc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f637abbeece3acd750749c3cec4feb3aa2f3f0d9ed85599a9c3293962786ba82
MD5 42b6c02d7d020cb8417383db10d04811
BLAKE2b-256 6ac16091487310d39d4c120f16e95b69ac714d5bb157ca4b3213964811f17b74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dcde0877b6021037696c0a259d87529cb399434de875a100094fa54b0bb47385
MD5 acbd519d7af24fcc2986aeed870a76e8
BLAKE2b-256 dd1257c5df3c536106b045306bccb3b46b239542ac9cde294eab7503ff6e94eb

See more details on using hashes here.

File details

Details for the file xyra-0.2.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 23fe8fa7460d193f3113e30df1342695237cda2e3db7094849d1301399fc61b8
MD5 72cb21925b5e0a2201d228773014ae2c
BLAKE2b-256 cde87db99fab9963c80ff99d8420bdc6bcd1faf6753ca754112ff93edc3551b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 952.5 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2638d43ddb3352054990f346fe7ffd97d46bcfd4487d165b83b5b2f2d767a562
MD5 fb8a1a44ca2ebf60bad8cd20f9311402
BLAKE2b-256 a801c32494248423bfc8a5a8eea1c23e191fd5f41359b17e3ff9b5a199888e31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 868.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7520132e758d4f6b885e363d4349ceb95cd49ba921629e374cab7293a7ad630f
MD5 ff492b4f980f4715b9aecc97038ac6c9
BLAKE2b-256 7096080b83a2038551678d4130051c97c4cf857b4055f3fa2d093e12afb34503

See more details on using hashes here.

File details

Details for the file xyra-0.2.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 974.5 kB
  • Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ed177a0cc53b34efccb851771aac4d79123d77c2de3106f364aff0bf4a415fa
MD5 a3ada4dd4bc39e8f1ab504849edd1adc
BLAKE2b-256 913db044b80324020f9d4a20284be817b7a6068f53d32a76e789ff26f478f2d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.6-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 899.2 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d2c9ee7bc67ab882a50ed2d957e23683c828dad4917b708da94c2dc7de69a8c
MD5 eb034ec7566e46e1f64128700a0be28d
BLAKE2b-256 15009e6a3a510f6af605df86826b95b32dcb3110adce9dbc1a3fb5df3267296c

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