0% found this document useful (0 votes)
34 views

Latest Python Developments

The document discusses recent major developments in the Python ecosystem, including FastAPI, Pydantic, Polars, Streamlit, and Ray. FastAPI is highlighted as a high-performance framework for building APIs. Pydantic and Polars are data validation and dataframe libraries. Streamlit is designed for building machine learning web apps. Ray enables distributed and asynchronous execution.

Uploaded by

yenuguyash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Latest Python Developments

The document discusses recent major developments in the Python ecosystem, including FastAPI, Pydantic, Polars, Streamlit, and Ray. FastAPI is highlighted as a high-performance framework for building APIs. Pydantic and Polars are data validation and dataframe libraries. Streamlit is designed for building machine learning web apps. Ray enables distributed and asynchronous execution.

Uploaded by

yenuguyash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Python developments

This document contains the recent major developments in the python ecosystem

Python Backend Developments

FastAPI
https://fastapi.tiangolo.com/
FastAPI is a modern, fast (high-performance) web framework for building APIs with
Python 3.6+ based on standard Python type hints. It was created to be easy to use and
to provide high performance and productivity when building APIs.
FastAPI provides many features that make it easy to build APIs, including automatic
generation of API documentation with the OpenAPI standard, built-in support for async
and await, and easy integration with popular Python libraries like SQLAlchemy.
One of the key features of FastAPI is its performance. It is built on top of the Starlette
framework, which is a lightweight and high-performance framework for building
asynchronous applications in Python.
Overall, FastAPI is a great choice for developers who want to build high-performance
APIs with Python. Its ease of use, performance, and features make it a powerful tool for
building modern web applications.

Differences between FastAPI and Flask


FastAPI and Flask are both popular web frameworks for building web applications with
Python. However, there are some key differences between the two frameworks.
One of the main differences is that FastAPI is designed to be a high-performance
framework, while Flask is more focused on simplicity and ease of use. FastAPI is built
on top of the Starlette framework, which is designed for high-performance

Python developments 1
asynchronous applications. Flask, on the other hand, is more focused on providing a
simple and flexible API for building web applications.
Another key difference between the two frameworks is the way they handle type
checking. FastAPI uses Python's type hints to automatically generate API
documentation and perform runtime type checking, which can help catch errors early in
the development process. Flask, on the other hand, does not provide built-in support for
type checking.
Overall, both FastAPI and Flask are powerful web frameworks for building web
applications with Python. The choice between the two will depend on the specific needs
of the project, with FastAPI being a good choice for high-performance applications and
Flask being a good choice for simple and flexible applications.

https://betterprogramming.pub/migrate-from-flask-to-fastapi-smoothly-cc4c6c255397

Advantages of FastAPI and Async IO in Python Backend


Development
The gaining popularity of backend systems being written in Node.js is due to it’s event
driven platform where concurrent requests can be handled asynchronously without
blocking. The usage of FastAPI and Async IO also give a similar experience and can be
used to migrate existing applications for more performance.
FastAPI and Async IO are two powerful tools for building high-performance backend
applications with Python. Some of the key advantages of using FastAPI and Async IO
include:

High Performance: FastAPI is designed to be a high-performance framework, with


built-in support for Async IO. This makes it a great choice for building applications
that require high-throughput and low latency.

Easy to Use: FastAPI is designed to be easy to use, with a simple and intuitive API
that makes it easy to get started. It also provides built-in support for Automatic API
documentation with OpenAPI and JSON Schema.

Type Checking: FastAPI uses Python's type hints to automatically generate API
documentation and perform runtime type checking, which can help catch errors

Python developments 2
early in the development process.

Scalability: Async IO is a powerful tool for building scalable backend applications,


as it enables applications to handle a large number of simultaneous connections
without blocking.

Overall, FastAPI and Async IO are powerful tools for building high-performance
backend applications with Python. Their ease of use, performance, and scalability make
them an excellent choice for modern web applications.

Pydantic
https://docs.pydantic.dev/latest/
Pydantic is the most widely used data validation library for Python. FastAPI is also
based on pydantic and can provide data validation while using the library.

Why use Pydantic?


Powered by type hints — with Pydantic, schema validation and serialization are
controlled by type annotations; less to learn, less code to write and integration with
your IDE and static analysis tools.

Speed — Pydantic's core validation logic is written in Rust, as a result Pydantic is


among the fastest data validation libraries for Python.

JSON Schema — Pydantic models can emit JSON Schema allowing for easy
integration with other tools.

Customisation — Pydantic allows custom validators and serializers to alter how


data is processed in many powerful ways.

Ecosystem — around 8,000 packages on PyPI use Pydantic, including massively


popular libraries like FastAPI, huggingface/transformers, Django Ninja, SQLModel,
and LangChain.

Dataframe Libraries

Python developments 3
Polars
https://www.pola.rs/

According to the Polars User Guide, its aim “is to provide a lightning-fast DataFrame
library that utilizes all available cores on your machine.”

Polars features both eager and lazy execution making it both flexible as well as
performant. Lazy execution can be used to optimize the performance by creating an
execution graph which is more optimized.
https://towardsdatascience.com/pandas-vs-polars-a-syntax-and-speed-comparison-
5aa54e27497e

Front-end Libraries
Streamlit
https://streamlit.io/

Streamlit is a free and open-source framework to rapidly build and share beautiful
machine learning and data science web apps. It is a Python-based library specifically
designed for machine learning engineers. Data scientists or machine learning engineers
are not web developers and they're not interested in spending weeks learning to use
these frameworks to build web apps. Instead, they want a tool that is easier to learn and
to use, as long as it can display data and collect needed parameters for modeling.
Streamlit allows you to create a stunning-looking application with only a few lines of
code.

Distributed Computing
Ray
https://www.ray.io/
With Ray, computing tasks can be easily expanded from the original single-machine
serial execution to distributed asynchronous execution. Ray's Remote API makes it

Python developments 4
possible to submit tasks to the computing cluster, dynamically split tasks into more fine-
grained computing tasks, execute them in parallel, and collect calculation results
asynchronously. Thanks to Ray's very simple and easy-to-use API, users only need to
make some fairly simple changes to refactor their code in a distributed manner.

Python developments 5

You might also like