Top 10 Python Packages you should try right now

Top 10 Python Packages you should try right now

Featured on Hashnode

Python has various packages to make your life easy so that you don't need to code from scratch. These are some of the packages which you can use to build your next project in Python.

PDF Miner

pip install pdfminer

PDF Miner lets you extract text from pdf files. This can be useful if you are building a product which needs text from say resumes or reports.

https://cdn.hashnode.com/res/hashnode/image/upload/v1601567476205/gEMzqA16J.png

There is also a similar library called PyreParser which is specially made just for extracting resume information(This tech is pretty much used in every company in the hiring process)


Pillow

pip install Pillow==2.2.1

Pillow is a library which allows for image manipulation & conversion. You can do a wide variety of things like adding text to an image or blurring an image. Below is a simple example of adding text to an image.

https://cdn.hashnode.com/res/hashnode/image/upload/v1601567416894/lZZwHPh8p.png Below is the before and after running this code. We just added "hashnode is amazing" in the bottom right using the x y coordinates.

New Project(1).png

There is also a python package called moviepy which lets you do similar things but with videos.


OpenCV

pip install opencv-python

image.png

This is one of the booming packages and LinkedIn is filled with project demos built with OpenCV. You can do anything from resizing an image to Controlling Subway surfers from your hands through image recognition.

carbon(12).png

Above is a simple example to open a greyscale image and resize it.

Refer to these Resources to learn more about OpenCV( Edureka and Murtazas YouTube Channel )


Furl

pip install furl

Furl makes parsing and manipulating URLs easy for you. Here is an example of paths and query using furl

carbon(7).png

Output:

http://www.google.com/path?two=2&three=3

Scikit- learn

pip install scikit-learn

Scikit- learn can be used for a variety of applications which include classification, regression, clustering, model selection, naive Bayes’, grade boosting, K-means, and preprocessing.

carbon(14).png Above is a snippet from one of my 2nd-year projects at engineering which predicts prices for houses in Bangalore. This uses Linear Regression and I didn't know the formula and other details but using scikit-learn I could easily use the concept to build a model.

Html2Text

pip install html2text

This allows you to convert HTML code to markdown with just one line of python code.
But you can't directly add websites instead of HTML code, using a beautiful soup can help you do that.

https://cdn.hashnode.com/res/hashnode/image/upload/v1601567238934/El7D8Tr6j.png

Output :

#  Hello world

**Html2 text is amazing**

[ My Blogs are cool ](blog.hrithwik.me/)

Beautiful Soup

pip install beautifulsoup4

Beautiful Soup allows you to parse HTML data from websites and get the data you want by finding the element you want using id or class name. This is one of the most used tools in the field of web scraping. (NOTE: Web Scrapping might be illegal on some websites )

carbon(8).png

Here We just parsed through Bhanu's Article and Generated a markdown from the URL using HTML2Text


Kivy

pip install kivy==1.11.1

Kivy is a really interesting GUI framework that you can use to create desktop user interfaces and mobile applications on both iOS and Android.

Kivy applications will not look like native apps on any platform. This can be an advantage if you want your application to look and feel different from the competition. There are even some alternatives like PyQt and Quirt.

carbon(9).png


Faker

pip install Faker

Faker is a Python package that generates fake data for you. This can be really useful for testing or bootstrapping your database.

carbon(10).png

You can even checkout radar which can generate random date and time.

Selenium

pip install selenium

Selenium is one of the testing frameworks which can be used for fun stuff like automation and building bots. You can automate anything like sending WhatsApp messages to increasing views for your blog.

carbon(11).png

This is a code which opens your website for n number of times in a browser. You can add different user-agents as well.


Conclusion

These were some packages which can do testing or build machine learning projects. Try using any one of them and let me know what you built using these Packages. Hit me up on Twitter or Linkedin .

hrithwik.jpg