7.5 Finding modules
Learning objectives
By the end of this section you should be able to
- Explain differences between the standard library and PyPI.
- Search python.org and pypi.org for modules of interest.
Built-in modules
The Python Standard Library is a collection of built-in functions and modules that support common programming tasks. Ex: The math module provides functions like sqrt and constants like pi. Python's official documentation includes a library reference and a module index for becoming familiar with the standard library.
For decades, Python has maintained a "batteries included" philosophy. This philosophy means that the standard library should come with everything most programmers need. In fact, the standard library includes over 200 built-in modules!
| Module | Description |
|---|---|
calendar | General calendar-related functions. |
datetime | Basic date and time types and functions. |
email | Generate and process email messages. |
math | Mathematical functions and constants. |
os | Interact with the operating system. |
random | Generate pseudo-random numbers. |
statistics | Mathematical statistics functions. |
sys | System-specific parameters and functions. |
turtle | Educational framework for simple graphics. |
zipfile | Read and write ZIP-format archive files. |
Third-party modules
The Python Package Index (PyPI), available at pypi.org, is the official third-party software library for Python. The abbreviation "PyPI" is pronounced like pie pea eye (in contrast to PyPy, a different project).
PyPI allows anyone to develop and share modules with the Python community. Module authors include individuals, large companies, and non-profit organizations. PyPI helps programmers install modules and receive updates.
Most software available on PyPI is free and open source. PyPI is supported by the Python Software Foundation and is maintained by an independent group of developers.
| Module | Description |
|---|---|
arrow | Convert and format dates, times, and timestamps. |
BeautifulSoup | Extract data from HTML and XML documents. |
bokeh | Interactive plots and applications in the browser. |
matplotlib | Static, animated, and interactive visualizations. |
moviepy | Video editing, compositing, and processing. |
nltk | Natural language toolkit for human languages. |
numpy | Fundamental package for numerical computing. |
pandas | Data analysis, time series, and statistics library. |
pillow | Image processing for jpg, png, and other formats. |
pytest | Full-featured testing tool and unit test framework. |
requests | Elegant HTTP library for connecting to web servers. |
scikit-learn | Simple, efficient tools for predictive data analysis. |
scipy | Fundamental algorithms for scientific computing. |
scrapy | Crawl websites and scrape data from web pages. |
tensorflow | End-to-end machine learning platform for everyone. |