In this video, the author teaches you how to choose the right Python package for a given task, taking into account factors such as package license, longevity, and quality.
- [Instructor] The Python standard library is very powerful and it covers a lot of functionality sometimes redundantly. Even more power can be found in the vast landscape of third-party packages. Indeed, one of the strengths of Python is its very broad and skillful community of developers who have created many clever and useful pieces of software most of them available as open-source products. So, you should never take on a task that requires a significant coding without checking whether somebody else has already done the job and you can use their work.
However, you must be careful. If you're going to use code developed by others, you need to trust that it is correct and that its developers will be able to answer your questions and fix the problems that you may find. This is also true for packages in the standard library but just because they're standard many of those have a long history of development and have withstood a higher level of scrutiny. So, how can you judge the quality of a package? There is no substitute for experience and experimentation but there are certain external signs of reliability that you can watch for.
Does the package have a website that looks careful and professional? Is there documentation and is it readable? How is development supported? Is there a grant or a sponsor or is it purely a volunteer effort? Are there frequent updates and releases? Is there a bug tracking system? Is the version number greater than one? Lower numbers usually signal that the programming interface is still unstable. These are all good signs. The other questions that you need to ask are functional. On the basis of the tutorial for the package, if there is one, can you tell if the interface to the package is rational and comfortable? Is installation troublesome? Are there dependencies and are they reasonable? In this chapter, we're going to look at five major third-party packages which can help you download material from the web, parse webpages, manipulate images, make many kinds of plots and build web applications.
I will emphasize the strengths and weaknesses of each package and also show you how they can fit together in building very powerful programs with little code of your own that's efficient.
- Designing efficient loops
- Exploiting Python collections
- Writing Pythonic code
- Choosing the best libraries for your tasks
- Downloading webpages with requests
- Parsing HTML with Beautiful Soup
- Manipulating images with Pillow
- Making videos and drawing on maps with matplotlib
- Serving webpages with Jinja2 and Flask
- Working with Python classes
- Taking advantage of functional techniques
- Profiling CPU and memory use
- Exploiting parallelism