days
1
6
hours
0
2
minutes
4
8
seconds
4
5
search
There's a viper in our garden

Vibora: A venomous Python client/server framework

python
© Shutterstock / Sergj  

What’s better than a gigantic reptilian? His venomous best friend! Wait…what? Vibora stands for viper in Portuguese and it’s an asynchronous client/server framework that aspires to be the fastest Python HTTP client/server framework!

Vibora, which means viper in Portuguese, is a fast, asynchronous and, as its creators call it, elegant Python 3.6+ HTTP client/server framework.

The framework was designed and created from scratch to be efficient and offer a great performance. Its APIs were inspired by Flask while its built-in features are based on numerous famous libraries like jinja2, marshmallow, websockets by aaugustin, werkzeug and more.

Why asynchronous? As the official website mentions, “web APIs are often IO based and that’s exactly where an async architecture shines”!

Vibora has been trending on GitHub and its benchmarks show that the framework is steadily gaining momentum.

Its goal? To be the fastest Python HTTP client/server framework and provide enjoyable and up to date development features.

SEE ALSO: Python sheds its skin for version 3.7

We have to mention, however, that Vibora is still far from finished. Although is already offers a list of appealing features, it is still at an early stage of development.

For now, let’s have a quick look at what we have so far:

Server features

  • Performance (benchmarks section speaks for itself.)
  • Schemas Engine.
  • Nested Blueprints / Domain Based Routes / Components
  • Connection Reaper / Self-Healing Workers
  • Sessions Engine
  • Streaming
  • Websockets
  • Caching tools
  • Async Template Engine (hot-reloading, deep inheritance)
  • Complete flow customization
  • Static Files (Smart Cache, Range, LastModified, ETags)
  • Testing Framework
  • Type hints, type hints, type hints everywhere.

Client features

  • Streaming MultipartForms (inspired by a reported issue)
  • Rate Limiting / Retries mechanisms
  • Websockets
  • Keep-Alive & Connection Pooling
  • Sessions with cookies persistence
  • Basic/digest Authentication
  • Transparent Content Decoding

If you are interested in a detailed overview of all of Vibora’s features and functions, make sure to check out the official documentation.

SEE ALSO: Top 5 IDEs and code editors for Python

Vibora is evolving rapidly and the features we can expect to see soon are:

  • Auto Reloading
  • HTTP2 Support
  • Brotli support (Server/Client)
  • Cython compiled templates
  • Cython compiled user-routes

Getting started

If you are eager to try Vibora, you can do so by following the steps below:

  1. Install Vibora with pip install vibora[fast]
  2. Create a file called anything.py with the following code:
    from vibora import Vibora, JsonResponse
    ​
    app = Vibora()
    ​
    ​
    @app.route('/')
    async def home():
        return JsonResponse({'hello': 'world'})
    ​
    if __name__ == '__main__':
        app.run(host="0.0.0.0", port=8000)
    
  3. Run the server: python3 anything.py
  4. Open your browser at http://127.0.0.1:8000

You have to keep in mind, however, that you will need a Python 3.6+ version since Vidora takes advantage of certain Python features.

Author
Eirini-Eleni Papadopoulou
Eirini-Eleni Papadopoulou is an assistant editor for JAXenter.com. Just finished her masters in Modern East Asian Studies and plans to continue with her old hobby that is computer science.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of