Robyn

Robyn is a Super Fast Async Python Web Framework with a Rust runtime.

BSD-2-CLAUSE License

Downloads
114.2K
Stars
3.5K
Committers
69

Bot releases are visible (Hide)

Robyn - v0.52.3 - fix the export namespace for websockets

Published by sansyrox 7 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.52.1...v0.52.3

Robyn - v0.52.2 - Fix a typo in sqlalchemy and CI fixes

Published by sansyrox 7 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.52.0...v0.52.1

Robyn - v0.52.0 - Add sqlmodel in Robyn scaffolds!

Published by sansyrox 8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.51.3...v0.52.0

Robyn - v0.51.3 - fix Dockerfile in robyn scaffolds

Published by sansyrox 8 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.51.2...v0.51.3

Robyn - v0.51.2 - implement [] sets and gets in headers

Published by sansyrox 9 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.51.1...v0.51.2

Robyn - v0.51.1 - fix --dev reloading bug

Published by sansyrox 9 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.51.0...v0.51.1

Robyn - v0.51.0 - add a way to serve html strings

Published by sansyrox 10 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.50.0...v0.51.0

Robyn - v0.50.0 - add direct rust imports!

Published by sansyrox 10 months ago

Robyn - v0.49.3 - fix cli invocation

Published by sansyrox 10 months ago

What's Changed

Sample Usage

  • robyn --version works now. No need for python -m robyn --version

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.49.0...v0.49.3

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.48.0...v0.49.0

Now, --dev mode only works as a module command, e.g. python -m robyn --dev

We had to make --dev command as a module only command to add support for file deletion. Deletion of files would break the module imports otherwise.

Robyn - v0.48.0 - add dependency injections

Published by sansyrox 11 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.47.0...v0.48.0

Sample Usage

https://robyn.tech/documentation/api_reference/dependency_injection

What's Changed

New headers object

class Headers:
    def __init__(self, default_headers: Optional[dict]) -> None:
        pass

    def set(self, key: str, value: str) -> None:
        """
        Sets the value of the header with the given key.
        If the key already exists, the value will be appended to the list of values.

        Args:
            key (str): The key of the header
            value (str): The value of the header
        """
        pass

    def get(self, key: str) -> Optional[str]:
        """
        Gets the last value of the header with the given key.

        Args:
            key (str): The key of the header
        """
        pass

    def populate_from_dict(self, headers: dict[str, str]) -> None:
        """
        Populates the headers from a dictionary.

        Args:
            headers (dict[str, str]): The dictionary of headers
        """
        pass

    def contains(self, key: str) -> bool:
        """
        Returns:
            True if the headers contain the key, False otherwise

        Args:
            key (str): The key of the header
        """
        pass

    def is_empty(self) -> bool:
        pass

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.46.0...v0.47.0

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.45.0...v0.46.0

Robyn - v0.45.0 - Create Robyn App on steroids!

Published by sansyrox 12 months ago

What's Changed

Doc Updates

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.44.2...v0.45.0

Sample Usage

python3 -m robyn --create                                                                                                         
? Directory Path: .
? Need Docker? (Y/N) Y
? Please select project type (Mongo/Postgres/Sqlalchemy/Prisma):  Postgres
Creating a new Robyn project '/Users/sanskar/test_dumpster/robyn-new'...
New Robyn project created in '/Users/sanskar/test_dumpster/robyn-new'
Robyn - v0.44.2 - support Python 3.12 and minor fixes in main cli

Published by sansyrox 12 months ago

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.44.1...v0.44.2

Robyn - v0.44.1 - fix import-error in --create robyn app and other fixes

Published by sansyrox 12 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.44.0...v0.44.1

What's Changed

@websocket.on("message")
async def message(ws: WebSocketConnector, msg: str) -> str:
    global websocket_state
    websocket_id = ws.id
    state = websocket_state[websocket_id]
    resp = ""
    if state == 0:
        resp = "Whaaat??"
        await ws.async_broadcast("This is a broadcast message")
        ws.sync_send_to(websocket_id, "This is a message to self")
    elif state == 1:
        resp = "Whooo??"
    elif state == 2:
        resp = "*chika* *chika* Slim Shady."
    websocket_state[websocket_id] = (state + 1) % 3

    return resp

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.43.0...v0.44.0

What's Changed

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.42.2...v0.43.0

What's Changed

New Contributors

Full Changelog: https://github.com/sparckles/Robyn/compare/v0.42.0...v0.42.1