Utility libraries
Contents
1.5. Utility libraries#
1.5.1. Parallel execution with joblib#
Below is an example of how you can send a thousand HTTP requests in just 2.5 minutes with joblib👇
joblib enables you to fully utilize the cores in your CPU by writing parallel code for your large loops. As a result, you can execute a single function in multiple threads, without wasting time and idle resources.
The library accepts any picklable function, like functions for image resizing, web scraping, file operations, etc.
1.5.2. PReGex - human-readable RegEx#
Human-readable RegEx is finally here! Using the PReGex library, you don’t have to use a single RegEx character.
Below is an example Pregex pattern for matching an email, one of the most common RegEx operations.
Pregex exposes classes for almost all RegEx characters such as quantifiers, groups, operators, character classes, assertions, etc. Pregex stands for Programmable regex and rightly so, all its classes can be combined into more complex patterns using Python operators.
You can learn more about Pregex in an article written by Khuyen Tran and from the official docs in the first comment.
Article by Khuyen Tran: https://bit.ly/3S6Q6fh
Pregex docs: https://pregex.readthedocs.io/en/latest/