Skip to main content

Nebula is a lightweight ASGI-based Python web framework that provides simple, decorator-based routing and middleware support for building fast, asynchronous web applications.

Project description

Nebula

PyPI Stars Contributors

Nebula is a lightweight ASGI-based Python web framework that provides simple, decorator-based routing and middleware support for building fast, asynchronous web applications.

Features

  • Decorator-based Routing: Define your routes with simple and intuitive decorators.
  • Asynchronous Support: Full async/await support for handling requests and events.
  • Session Management & Authentication: Secure session handling and user authentication.
  • WebSocket Support: Real-time communication with WebSocket routing.
  • Template Loading: Easily load and serve HTML templates from a designated directory.
  • Statics Loading: Easily load and serve files from designated directory.
  • Middleware Support: before_request and after_request hooks for flexible request handling.
  • Flexible Error Handling: Easily handle HTTP errors with use of error_handler(<http_code:int>).
  • Easy to Use: Get a server up and running in just a few lines of code.

Installation

Install Nebula from PyPI:

pip install nebula-core

or clone and install from GitHub.

git clone https://github.com/VxidDev/nebula.git
cd nebula
pip install .

Usage

Here's a basic example of creating a simple web server with Nebula.

main.py:

from nebula import Nebula , run_dev
from nebula.response import HTMLResponse

app = Nebula(__file__, "localhost", 8000)

@app.get("/", return_class=HTMLResponse)
async def root(request) -> None:
    return "<h1>Welcome to Nebula!</h1>"

if __name__ == "__main__":
    run_dev(app)

Run your app:

python main.py

Open your browser and navigate to http://localhost:8000 to see your page.

Contributions <3

amogus-gggy:

  • refactoring Nebula 0.2.0.
  • adding websockets support (2.0.0)
  • adding session support

Huge thank you!

License

This project is licensed under the MIT License - see the LICENSE file 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

nebula_core-3.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

nebula_core-3.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file nebula_core-3.1.0.tar.gz.

File metadata

  • Download URL: nebula_core-3.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for nebula_core-3.1.0.tar.gz
Algorithm Hash digest
SHA256 f340ef819e2e2b9776ce3da41158ba9eab57ab34b4a28d1f91b9b8bc493c63ef
MD5 d44c0c47c8011abb5e2ff09fc44d0e52
BLAKE2b-256 fc1e9a8b4b7e596522cac66c73cf7046924cb987a7e9d76f4375070562b8825b

See more details on using hashes here.

File details

Details for the file nebula_core-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: nebula_core-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for nebula_core-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fbd7db14145a5e956fccaa5c60cceb256288f791db2f2d8b5370595c9092cb9
MD5 561f954e9d2e9f08a4ba94d6ddf112e1
BLAKE2b-256 5d82e34b150396d4503cec67e9a8942dacf3ba993894e089dc20689e43fe4e9e

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