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

Uploaded CPython 3.14Windows x86-64

xyra-0.2.7-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.7-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

xyra-0.2.7-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.7-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

xyra-0.2.7-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.7-cp312-cp312-macosx_11_0_arm64.whl (952.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

xyra-0.2.7-cp311-cp311-win_amd64.whl (868.8 kB view details)

Uploaded CPython 3.11Windows x86-64

xyra-0.2.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (974.4 kB view details)

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

xyra-0.2.7-cp311-cp311-macosx_11_0_arm64.whl (899.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: xyra-0.2.7.tar.gz
  • Upload date:
  • Size: 573.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.7.tar.gz
Algorithm Hash digest
SHA256 7d2762a6505c2a2a345bf9ce4569408e116a30be299ead62626f75ea18a12a57
MD5 e40707df86c9a212e09d861d785a906b
BLAKE2b-256 225d54fcf29cb3976b3d903ad26b072fd2f56d5e273691e311202ec9304f407c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e6f659d32f7512c230c0502fb28ce098a4d416ea61e6226a1b83e9859593d3ee
MD5 cc458d83a7a3a6e51fe2f8abb8b64ca6
BLAKE2b-256 2aa75636c6eed607e0bc99a4fe188b3e5c6de10ce4ba423b6eb5fae2b4b03607

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce224f6466ed36533ab327fbc17efbe6ecc7379abb22a185c6032eed6615d5ec
MD5 901206648979ec892d2771f412877853
BLAKE2b-256 66d2ab595b1b5e963a17491ce0a1d20d5e4120e8e943c1461a74f6060f202fcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61b2dbeeecec89f80c1c33da0973d1075c714ce39f93f973fb347455eec711c0
MD5 d724adacdd75124eaed28c8fdd150648
BLAKE2b-256 3323fa1a7b92c90b6621f2b2db4c8ec4c6575da7aa9f4d0b0a56f0d2bc7f2e89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 043d1d7a3800f25b250eec7d1cf1bbfeac97ac6510f7ad208a9fdd5182f1138d
MD5 34c5081c932d94802c9fbded3022889e
BLAKE2b-256 8e784e737590f74aaa94295da3fe4205be443b4f5916016ca29ab57bd142a849

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc16c1dc7b5f89d8f96811007e407a0236496f8f284d79ad9b7b3dd16de577e5
MD5 d44f7f48cd71285ee24449a930b1c1d6
BLAKE2b-256 9e9c746c295424e6f25d8ad7797a6cdf21b9fe047c14fbffe3c796d26ae763f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 142c913cfd9b322fdb0911aae4ffcd428428524a65b3a3d7f001171db4910e65
MD5 03362ecd7d63dda4db24432294f2ab38
BLAKE2b-256 511ae2f608063ac1ba952c25cca7d920e8c64a6c6fdf7b351c5b792acbf8296d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 16975b8e538327f6a155a6081a15543f4065631b58c0cb9112efd4a2c6c52299
MD5 d074a0ab40b5d96ae2d88df4d793f249
BLAKE2b-256 146ba9082e45c1352506fe3baed8cd6795ecb6232746edab9dfd78fa6f1f5bf6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 743dcd0567e16ae95a09022f160f51f4095fc6430b6a5e0b9ec817934db131b2
MD5 e7d40c78134d25de967f7d71ca859f18
BLAKE2b-256 352149b56cd365a79e527424e0dea3cdfcb4931d544842fd9f672cfada55ab7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 952.3 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33910e59e0e508f36bdbca7146cb92ba29004ef0911da6d234269bebd58582a1
MD5 d79d410c7a4c6fee7c8c1244bb9eb8f8
BLAKE2b-256 6e7d562e3b5cae7c3d715afbaee66139a98a51bdaa88afb1aad500de8e463185

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 868.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 19317cd5a1cd75dc94476ff315d39aaede7a56e7f84e688e19c15aef4e7054a8
MD5 a9ead8b3c4b0d4a6b0b5812bae276837
BLAKE2b-256 d137b6e22d6cb32df8f80e44237bbf5c408c6b306213eea439ff09880ebea851

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 974.4 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.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 25a42efdbf540c40f51c7080faa0d1cdb2dedcd49540ae78882272250a3ace0f
MD5 a1de3472de39b669cb82e0980a21d730
BLAKE2b-256 a53283b63a42e1474db815361a8deb77f824093a85209370b0ff1d1be9b1e150

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.7-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 899.1 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 190d4c0db71729b6be0b59198ec1e1cb224306c701c05769d35d0010aa1d6f9b
MD5 29ab61e71fd3e16257dab43013ab7569
BLAKE2b-256 ddabbc8e2b3efdf3f54dd0a0560ad84d5ead248e75ba0cbe8c6df2c7f13f18a7

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