7 Awesome Python Libraries To Play With 🕺
Tags: programming, python, beginners, tutorial
Published: 2021-11-24 05:14:46

Hello, buddies! While playing with Python for a time, I found some quite interesting modules that are considered worthy of sharing with others. So today we're going to see 7 Interesting and Awesome Python libraries(modules;) that are useful too!

## 1. Pyperclip
This module was created to enable cross-platform copy-pasting in Python which was earlier absent. The pyperclip module has `copy()` and `paste()` functions that can send a text to and receive text from your computer’s clipboard. Sending the output of your program to the clipboard will make it easy to paste it on an email, word processor, or some other software 

**Install**
```python
pip install pyperclip
```

**Code**
```python
# Python program to
# demonstrate pyperclip module


# This will import pyperclip
import pyperclip
pyperclip.copy("Hello, buddies!")
pyperclip.paste()

pyperclip.copy("This is an interesting module!")
pyperclip.paste()
```
## 2. Emoji 😉
Emojis have become a way to express and to enhance simple boring texts. Now, the same gems can be used in Python programs too. Yes, really! You now have the ultimate power to use emojis in your code. For this, emoji module is needed to be installed.

**Install**
```python
pip install emoji
```
**Code**
```python
from emoji import emojize
print(emojize(":laptop:"))
```

Alternatively, `encode()` function can be used from emojis module to convert Unicode to emojis:

```python
import emojis
emojified = emojis.encode("There is a :snake: in my boot !")
print(emojified)
```
[Emoji Cheat sheet](https://www.webfx.com/tools/emoji-cheat-sheet/)

## 3. Wikipedia
Now import Wikipedia in Python using Wikipedia module. Use the incessant flow of knowledge with Python for daily needs.

**Install,**
```python
pip install wikipedia
```
**Code**
```python
import wikipedia
result = wikipedia.page("Python Programming Language")
print(result.summary)
```

## 4. Howdoi
Stuck on a coding problem? Wish to visit StackOverflow without leaving the terminal? With howdoi, you can do it!

**Install,**
```python
pip install howdoi
```
**Code,**
```python
howdoi make trees in Python
howdoi commit in git
```

Ask whatever question you have and it will try it’s best to answer it. From now, you don’t need to open those browsers for a quick search and get those hefty amounts of ads and distractions. Just `howdoi`!

## 5. Antigravity
The reason this module is here is because this is quite fun! It’s basically an Easter egg in Python 3 which is used in Google App Engines. It was added to Google App Engines just as a medium to amuse the users.

**Install**
```python
pip install antigravity
```

**Code,**
```python
import antigravity
```
See the magic! 

## 6. urllib

Urllib module is the URL handling module for python. It is used to fetch URLs (Uniform Resource Locators). It uses the urlopen function and is able to fetch URLs using a variety of different protocols.

Urllib is a package that collects several modules for working with URLs, such as:
- `urllib.request` for opening and reading.
- `urllib.robotparser` for parsing robot.txt files
- `urllib.parse` for parsing URLs
- `urllib.error` for the exceptions raised

**Install**
```python
pip install urllib
```
**Code**

```python
# This will import urlopen
# class from urllib module
from urllib.request import urlopen


page = urlopen("https://mr-unity-buddy.hashnode.dev/")
print(page.headers)
```
You can also see the coding of the website by using `read()` function:
```python
# This will import urlopen
# class from urllib module


from urllib.request import urlopen
page=urlopen("http://hashnode.com")

# Fetches the code
# of the web page
content = page.read()

print(content)

```
## 7. Turtle
Yes, a turtle can be imported. Don’t worry it’s not slow. Turtle is a Python module to draw. It has a huge application and a number of methods which you can learn about in here. But with just a few basics, pretty cool stuff can be done. This module comes built-in with Python so there is no need to install it.

**Code**
```python
# This will import turtle module
import turtle


myTurtle = turtle.Turtle()
myWin = turtle.Screen()

# Turtle to draw a spiral
def drawSpiral(myTurtle, linelen):
	myTurtle.forward(linelen)
	myTurtle.right(90)
	drawSpiral(myTurtle, linelen-10)

drawSpiral(myTurtle, 80)
myWin.exitonclick()
```
So buddies, that's all for now. Happy Coding!

## References
- https://pypi.org/project/emoji/
- https://docs.python.org/3/library/urllib.html
- http://python-history.blogspot.com/2010/06/import-antigravity.html