Robyn is an async Python backend server with a runtime written in Rust, btw.

Overview

Robyn

Gitter Downloads

Robyn is an async Python backend server with a runtime written in Rust, btw.

Python server running on top of of Rust Async RunTime.

Installation

You can simply use Pip for installation.

pip install robyn

Usage

from robyn import Robyn

app = Robyn(__file__)

@app.get("/")
async def h():
    return "Hello, world!"

app.start(port=5000)

Contributor Guidelines

Feel free to open an issue for any clarification or for any suggestions.

If you're feeling curious. You can take a look at a more detailed architecture here.

To Run Locally

  1. Add more routes in the test.py file(if you like). It only supports only get requests at the moment

  2. Run maturin develop

  3. Run python3 test.py

To Run

Without hot reloading

python3 app.py

With hot reloading

python3 app.py --dev=true

Contributors/Supporters

Thanks to all the contributors of the project. Robyn will not be what it is without all your support โค๏ธ .

Special thanks to the PyO3 community and Andrew from PyO3-asyncio for their amazing libraries and their support for my queries. ๐Ÿ’–

Comments
  • Add socket sharing

    Add socket sharing

    Todo:

    • Add more integration tests [x]
    • Check and fix directories not working [x]

    UPDATE

    • [x] Argparser not working. Need to fix this
    • [x] Fix the installation on Raspberry Pi and Windows
    • [ ] Write the documentation for the flags
    opened by sansyrox 25
  • Build failure

    Build failure

    Hi, getting another build error for 0.14.0; it's something with the rust compilation again: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=467486&view=logs&j=4f922444-fdfe-5dcf-b824-02f86439ef14&t=b2a8456a-fb11-5506-ca32-5ccd32538dc0

      error[E0277]: the trait bound `MyWs: actix::actor::Actor` is not satisfied
         --> src/web_socket_connection.rs:62:37
          |
      62  |     fn started(&mut self, ctx: &mut WebsocketContext<Self>) {
          |                                     ^^^^^^^^^^^^^^^^^^^^^^ the trait `actix::actor::Actor` is not implemented for `MyWs`
          |
      note: required by a bound in `WebsocketContext`
         --> /home/conda/feedstock_root/build_artifacts/robyn_1646278130206/_build_env/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-actors-4.1.0/src/ws.rs:373:8
          |
      373 |     A: Actor<Context = WebsocketContext<A>>,
          |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `WebsocketContext`
    

    There are five other errors that are similar/identical.

    opened by thewchan 19
  • Re-introduce thread pool for the sync functions (maybe)

    Re-introduce thread pool for the sync functions (maybe)

    https://github.com/sansyrox/robyn/pull/20#issuecomment-865121079

    Read discussion above

    And see if introducing a threadpool will impact asgi compliance(most probably not) but still check again.

    opened by sansyrox 14
  • [BUG?] Startup failure OSError: [WinError 87] The parameter is incorrect

    [BUG?] Startup failure OSError: [WinError 87] The parameter is incorrect

    Description

    When trying to start a Robyn app using the source code on the repo's README.md example, i get a massive error.

    Traceback (most recent call last):
      File "C:\Users\Happy\OneDrive\Documents\Coding Projects\robyntests\app.py", line 9, in <module>
        app.start(port=5000)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\robyn\__init__.py", line 127, in start
        p.start()
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\process.py", line 121, in start
        self._popen = self._Popen(self)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\context.py", line 224, in _Popen
        return _default_context.get_context().Process._Popen(process_obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\context.py", line 327, in _Popen
        return Popen(process_obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\popen_spawn_win32.py", line 93, in __init__
        reduction.dump(process_obj, to_child)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\reduction.py", line 63, in dump
        ForkingPickler(file, protocol, *args, **kwds).dump(obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\dill\_dill.py", line 620, in dump
        StockPickler.dump(self, obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 487, in dump
        self.save(obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 603, in save
        self.save_reduce(obj=obj, *rv)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 717, in save_reduce
        save(state)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 560, in save
        f(self, obj)  # Call unbound method with explicit self
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\dill\_dill.py", line 1251, in save_module_dict
        StockPickler.save_dict(pickler, obj)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 972, in save_dict
        self._batch_setitems(obj.items())
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 998, in _batch_setitems
        save(v)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 560, in save
        f(self, obj)  # Call unbound method with explicit self
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 902, in save_tuple
        save(element)
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 578, in save
        rv = reduce(self.proto)
    TypeError: cannot pickle 'builtins.SocketHeld' object
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Happy\AppData\Local\Programs\Python\Python310\lib\site-packages\multiprocess\spawn.py", line 102, in spawn_main
        source_process = _winapi.OpenProcess(
    OSError: [WinError 87] The parameter is incorrect
    

    Expected Behavior

    Robyn runs I guess?

    Screenshots

    My code: image

    Environment:

    • Host OS: Windows
    • Browser: Firefox
    • Python Version: 3.10.4

    [Optional] Additional Context

    I'm running my file using the generic python app.py


    opened by justanotherbyte 12
  • Robyn version 0.9.0 doesn't work on Mac M1 Models

    Robyn version 0.9.0 doesn't work on Mac M1 Models

    Error Log :

    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
    ๐Ÿ“ฆ Built wheel for CPython 3.9 to /Users/shivaylamba/Desktop/robyn/target/wheels/robyn-0.9.0-cp39-cp39-macosx_11_0_arm64.whl
    ๐Ÿ’ฅ maturin failed
      Caused by: pip install in /Users/shivaylamba/Desktop/robyn/venv failed running ["-m", "pip", "--disable-pip-version-check", "install", "--force-reinstall", "/Users/shivaylamba/Desktop/robyn/target/wheels/robyn-0.9.0-cp39-cp39-macosx_11_0_arm64.whl"]: exit status: 1
    --- Stdout:
    
    --- Stderr:
    ERROR: robyn-0.9.0-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.
    ---
    
    opened by shivaylamba 12
  • Pure tokio

    Pure tokio

    Here's another proposal which massively reduces the complexity of the project by leveraging Tokio's multi-threaded runtime

    Would probably need some benching marking on your machine, for me it appears to be faster.

    Jack

    opened by JackThomson2 12
  • fix: enable hot reload on windows

    fix: enable hot reload on windows

    Description

    Concerned with issue/bug #283

    Changes

    • fix(dev_event_handler.py): use platform specific python3 alias to spawn processes

    Documentation

    No documentation update is required

    How I've tested my work

    • 26/26 tests passed (Debian 10)
    • 25/26 tests passed (Windows 10) (global_index_request() failed)

    Remarks

    • Although this minute code change gets the dev_index_request() test passed on windows, for some reason hot reload fails to work on my system.

      • Windows: Inside dev_event_handler.py, function on_any_event() gets called every time I make a change in the base_routes.py file but I cannot see changes being reflected on the browser.
      • Debian: Inside dev_event_handler.py, function on_any_event() does not get called when I make a change in the base_routes.py file and thus I cannot see changes being reflected on the browser.
      • I just want to make sure if this is a problem that everyone else is experiencing or is it only me?
    • Failure of global_index_request() test persists

    opened by guilefoylegaurav 11
  • Build error

    Build error

    Hi, I've been trying to build the newest version of robyn (v0.12.1) for distributing in conda-forge, but I've been getting this error during the build process:

      error[E0308]: mismatched types
         --> src/server.rs:160:33
          |
      160 |                 .client_timeout(0)
          |                                 ^ expected struct `std::time::Duration`, found integer
    
    

    I've tried conforming to the rust version in the CI to no avail. Does anyone have any advice?

    bug high-priority 
    opened by thewchan 11
  • Not able to see the added logs

    Not able to see the added logs

    Hey, I had a couple of questions :

    1. I am trying to explore the code base a little bit and was trying to put log statements in different files and then tried running the integration tests. But I am not able to see the log statement which I have added. I followed the guidelines mentioned, but am I missing anything here?

    2.. Is there an LLD for this? Would love to understand how the classes are interacting with each other and how the actual rust code is getting triggered :)

    Thanks!

    opened by sridharjajoo 10
  • fix config of port and url

    fix config of port and url

    Description

    This PR fixes an issue with configuring port and url. In #292, you change code to fix port and url each 500 and 127.0.01 when robyn.env doesn't exist. So, I changed url and port that is the parameter of app.start() method to optional parameter. Then, you can use app.start() without parameter, and you can use parameter port and url ignoring robyn.env.

    opened by kimhyun5u 10
  • not working on mac/windows

    not working on mac/windows

    i tried on all 3 platforms with/without venv. only seems to work on linux.

    mac error: ...robyntest/venv/lib/python3.10/site-packages/robyn/init.py", line 9, in from .robyn import Server, SocketHeld ModuleNotFoundError: No module named 'robyn.robyn'

    one difference i noticed is the linux one has a .so file where the mac does not. neither does the windows but that error is

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'builtins.SocketHeld' object

    .........testrobyn>Traceback (most recent call last): File "", line 1, in ......\venv\lib\site-packages\multiprocess\spawn.py", line 102, in spawn_main source_process = _winapi.OpenProcess( OSError: [WinError 87] The parameter is incorrect

    opened by byteface 10
  • [Feature Request] Allow support for multiple file types

    [Feature Request] Allow support for multiple file types

    Current Behavior

    Images are partially supported right now. Add support with other types as bytes, strings, etc.

    https://github.com/sansyrox/robyn/issues/343

    Desired Behavior

    Add support with other types as bytes, strings, etc.


    Screenshots / Mockups

    Alternatives


    opened by sansyrox 0
  • [Feature Request] Improve the release and testing pipeline

    [Feature Request] Improve the release and testing pipeline

    Current Behavior

    Desired Behavior

    • Remove the testing pipeline as we can't expose keys on github.
    • Build on every merge to main and try to get the builds from somewhere to test.
      • I need to have access to a windows machine, Linux machine and a mac

    Approach 2

    ~- Investigate if we can release based on labels, something like label ops.~

    I would need a windows machine anyway. So will make things more complicated without reason.


    Screenshots / Mockups

    Alternatives


    opened by sansyrox 0
  • [BUG] Get Stared failed on Windows

    [BUG] Get Stared failed on Windows

    In order to try to solve the problem #339 of the render_template, I wanted to make a fresh install on my windows laptop.

    I installed Python 3.10.9, Robyn and Jinja2, then I copy/pasted the Get Started code from the doc and when I launch it I get this error :

    image

    main.py

    from robyn import Robyn
    
    app = Robyn(__file__)
    
    @app.get("/")
    async def h(request): # request is an optional parameter
        return "Hello, world!"
    
    app.start(port=5000, url="0.0.0.0")
    

    I launch program with :

    python app.py
    

    My package version :

    image

    And my structure project got only app.py file

    Robyn work on windows ? or is it another problem ?

    I apologize for bothering you with these problems but I really want to use this great framework for my projects.

    opened by Paroxyste 1
  • [BUG] Render Template

    [BUG] Render Template

    Hello to all,

    I have installed Robyn, via pip under python 3.10.6 on Mac M1. I wanted to test the render_template but I have a problem. I copied the code from the doc but it doesn't work.

    from robyn import Robyn
    from robyn.templating import JinjaTemplate
    from pathlib import Path
    import os
    
    current_file_path = Path(__file__).parent.resolve()
    JINJA_TEMPLATE = JinjaTemplate(os.path.join(current_file_path, "templates"))
    
    app = Robyn(__file__)
    
    @app.get("/template_render")
    def template_render():
        context = {
            "framework": "Robyn",
            "templating_engine": "Jinja2"
        }
    
        template = JINJA_TEMPLATE.render_template(template_name="test.html", **context)
        return template
    
    app.start(port=5000)
    
    {# templates/test.html #}
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>Results</title>
    </head>
    
    <body>
      <h1>{{framework}} ๐Ÿค {{templating_engine}}</h1>
    </body>
    </html>
    

    Jinja does a good job of replacing the values (framework, templating_engine) but the rendering prints the html code in the browser (i use Brave Browser) ...

    image

    Do you have any idea where this is coming from?

    Thanks

    opened by Paroxyste 17
  • [Feature Request] Refactor Robyn response to allow objects other than strings

    [Feature Request] Refactor Robyn response to allow objects other than strings

    Current Behavior

    Right now, everything must be a string but this should not be the case.

    Desired Behavior

    Allow responses apart from strings.


    Screenshots / Mockups

    Alternatives


    opened by sansyrox 1
Releases(v0.20.0)
  • v0.20.0(Dec 20, 2022)

    What's Changed

    • feat: add an auto benchmark script by @AntoineRR in https://github.com/sansyrox/robyn/pull/329
    • feat: allow non string types in response by @sansyrox in https://github.com/sansyrox/robyn/pull/337

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.19.2...v0.20.0

    Sample Usage

    @app.get("/request_headers")
    async def request_headers():
        return {
            "status_code": 200,
            "body": "This is a regular response",
            "type": "text",
            "headers": {"Header": "header_value"},
        }
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.19.2(Dec 14, 2022)

    What's Changed

    • fix: factorizing code by @AntoineRR in https://github.com/sansyrox/robyn/pull/322
    • fix: allow response headers and fix headers not working in const requests by @sansyrox in https://github.com/sansyrox/robyn/pull/331

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.19.1...v0.19.2

    Usage

    You can return headers like:

    @app.get("/redirect")
    async def redirect(request):
        return {
            "status_code": "200",
            "body": "test message",
            "type": "text",
            "headers": jsonify({"Header": "value"}),
        }
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.19.1(Dec 4, 2022)

    What's Changed

    • docs: fix blog link in website by @sansyrox in https://github.com/sansyrox/robyn/pull/309
    • docs: fix middleware section in examples by @sansyrox in https://github.com/sansyrox/robyn/pull/315
    • Router refactor by @AntoineRR in https://github.com/sansyrox/robyn/pull/307
    • Add Railway deployment process. by @carlosm27 in https://github.com/sansyrox/robyn/pull/316
    • docs: update hosting docs by @sansyrox in https://github.com/sansyrox/robyn/pull/319
    • Various improvements around the index method by @AntoineRR in https://github.com/sansyrox/robyn/pull/318

    New Contributors

    • @carlosm27 made their first contribution in https://github.com/sansyrox/robyn/pull/316

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.18.3...v0.19.1

    Installation:

    pip3 install "robyn[templating]"
    

    Usage: https://sansyrox.github.io/robyn/#/features?id=templates

    Source code(tar.gz)
    Source code(zip)
  • v0.18.3(Nov 11, 2022)

    What's Changed

    • fix: log level not working by @sansyrox in https://github.com/sansyrox/robyn/pull/303
    • add route type enum by @suhailmalik07 in https://github.com/sansyrox/robyn/pull/299

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.18.2...v0.18.3

    Thank you @Shending-Help for finding the issue! ๐Ÿ˜„

    Source code(tar.gz)
    Source code(zip)
  • v0.18.2(Nov 6, 2022)

    What's Changed

    • SocketHeld::new refactor by @Jamyw7g in https://github.com/sansyrox/robyn/pull/294
    • update rust packages to latest by @suhailmalik07 in https://github.com/sansyrox/robyn/pull/298
    • fix: retain metadata of the route functions by @sansyrox in https://github.com/sansyrox/robyn/pull/295
    • fix config of port and url by @kimhyun5u in https://github.com/sansyrox/robyn/pull/302

    New Contributors

    • @Jamyw7g made their first contribution in https://github.com/sansyrox/robyn/pull/294
    • @suhailmalik07 made their first contribution in https://github.com/sansyrox/robyn/pull/298
    • @kimhyun5u made their first contribution in https://github.com/sansyrox/robyn/pull/302

    PR Reviews

    Thanks @guilefoylegaurav for the PR reviews!

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.18.1...v0.18.2

    Source code(tar.gz)
    Source code(zip)
  • v0.18.1(Oct 24, 2022)

    What's Changed

    Fix

    • fix: enable hot reload on windows by @guilefoylegaurav in https://github.com/sansyrox/robyn/pull/290
    • Hotfix detecting robyn.env by @Shending-Help in https://github.com/sansyrox/robyn/pull/292

    Chore

    • fix: replaced match with if let by @Markaeus in https://github.com/sansyrox/robyn/pull/293

    New Contributors

    • @Markaeus made their first contribution in https://github.com/sansyrox/robyn/pull/293

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.18.0...v0.18.1

    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Nov 11, 2022)

    Sample usage

    Environment Variables

    There are some environment variables that Robyn looks out for. e.g. ROBYN_URL and ROBYN_PORT.

    You can have a robyn.env file to load them automatically in your environment.

    The server will check for the robyn.env file in the root of the project. If it is able to find one, it will parse the environment variables and set your environment.

    e.g. structure

    --project/
      --robyn.env
      --index.py
      ...
    

    Sample robyn.env

    ROBYN_PORT=5000
    ROBYN_URL=127.0.0.1
    

    What's Changed

    • fix: add proper kill process to conftest. #249 by @guilefoylegaurav in https://github.com/sansyrox/robyn/pull/278
    • Feature add support for env variables by @Shending-Help in https://github.com/sansyrox/robyn/pull/286
    • testing env support by @Shending-Help in https://github.com/sansyrox/robyn/pull/288

    New Contributors

    • @guilefoylegaurav made their first contribution in https://github.com/sansyrox/robyn/pull/278
    • @Shending-Help made their first contribution in https://github.com/sansyrox/robyn/pull/286

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.5...v0.18.0

    Source code(tar.gz)
    Source code(zip)
  • v0.17.5(Sep 14, 2022)

    What's Changed

    • Don't run sync functions in pool by @JackThomson2 in https://github.com/sansyrox/robyn/pull/282

    Special thanks to @JackThomson2 for the

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.4...v0.17.5

    Example comparison for 100000 requests

    โžœ  ~ oha http://127.0.0.1:5000 -n 100000 --no-tui
    Summary:
      Success rate:	1.0000
      Total:	0.5484 secs
      Slowest:	0.0319 secs
      Fastest:	0.0000 secs
      Average:	0.0003 secs
      Requests/sec:	182345.5041
    
      Total data:	1.14 MiB
      Size/request:	11 B
      Size/sec:	2.08 MiB
    
    Response time histogram:
      0.000 [1]     |
      0.003 [99147] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.006 [14]    |
      0.010 [9]     |
      0.013 [3]     |
      0.016 [180]   |
      0.019 [577]   |
      0.022 [56]    |
      0.026 [8]     |
      0.029 [4]     |
      0.032 [1]     |
    
    Latency distribution:
      10% in 0.0001 secs
      25% in 0.0001 secs
      50% in 0.0001 secs
      75% in 0.0001 secs
      90% in 0.0002 secs
      95% in 0.0003 secs
      99% in 0.0004 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0003 secs, 0.0001 secs, 0.0006 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs
    
    Status code distribution:
      [200] 100000 responses
    โžœ  ~ oha http://127.0.0.1:5000 -n 100000 --no-tui
    Summary:
      Success rate:	1.0000
      Total:	0.4062 secs
      Slowest:	0.0326 secs
      Fastest:	0.0000 secs
      Average:	0.0002 secs
      Requests/sec:	246178.0064
    
      Total data:	1.14 MiB
      Size/request:	11 B
      Size/sec:	2.81 MiB
    
    Response time histogram:
      0.000 [1]     |
      0.003 [99339] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.007 [25]    |
      0.010 [10]    |
      0.013 [5]     |
      0.016 [254]   |
      0.020 [232]   |
      0.023 [117]   |
      0.026 [2]     |
      0.029 [14]    |
      0.033 [1]     |
    
    Latency distribution:
      10% in 0.0000 secs
      25% in 0.0001 secs
      50% in 0.0001 secs
      75% in 0.0001 secs
      90% in 0.0002 secs
      95% in 0.0002 secs
      99% in 0.0003 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0002 secs, 0.0001 secs, 0.0005 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0002 secs
    
    Status code distribution:
      [200] 100000 responses
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.17.4(Aug 28, 2022)

    What's Changed

    • Father, forgive me, for I am adding inline types. by @sansyrox in https://github.com/sansyrox/robyn/pull/266

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.3...v0.17.4

    Source code(tar.gz)
    Source code(zip)
  • v0.17.3(Aug 17, 2022)

    What's Changed

    • fix: parse int status code to str by @hougesen in https://github.com/sansyrox/robyn/pull/264

    New Contributors

    • @hougesen made their first contribution in https://github.com/sansyrox/robyn/pull/264

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.2...v0.17.3

    Usage

    @app.get('/int_status_code')
    def return_int_status_code():
        return {"status_code": 202, "body": "hello", "type": "text"}
    
    Source code(tar.gz)
    Source code(zip)
  • v0.17.2(Aug 11, 2022)

    This release removes multiprocessing from windows. This was a hard decision to take but since TCP sockets are not serialisable on non Unix machines, it only made sense.

    Since slow Robyn is better than a defunkt Robyn :)

    What's Changed

    • chore(ci): move pytest from CircleCi to Github Actions by @AntoineRR in https://github.com/sansyrox/robyn/pull/241
    • Fix typo in README by @bartbroere in https://github.com/sansyrox/robyn/pull/246
    • ci: add github actions to publish every PR on test pypi by @sansyrox in https://github.com/sansyrox/robyn/pull/259
    • ci: enable fail fast for faster response time in the pipelines by @sansyrox in https://github.com/sansyrox/robyn/pull/260
    • Windows fix by @sansyrox in https://github.com/sansyrox/robyn/pull/261

    New Contributors

    • @bartbroere made their first contribution in https://github.com/sansyrox/robyn/pull/246

    Special thanks to all the contributors :D

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.1...v0.17.2

    Source code(tar.gz)
    Source code(zip)
  • v0.17.1(Jul 20, 2022)

    What's Changed

    • CHANGELOG.md: Fix typo by @cclauss in https://github.com/sansyrox/robyn/pull/228
    • OrbUp: Upgrade the CircleCI Orbs by @cclauss in https://github.com/sansyrox/robyn/pull/229
    • fix external project link in README by @touilleMan in https://github.com/sansyrox/robyn/pull/234
    • Upgrade GitHub Actions and add Python 3.10 by @cclauss in https://github.com/sansyrox/robyn/pull/230
    • Contributors added in Readme by @orvil1026 in https://github.com/sansyrox/robyn/pull/235
    • Add Rust CI by @AntoineRR in https://github.com/sansyrox/robyn/pull/237
    • fix: fix request headers not being propagated by @sansyrox in https://github.com/sansyrox/robyn/pull/232

    New Contributors

    • @cclauss made their first contribution in https://github.com/sansyrox/robyn/pull/228
    • @touilleMan made their first contribution in https://github.com/sansyrox/robyn/pull/234
    • @orvil1026 made their first contribution in https://github.com/sansyrox/robyn/pull/235
    • @AntoineRR made their first contribution in https://github.com/sansyrox/robyn/pull/237

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.17.0...v0.17.1

    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Jul 6, 2022)

    This feature improves the performance substantially when you want to serve constant responses like simple strings, simple JSON payloads, etc.

    Benchmark Source: https://github.com/sansyrox/robyn-comparrison-benchmarks

    What's Changed

    • Add a const router by @sansyrox in https://github.com/sansyrox/robyn/pull/210

    New Syntax

    @app.get("/", const=True) # see the 'const' flag here
    async def h(_):
        return "Hello, world!"
    

    Performance upgrade

    Robyn (6 workers)

    โžœ  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5000
    Summary:
      Success rate:	1.0000
      Total:	1.9902 secs
      Slowest:	0.0477 secs
      Fastest:	0.0000 secs
      Average:	0.0002 secs
      Requests/sec:	502470.8499
    
      Total data:	12.40 MiB
      Size/request:	13 B
      Size/sec:	6.23 MiB
    
    Response time histogram:
      0.000 [2608]   |
      0.000 [85802]  |โ– โ– โ– โ– โ– โ– 
      0.000 [320394] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.000 [456025] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.000 [88243]  |โ– โ– โ– โ– โ– โ– 
      0.000 [13397]  |
      0.000 [6279]   |
      0.000 [4146]   |
      0.000 [2887]   |
      0.001 [2356]   |
      0.001 [17863]  |โ– 
    
    Latency distribution:
      10% in 0.0001 secs
      25% in 0.0002 secs
      50% in 0.0002 secs
      75% in 0.0002 secs
      90% in 0.0002 secs
      95% in 0.0003 secs
      99% in 0.0008 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0052 secs, 0.0001 secs, 0.0196 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs
    
    Status code distribution:
      [200] 1000000 responses
    

    FastAPI

    โžœ  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5001
    Summary:
      Success rate:	1.0000
      Total:	12.2921 secs
      Slowest:	0.0471 secs
      Fastest:	0.0001 secs
      Average:	0.0012 secs
      Requests/sec:	81353.0018
    
      Total data:	12.40 MiB
      Size/request:	13 B
      Size/sec:	1.01 MiB
    
    Response time histogram:
      0.000 [127872] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [178274] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [199031] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [204123] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.002 [126955] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.002 [80915]  |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.002 [33556]  |โ– โ– โ– โ– โ– 
      0.003 [11592]  |โ– 
      0.003 [5180]   |
      0.003 [3270]   |
      0.004 [29232]  |โ– โ– โ– โ– 
    
    Latency distribution:
      10% in 0.0004 secs
      25% in 0.0007 secs
      50% in 0.0011 secs
      75% in 0.0015 secs
      90% in 0.0020 secs
      95% in 0.0024 secs
      99% in 0.0058 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0113 secs, 0.0001 secs, 0.0451 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0001 secs
    
    Status code distribution:
      [200] 1000000 responses
    

    Starlette (24 workers)

    โžœ  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5003
    Summary:
      Success rate:	1.0000
      Total:	9.8807 secs
      Slowest:	0.0534 secs
      Fastest:	0.0001 secs
      Average:	0.0010 secs
      Requests/sec:	101207.5486
    
      Total data:	12.40 MiB
      Size/request:	13 B
      Size/sec:	1.25 MiB
    
    Response time histogram:
      0.000 [128086] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [206731] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [211417] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [174363] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.001 [120210] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.002 [69490]  |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.002 [32373]  |โ– โ– โ– โ– 
      0.002 [13678]  |โ– โ– 
      0.002 [6528]   |
      0.003 [4052]   |
      0.003 [33072]  |โ– โ– โ– โ– โ– 
    
    Latency distribution:
      10% in 0.0003 secs
      25% in 0.0005 secs
      50% in 0.0008 secs
      75% in 0.0012 secs
      90% in 0.0016 secs
      95% in 0.0020 secs
      99% in 0.0053 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0368 secs, 0.0077 secs, 0.0520 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0001 secs
    
    Status code distribution:
      [200] 1000000 responses
    

    Flask (Bjoern)

    โžœ  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5000
    Summary:
      Success rate:	1.0000
      Total:	113.6806 secs
      Slowest:	0.1515 secs
      Fastest:	0.0021 secs
      Average:	0.0114 secs
      Requests/sec:	8796.5722
    
      Total data:	12.40 MiB
      Size/request:	13 B
      Size/sec:	111.67 KiB
    
    Response time histogram:
      0.005 [68]     |
      0.008 [246]    |
      0.011 [417517] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.014 [558015] |โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– 
      0.017 [16685]  |
      0.020 [2962]   |
      0.022 [2796]   |
      0.025 [1357]   |
      0.028 [86]     |
      0.031 [187]    |
      0.034 [81]     |
    
    Latency distribution:
      10% in 0.0099 secs
      25% in 0.0102 secs
      50% in 0.0112 secs
      75% in 0.0123 secs
      90% in 0.0129 secs
      95% in 0.0133 secs
      99% in 0.0157 secs
    
    Details (average, fastest, slowest):
      DNS+dialup:	0.0352 secs, 0.0001 secs, 0.0509 secs
      DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs
    
    Status code distribution:
      [200] 1000000 responses
    

    System Config

        eeeee  eeeeeeeeeeee   eeeee       OS: elementary OS 6.1 Jรณlnir x86_64
      eeee   eeeee       eee     eeee     Kernel: 5.13.0-51-generic
     eeee   eeee          eee     eeee    Uptime: 12 hours, 28 mins
    eee    eee            eee       eee   Packages: 2369 (dpkg), 11 (flatpak), 12 (snap)
    eee   eee            eee        eee   Shell: zsh 5.8
    ee    eee           eeee       eeee   Resolution: 3840x2160, 2160x3840
    ee    eee         eeeee      eeeeee   DE: Pantheon
    ee    eee       eeeee      eeeee ee   WM: Mutter(Gala)
    eee   eeee   eeeeee      eeeee  eee   Theme: io.elementary.stylesheet.blueberry [GTK3]
    eee    eeeeeeeeee     eeeeee    eee   Icons: elementary [GTK3]
     eeeeeeeeeeeeeeeeeeeeeeee    eeeee    Terminal: alacritty
      eeeeeeee eeeeeeeeeeee      eeee     Terminal Font: DankMono Nerd Font
        eeeee                 eeeee       CPU: AMD Ryzen 9 5900X (24) @ 4.000GHz
          eeeeeee         eeeeeee         GPU: NVIDIA 09:00.0 NVIDIA Corporation Device 2489
             eeeeeeeeeeeeeeeee            Memory: 6090MiB / 64214MiB
    
    
    
    

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.16.6...v0.17.0

    Source code(tar.gz)
    Source code(zip)
  • v0.16.6(Jul 2, 2022)

    What's Changed

    • Isort imports by @sansyrox in https://github.com/sansyrox/robyn/pull/205
    • feat: add commitizen as a dev dependency by @sansyrox in https://github.com/sansyrox/robyn/pull/216
    • fix: Fixes the crashing dev mode by @sansyrox in https://github.com/sansyrox/robyn/pull/218

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.16.4...v0.16.6

    Source code(tar.gz)
    Source code(zip)
  • v0.16.4(May 31, 2022)

    What's Changed

    • Adds pre-commit hooks for black, flake8, isort by @chrismoradi in https://github.com/sansyrox/robyn/pull/198
    • Removing unwraps by @sansyrox in https://github.com/sansyrox/robyn/pull/195
    • Add bridged logger. Improves performance substantially. by @sansyrox in https://github.com/sansyrox/robyn/pull/201

    New Contributors

    • @chrismoradi made their first contribution in https://github.com/sansyrox/robyn/pull/198

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.16.3...v0.16.4

    Source code(tar.gz)
    Source code(zip)
  • v0.16.3(May 18, 2022)

    What's Changed

    • Resolves port open issue when app is killed #183 by @anandtripathi5 in https://github.com/sansyrox/robyn/pull/196
    • Add more python type stubs: https://github.com/sansyrox/robyn/commit/c3fdc34fbfb9738f481258693cfa99516d51f417

    New Contributors

    • @anandtripathi5 made their first contribution in https://github.com/sansyrox/robyn/pull/196

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.16.2...v0.16.3

    Now you can easily turn off Robyn by pressing Ctrl+C without having dangling processes.

    Source code(tar.gz)
    Source code(zip)
  • v0.16.2(May 9, 2022)

    If types is what the community shall ask for. Then types is what the community shall get! โœจ

    What's Changed

    • Setup types for Robyn by @sansyrox in https://github.com/sansyrox/robyn/pull/192

    Special Thanks

    • @Kludex @RobertCraigie for reviewing the PRs.
    • @RobertCraigie for suggesting the prisma integration.

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.16.0...v0.16.2

    Source code(tar.gz)
    Source code(zip)
  • v0.16.0(Apr 29, 2022)

    What's Changed

    • Code cleanup by @sansyrox in https://github.com/sansyrox/robyn/pull/178
    • Implement Response headers by @sansyrox in https://github.com/sansyrox/robyn/pull/179
    • Add experimental io-uring by @sansyrox in https://github.com/sansyrox/robyn/pull/184
    • Remove hashmap clones by @sansyrox in https://github.com/sansyrox/robyn/pull/187

    New Contributors

    • @sombralibre made their first contribution in https://github.com/sansyrox/robyn/pull/189

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.15.1...v0.16.0

    You can now have the response headers:

    @app.get("/redirect")
    async def redirect(request):
        return {"status_code": "307", "body": "", "type": "text", "headers": jsonify({"Location": "redirect_route"})}
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.15.1(Mar 24, 2022)

    What's Changed

    • Update README.md by @Polokghosh53 in https://github.com/sansyrox/robyn/pull/168
    • Use Clippy tool optimized code by @mrxiaozhuox in https://github.com/sansyrox/robyn/pull/171
    • Make websocket id accessible by @sansyrox in https://github.com/sansyrox/robyn/pull/173

    New Contributors

    • @Polokghosh53 made their first contribution in https://github.com/sansyrox/robyn/pull/168
    • @mrxiaozhuox made their first contribution in https://github.com/sansyrox/robyn/pull/171

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.15.0...v0.15.1

    Now, you can access web socket uuids from the functional calls

    @websocket.on("message")
    async def connect(websocket_id):
        print(websocket_id)
        global i
        i += 1
        if i == 0:
            return "Whaaat??"
        elif i == 1:
            return "Whooo??"
        elif i == 2:
            i = -1
            return "*chika* *chika* Slim Shady."
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.15.0(Mar 17, 2022)

    Now you can mutate the request object through the request callback.

    Example below

    
    @app.get("/redirect")
    async def redirect(request):
        return {"status_code": "307", "body": "", "type": "text"}
    
    
    @app.get("/redirect_route")
    async def redirect_route(request):
        return "This is the redirected route"
    
    
    @app.before_request("/redirect")
    async def redirect_before_request(request):
        request["headers"]["Location"] = "redirect_route"
        return ""
    
    
    @app.after_request("/redirect")
    async def redirect_after_request(request):
        request["headers"]["Location"] = "redirect_route"
        return ""
    
    
    
    Source code(tar.gz)
    Source code(zip)
  • v0.14.0(Mar 3, 2022)

    Robyn supports custom response objects now! ๐Ÿฅณ

    What's Changed

    • Implement Custom Response objects. by @sansyrox in https://github.com/sansyrox/robyn/pull/165

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.13.1...v0.14.0

    Example

    @app.get("/")
    async def hello(request):
        global callCount
        callCount += 1
        message = "Called " + str(callCount) + " times"
        print(message, request)
        return {"status_code": "200", "body": "hello", "type": "text"}
    
    
    @app.get('/404')
    def return_404():
        return {"status_code": "404", "body": "hello", "type": "text"}
    
    Source code(tar.gz)
    Source code(zip)
  • v0.13.1(Feb 20, 2022)

    No major functional changes. Only support changes.

    You can use conda for installations:

    conda install -c conda-forge robyn
    

    What's Changed

    • Remove deprecated endpoints by @sansyrox in https://github.com/sansyrox/robyn/pull/162

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.13.0...v0.13.1

    Source code(tar.gz)
    Source code(zip)
  • v0.13.0(Feb 15, 2022)

    Robyn now supports middlewares!!

    Sample Usage

    You can use both sync and async functions for middlewares!

    @app.before_request("/")
    async def hello_before_request(request):
        print(request)
    
    
    @app.after_request("/")
    def hello_after_request(request):
        print(request)
    

    What's Changed

    • Add middlewares by @sansyrox in https://github.com/sansyrox/robyn/pull/157

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.12.1...v0.13.0

    Source code(tar.gz)
    Source code(zip)
  • v0.12.1(Feb 13, 2022)

    What's Changed

    • Remove arc(ing) by @sansyrox in https://github.com/sansyrox/robyn/pull/156
    • Fix: default url param in app.start by @sansyrox in https://github.com/sansyrox/robyn/pull/160

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.12.0...v0.12.1

    There was an error in the previous release that the app.start() function was defaulting to 128.0.0.1 instead of 127.0.0.1. This PR fixes it.

    This release fixes it.

    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Jan 20, 2022)

    Robyn now supports startup and shutdown events and is now backed with a more stable build backend.

    Sample Usage

    You can either use the decorator syntax or the functional call syntax to organise your code.

    async def startup_handler():
        logger.log(logging.INFO, "Starting up")
    app.startup_handler(startup_handler)
    
    @app.shutdown_handler
    def shutdown_handler():
        logger.log(logging.INFO, "Shutting down")
    
    

    What's Changed

    • Remove poetry by @sansyrox in https://github.com/sansyrox/robyn/pull/152
    • Add Event handlers by @sansyrox in https://github.com/sansyrox/robyn/pull/154

    Special Thanks

    • @klaa97 for making robyn's PR at TechEmpoweredBenchmark's repo!

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.11.1...v0.12.0

    Source code(tar.gz)
    Source code(zip)
  • v0.11.1(Jan 11, 2022)

    This is a minor release. An input statement was being used instead of a print statement. This will help with docker containers and also Tech-Empowered benchmarking.

    What's Changed

    • Use print instead of input after starting server by @klaa97 in https://github.com/sansyrox/robyn/pull/149

    New Contributors

    • @klaa97 made their first contribution in https://github.com/sansyrox/robyn/pull/149

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.11.0...v0.11.1

    Special thanks to @klaa97 for identifying the bug and fixing it! ๐Ÿฅณ

    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Jan 7, 2022)

    What's Changed

    • Add project-wide flake8 settings by @sansyrox in https://github.com/sansyrox/robyn/pull/143
    • URL queries by @patchgamestudio in https://github.com/sansyrox/robyn/pull/146
    • Fix dev server by @sansyrox in https://github.com/sansyrox/robyn/pull/148

    New Contributors

    • @patchgamestudio made their first contribution in https://github.com/sansyrox/robyn/pull/146

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.10.0...v0.11.0

    Summary

    You can make a request to http://localhost:5000/query?a=b and can access the params in the following way:

    @app.get("/query")
    async def query_get(request):
        query_data = request["queries"]
        return jsonify(query_data)
    

    The hot reloading server is now fixed and works on Linux and OSX(i.e. on all important operating systems). Windows support for dev server is still WIP.

    Special thanks to @patchgamestudio for their contribution with the query params ๐Ÿฅณ

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Dec 20, 2021)

    The latest version of Robyn supports async functions in WebSockets now!

    Usage

    @websocket.on("message")
    async def connect():
        global i
        i+=1
        if i==0:
            return "Whaaat??"
        elif i==1:
            return "Whooo??"
        elif i==2:
            return "*chika* *chika* Slim Shady."
        elif i==3:
            i= -1
            return ""
    
    @websocket.on("close")
    async def close():
        return "Goodbye world, from ws"
    
    @websocket.on("connect")
    async def message():
        return "Hello world, from ws"
    

    Important Note:

    Async functions execute out of order. i.e. They do not block the actor in order to provide concurrent execution. However, if the order is essential for you while using async functions, try using sync functions for now or wait for a future release :D

    What's Changed

    • FIX : Wrong link for Test Drive by @shivaylamba in https://github.com/sansyrox/robyn/pull/117
    • [FEAT] Open Source Contribution Templates by @shivaylamba in https://github.com/sansyrox/robyn/pull/118
    • Release v0.9.0 Changelog by @sansyrox in https://github.com/sansyrox/robyn/pull/121
    • Fix readme documentation by @sansyrox in https://github.com/sansyrox/robyn/pull/122
    • Update comparison.md by @Kludex in https://github.com/sansyrox/robyn/pull/123
    • Update comparison.md by @Kludex in https://github.com/sansyrox/robyn/pull/124
    • Apply Python highlight on api.md by @Kludex in https://github.com/sansyrox/robyn/pull/126
    • Add help messages and simplify 'dev' option by @Kludex in https://github.com/sansyrox/robyn/pull/128
    • Add async support in WS by @sansyrox in https://github.com/sansyrox/robyn/pull/134

    New Contributors

    • @shivaylamba made their first contribution in https://github.com/sansyrox/robyn/pull/117
    • @Kludex made their first contribution in https://github.com/sansyrox/robyn/pull/123

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.9.0...v0.10.0

    Thanks

    Thanks to @Kludex @awestlake87 @ShadowJonathan @shivaylamba @messense for their help(Issues/PRs) with this release. ๐Ÿ˜„

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Dec 3, 2021)

    Websocket Intergration

    PR Links

    • Web socket integration attempt 2 by @sansyrox in https://github.com/sansyrox/robyn/pull/109

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.8.0...v0.9.0

    Robyn supports WebSockets now.

    from robyn import Robyn, WS
    
    app = Robyn(__file__)
    websocket = WS(app, "/web_socket")
    i = -1
    
    @websocket.on("message")
    def connect():
        global i
        i+=1
        if i==0:
            return "Whaaat??"
        elif i==1:
            return "Whooo??"
        elif i==2:
            i = -1
            return "*chika* *chika* Slim Shady."
            
    @websocket.on("close")
    def close():
        print("Hello world")
        return "Hello world, from ws"
    
    @websocket.on("connect")
    def message():
        print("Hello world")
        return "Hello world, from ws"
            
    

    You can have 3 methods for every web socket:

    "message", "close" and "connect" for responding to the message received, connection closed and connection initiated.

    Source code(tar.gz)
    Source code(zip)
  • v0.8.1(Nov 17, 2021)

    What's Changed

    • Fix default url bug by @sansyrox in https://github.com/sansyrox/robyn/pull/111

    Full Changelog: https://github.com/sansyrox/robyn/compare/v0.8.0...v0.8.1

    app.start(url='127.0.0.1') no longer defaults to 0.0.0.0 and the defaults are also set to their original value.

    Source code(tar.gz)
    Source code(zip)
Owner
Sanskar Jethi
Code Monkey. Sport Flunky. Music Junkie. | Creator of Robyn!
Sanskar Jethi
Robyn is an async Python backend server with a runtime written in Rust, btw.

Robyn is an async Python backend server with a runtime written in Rust, btw. Python server running on top of of Rust Async RunTime. Installation

Sanskar Jethi 1.8k Dec 30, 2022
Radically simplified static file serving for Python web apps

WhiteNoise Radically simplified static file serving for Python web apps With a couple of lines of config WhiteNoise allows your web app to serve its o

Dave Evans 2.1k Jan 08, 2023
No longer maintained, please migrate to model_bakery

Model Mommy: Smart fixtures for better tests IMPORTANT: Model Mommy is no longer maintained and was replaced by Model Bakery. Please, consider migrati

Bernardo Fontes 917 Oct 04, 2022
A mocking library for requests

httmock A mocking library for requests for Python 2.7 and 3.4+. Installation pip install httmock Or, if you are a Gentoo user: emerge dev-python/httm

Patryk Zawadzki 452 Dec 28, 2022
A modern API testing tool for web applications built with Open API and GraphQL specifications.

Schemathesis Schemathesis is a modern API testing tool for web applications built with Open API and GraphQL specifications. It reads the application s

Schemathesis.io 1.6k Jan 04, 2023
Automatically mock your HTTP interactions to simplify and speed up testing

VCR.py ๐Ÿ“ผ This is a Python version of Ruby's VCR library. Source code https://github.com/kevin1024/vcrpy Documentation https://vcrpy.readthedocs.io/ R

Kevin McCarthy 2.3k Jan 01, 2023
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 871 Dec 25, 2022
Python HTTP Server

Python HTTP Server Preview Languange and Code Editor: How to run? Download the zip first. Open the http.py and wait 1-2 seconds. You will see __pycach

SonLyte 16 Oct 21, 2021
Official mirror of https://gitlab.com/pgjones/hypercorn https://pgjones.gitlab.io/hypercorn/

Hypercorn Hypercorn is an ASGI web server based on the sans-io hyper, h11, h2, and wsproto libraries and inspired by Gunicorn. Hypercorn supports HTTP

Phil Jones 432 Jan 08, 2023
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.

Mimesis - Fake Data Generator Description Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes

Isaak Uchakaev 3.8k Jan 01, 2023
gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.

Gunicorn Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn

Benoit Chesneau 8.7k Jan 01, 2023
A test fixtures replacement for Python

factory_boy factory_boy is a fixtures replacement based on thoughtbot's factory_bot. As a fixtures replacement tool, it aims to replace static, hard t

FactoryBoy project 3k Jan 05, 2023
ASGI specification and utilities

asgiref ASGI is a standard for Python asynchronous web apps and servers to communicate with each other, and positioned as an asynchronous successor to

Django 1.1k Dec 29, 2022
An HTTP server to easily download and upload files.

httpsweet An HTTP server to easily download and upload files. It was created with flexibility in mind, allowing be used in many different situations,

Eloy 17 Dec 23, 2022
A drop-in replacement for Django's runserver.

About A drop in replacement for Django's built-in runserver command. Features include: An extendable interface for handling things such as real-time l

David Cramer 1.3k Dec 15, 2022
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)

What's this This is a high performance python wsgi web server. And Meinheld is a WSGI compliant web server. (PEP333 and PEP3333 supported) You can als

Yutaka Matsubara 1.4k Jan 01, 2023
livereload server in python (MAINTAINERS NEEDED)

LiveReload Reload webpages on changes, without hitting refresh in your browser. Installation python-livereload is for web developers who know Python,

Hsiaoming Yang 977 Dec 14, 2022
Hypothesis is a powerful, flexible, and easy to use library for property-based testing.

Hypothesis Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation the

Hypothesis 6.4k Jan 01, 2023
Green is a clean, colorful, fast python test runner.

Green -- A clean, colorful, fast python test runner. Features Clean - Low redundancy in output. Result statistics for each test is vertically aligned.

Nathan Stocks 756 Dec 22, 2022
splinter - python test framework for web applications

splinter - python tool for testing web applications splinter is an open source tool for testing web applications using Python. It lets you automate br

Cobra Team 2.6k Dec 27, 2022