Beyond built-in modules, you can install third-party packages maintained by communities or companies to extend Python.
pip and PyPI
pip is Python's common package installer. It normally downloads packages from the Python Package Index (PyPI) and installs them where the current Python interpreter can import them.
pip install emoji
pip show emoji
pip list
pip install --upgrade emoji
pip uninstall emojiThe most common installation form is pip install package-name. install installs, show inspects one package, list lists installed packages, --upgrade upgrades, and uninstall removes. An installation name and import name can differ; both are emoji here.
KNOWLEDGE QUIZ
A Simple, Visual Third-Party Package: emoji
emoji converts readable aliases into real Emoji characters. After installation, this example turns :thumbs_up: into 👍:
import emoji
message = emoji.emojize("Python is :thumbs_up:")
print(message)Output:
Python is 👍emojize() accepts a string and returns a new converted string, making the package's effect immediately visible.
KNOWLEDGE QUIZ