2020 has passed. Troy Labs, a foreign website that specializes in providing Python services, has listed the Top 10 Python libraries released in 2020.
On the list are the upgraded version of FastAPI Typer, Rich that turns the CLI into color, Dear PyGui based on the GUI framework, and PrettyErrors that streamlines error messages... There is always one you want.
Let’s take a look~
Recommended (free):Python Tutorial(Video)
1. Typer
Typer has the same principle as FastAPI. They are both high-performance frameworks used to build API services in Python.
It is an upgraded version of FastAPI, which not only accurately records code, but also enables easy CLI verification.
Typer is easy to learn and use, and does not require users to read complex tutorial documents to get started. Supports automatic code completion in editors (such as VSCode) to improve developers' development efficiency and reduce the number of bugs.
Secondly, Typer can also be used with the command line artifact Click, so you can take advantage of Click's advantages and plug-ins to achieve more complex functions.
Open source address:
https://github.com/tiangolo/t...
2, Rich
Who specifies CLI Does the interface have to be black and white? It can also be in color.
Rich API not only provides rich colored text and exquisite formatting in terminal output, but also provides exquisite tables, progress bars, editors, trackers, syntax highlighting, etc. As shown below.
It can also be installed on the Python REPL, and all data structures can be output or annotated beautifully.
All in all, it's colorful, beautiful, and powerful.
Rich compatibility is also good, suitable for Linux, Mac and Windows and other systems. True Colors/Emojis work with the new Windows Terminal.
But please note that Rich must have Python 3.6.1 or above.
Open source address:
https://github.com/willmcguga...
3.Dear PyGui
As shown above, Although terminal applications can be made to look very beautiful. However, you may also want a real GUI.
Dear PyGui is an easy-to-use, powerful Python GUI framework. But it is fundamentally different from other Python GUIs.
It uses the immediate mode paradigm and the computer's GPU to implement dynamic interfaces. The real-time mode paradigm is very popular in video games, which means that its dynamic GUI does not need to retain any data, but is drawn independently frame by frame. At the same time, it also uses GPU to build dynamic interfaces.
Dear PyGui can also draw, create themes, and create 2D games. It also has some gadgets, such as built-in documentation, logging, source code viewers, etc. These gadgets can assist in App development.
Systems that support it are: Windows 10 (DirectX 11), Linux (OpenGL 3) and macOS (Metal), etc.
Open source address:
https://github.com/hoffstadt/...
4. PrettyErrors
PrettyErrors is a streamlined Python error message tool, characterized by a very simple and friendly interface.
Its most significant function is to support color output in the terminal, mark out file stack traces, find error messages, filter out redundant information, extract key parts, and perform color annotation, thereby improving developers' efficiency.
And it can be directly imported into the project for use without installation, but some parameters need to be configured first. The import and configuration parameters are as follows:
Open source address:
https://github.com/onelivesle...
5, Diagrams
Programmers are here When programming, sometimes you need to explain to your colleagues the complex structural relationships between the program codes you designed. However, this cannot be explained clearly in one or two sentences. You need to draw a table or make a context diagram.
Generally, programmers use GUI tools to process charts and visualize manuscripts. But there are better ways, such as using the Diagrams library.
Diagrams allows you to draw the cloud system structure directly in Python code without any design tools. Their icons come from multiple cloud service providers, including AWS, Azure, GCP, etc.
Easily create arrow symbols and structure diagrams with just a few lines of code.
Since it uses Graphviz to render images, Graphviz needs to be installed first.
Open source address:
https://github.com/mingrammer...
6, Hydra and OmegaConf
is making machines When learning a project, you need to do a lot of environment configuration work. Therefore, in some complex applications, the configuration management work becomes correspondingly complicated.
Hydra makes configuration easy. It can overwrite parts from the command line or configuration files, eliminating the need to maintain similar configuration files and configuring them in a combined manner, thus speeding up the running of experiments.
#Hydra has strong compatibility, has a plug-in structure, and can be well integrated with the developer's operation files. Its plug-in can also publish code to AWS or other cloud systems directly through the command line.
Hydra is also inseparable from OmegaConf. The two are inseparable. OmegaConf provides a collaborative API for Hydra's hierarchical configuration system. The two work together to support YAML, configuration files, objects, CLI parameters, etc.
Open source address:
https://github.com/facebookre...
https://github.com/omry/omega...
7. PyTorch Lightning
PyTorch Lightning is also a research result of Facebook. It is a lightweight PyTorch wrapper for high-performance AI research. Its most important feature is the ability to parse PyTorch code, allowing the separation of code research components and engineering components.
Its extended model can run on any hardware (CPU, GPU, TPU) and is easily copied, removing a large number of file samples and maintaining its flexibility. Sexy and fast running speed.
Lightning can automate more than 40 parts of DL/ML research, such as GPU training, distributed GPU (cluster) training, TPU training, etc...
Because Lightning will be able to The file is automatically exported to ONNX or TorchScript, so it is suitable for AI researchers doing fast inference, BERT or self-supervised learning research teams, etc.
Open source address:
https://github.com/PyTorchLig...
8, Hummingbird
Hummingbird is a product of Microsoft Research results, it can assemble already trained ML models into tensor calculations, eliminating the need to design new models.
also allows users to use neural network frameworks such as PyTorch to accelerate traditional ML models.
Its inference API is very similar to the sklearn example, and existing code can be reused, but it is implemented using code generated by Hummingbird.
Hummingbird also provides a convenient unified inference API behind the Sklearn API. This makes it possible to interchange Sklearn models with those generated by Hummingbird without changing the inference code.
It is focused on because it can support a variety of models and formats.
So far, Hummingbird supports various ML models such as PyTorch, TorchScript, ONNX and TVM.
Open source address:
https://github.com/microsoft/...
9. HiPlot
Due to the change of ML model It is getting more and more complex, and there are many hyperparameters, so HiPlot needs to be used. HiPlot is a library released by Facebook in March this year, mainly used for processing high-dimensional data.
Facebook AI uses HiPlot to analyze deep neural networks through dozens of hyperparameters and more than 100,000 experiments.
It uses parallel graphs and other image methods to help AI researchers discover the correlation and models of high-dimensional data. It is a lightweight interactive visualization tool.
HiPlot has its own unique advantages compared with other visualization tools:
First of all, it is highly interactive because parallel plots are interactive , so it can meet image visualization in a variety of situations.
Secondly, it is simple and easy to use and can be used directly through IPython Notebook or through the service with the "hiplot" command.
It is also scalable. HiPlot's web service can parse CSV or JSON files by default, and can also be provided with a custom Python parser to convert experiments into HiPlot experiments.
Open source address:
https://github.com/facebookre...
Reference link:
https://ai.facebook.com/blog/...
10. Scalene
Scalene is a CPU and memory analyzer for Python scripts. It can correctly handle multi-threaded code and distinguish between Python code and native code. operation hours.
You don't need to modify the code, just run the Scalene script, and it will generate a text report showing the CPU and memory usage of each line of code. Through this text report, developers can improve the efficiency of their code.
#Scalene is fast and accurate, and can also mark lines of code that consume high energy.
Open source address
https://github.com/emeryberge...
In addition to the above 10, there are also many high-performance Python libraries named, such as Norfair, Quart, Alibi-detect, Einops...etc., see the link at the bottom for details.
So, have you found any useful Python libraries this year?
If you have any, please share them in the comment area~
The above is the detailed content of Summary of the most powerful Python libraries in 2020. For more information, please follow other related articles on the PHP Chinese website!