Libraries
Libraries allow us to apply Python to real tasks. These are a few popular ones, but there are many.
Utilities
-
Specialized containers: counting items, grouping with defaults, named tuples, fast queues.
Countercounts[item]most_common()total()elements()update()subtract()+ - & |defaultdictdefault_factory.get()namedtupledefaults=_make()_asdict()_replace()_fields_field_defaultsdequeappend()appendleft()extend()extendleft()insert()pop()popleft()remove()clear()count()index()copy()rotate()reverse()maxlen=OrderedDictmove_to_end()popitem()== -
Calculating and formatting dates and times.
-
Random numbers, random picks, shuffled order.
Data analysis
-
Reading and writing spreadsheets.
-
Charts and plots: line, bar, and scatter, built directly from plain Python data.
-
Fast numeric arrays, with math applied to a whole array at once instead of item by item.
-
Tabular data: rows and columns, like a spreadsheet, built on top of NumPy.
APIs
-
Reading and writing JSON data: nested dicts and lists, saved to a file or a string.
-
Fetching data over the internet, like asking a website or API for information.
Image editing
-
Opening, editing, and saving images, built around one
Imageobject.Imageopening and saving imagesbasic operationsimage modesresizecroprotate and flipImageOpscommon ImageOps functionsImageColorconverting color namesImageEnhanceenhancing an imageImageChopscomparing and combining imagesconvert()converting between formats
Computer vision
-
Real-time image and video analysis, built directly on NumPy arrays: color spaces, edge detection, face detection.
reading, displaying, saving imagesimread()displaying a windowsaving a fileCascadeClassifierdetecting and labeling facesbasic operationsresize()croppingrotating
Desktop UIs
-
Creating desktop applications: text, buttons, dropdowns, forms, output, etc.
configure()reading and changing optionscommandcommand callbacksbinding events