Embrace those APIs with this week’s GitHub project of the week: hug.
Hug allows you to create HTTP REST APIs on Python 3, and it consistently benchmarks among the top three performing Web frameworks for Python, beating out Flask and Django, according to its website. Hug is fraction of what is required in other frameworks, but it’s not just a Web API framework. It exposes correct and standard internal Python APIs externally, which allows developers and architects to define logic and structure once.
Developers can expose existing Python functions, APIs over HTTP and CLI in addition to standard Python. Hug’s team writes that in the future, more interfaces will be supported.
Hug has been built on performance, so it only consumes resources when necessary, making it a fast Python framework. Hug also makes it easy to expose multiple versions of an API by specifying what version or range of versions an endpoint supports, and then automatically having that enforced and communicated to an API’s users, according to its website.
Besides simplifying Python API development, here are a few of hug’s design objectives. As a result of these goals, hug is Python 3+ only and built upon Falcon’s high-performance HTTP library, according to its GitHub page:
- Make developing a Python-driven API as succinct as a written definition.
- The framework should encourage code that self-documents.
- It should be fast, and a developer shouldn’t feel the need to look somewhere else for performance reasons.
- Writing tests for APIs written on top of hug should be easy and intuitive.
- Magic done once, in an API framework, is better than pushing the problem set to the user of the API framework.
- Be the basis for next-generation Python APIs, embracing the latest technology.
Top 5 trending projects on GitHub this week
#1. TensorFlow Models: Machine learning models implemented in TensorFlow.
#2. FreeCodeCamp: *sighs* FreeCodeCamp refuses to give up its ever-trending spot.