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

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.4.tar.gz (229.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.4-cp313-cp313-win_amd64.whl (771.2 kB view details)

Uploaded CPython 3.13Windows x86-64

xyra-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (727.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

xyra-0.2.4-cp313-cp313-macosx_11_0_arm64.whl (665.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

xyra-0.2.4-cp312-cp312-win_amd64.whl (771.2 kB view details)

Uploaded CPython 3.12Windows x86-64

xyra-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (727.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

xyra-0.2.4-cp312-cp312-macosx_11_0_arm64.whl (665.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

xyra-0.2.4-cp311-cp311-win_amd64.whl (770.7 kB view details)

Uploaded CPython 3.11Windows x86-64

xyra-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (726.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

xyra-0.2.4-cp311-cp311-macosx_11_0_arm64.whl (665.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: xyra-0.2.4.tar.gz
  • Upload date:
  • Size: 229.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4.tar.gz
Algorithm Hash digest
SHA256 2cb1aa878cd3005d24262a8116eb6173678217c6d31c1f698fe3e5fc2adbc53e
MD5 f1e8e447b8c8f6b402d98461042ec220
BLAKE2b-256 55f11bf042429bbb69790d6eaefc2c0d91a78bd90b5e53712f20f5f8fd16b6ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 771.2 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 09b9acc8abee999b25c04c189cbc81d34630f32f8cb1deb995b3868c9966b6d8
MD5 15b790ef7688d39e231fdc0847bf4eeb
BLAKE2b-256 47cb7b530526204d5caa3f769802c67236fa1c72255c2edf51e32d76e240b8a8

See more details on using hashes here.

File details

Details for the file xyra-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 727.6 kB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d773765ddbc3c08c4d54c663ed7959bc8783f28b7958e43ec9dd1802354c597
MD5 6776a75e96836cce269333777ca86dc2
BLAKE2b-256 47438997413f0cdffdd19040911d1b6a0fec3db7cc483f259dab3dadd961354f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 665.3 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85ac52d275bd1fa2b48194e41cc5ab46c852572a0ff9b72f5933f36dc5205635
MD5 59963096649590b0b05b5e1299fe0bae
BLAKE2b-256 66e6cf4f99cf46fed21a3aa7e139f611ecd4e2143beb4f05bc784d11b7e482b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 771.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6bbc94124c31ab1cb73b48c9fd86fca53f6ceea8a558b53e603fcedd5ebe2908
MD5 13fd5b4243f92c109a3d744c1db69d16
BLAKE2b-256 c1f2e41c259a04c9a0f3221a7d3bcd5528f729bef639036b57a685b42880b85f

See more details on using hashes here.

File details

Details for the file xyra-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 727.5 kB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e3816d278f81f429fd2d15de7023dc2e43e31847d4e3331eac92addbc7d815d
MD5 1a7e4dbd55d3abc1eda9552215139483
BLAKE2b-256 ad2357a11daf0868d38eaa5dfac1b25d4cc221ffc6e674ecbfe632aadde84903

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 665.3 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98b422543c877390569bbf28c906e441c046db71212d8dada73286f9e85af10c
MD5 0a7fec6eff4c8814290e9d555af0f184
BLAKE2b-256 9b94233dda013de78ce1bfb228ac7c31223674a047c97ca1a6cc7ae41fe3c1db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 770.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4d36c04d39be78e1b45e747ddd537bf9fea64abbfbd768bf7f7f2faa35a885eb
MD5 0471e7ed301e5c2017f941a11a9a960a
BLAKE2b-256 27c9a40d2db443e8aaaac7d24e2eb77f0cd9b8121ebdc75a3e650e768955d6bb

See more details on using hashes here.

File details

Details for the file xyra-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: xyra-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 726.7 kB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c221ad88ba46293ee8437cf6ad0db29dd6aa6026b41a660867113a115f42c54
MD5 ec60367cfebd6486284671b4ba61ae92
BLAKE2b-256 955b68d890b49052e1ae4da42b53b20423b080bdf93135e2d67e1e25f4a244fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyra-0.2.4-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 665.4 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f984989aeaf6b91d1812919937d9f3a9375154168e8388968180eb3b4c38d8f
MD5 6f85df7fc5a4fee84a79cd978d55c839
BLAKE2b-256 9744ab2fcb5f657205ee7401facd5455907645177bba3f9b8a2fff4a7978dff9

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