11 Python Libraries You may not have heard of

Source: Internet
Author: User

Currently, there are thousands of Python packages on the web, but few people can know them all. There are more than 47,000 package listings on PyPI alone. Now, more and more data scientists are starting to use Python, and although they get a lot of benefit from pandas,scikit-learn,numpy, I still want to introduce them to some older and very useful Python libraries. In this article, I'll list some of the less well-known libraries, even if you're an experienced Python developer, and it's worth a look.


1, DeLorean


Dolorean is a very cool date/time library. JavaScript-like moment, with very well-developed technical documentation.


From DeLorean import DeLorean
EST = "Us/eastern"
D = DeLorean (Timezone=est)


2, prettytable


You may never have heard of the library because it is hosted in Googlecode. The prettytable is primarily used to build good output at the terminal or browser side.


From prettytable import prettytable
Table = prettytable (["Animal", "ferocity"])
Table.add_row (["Wolverine", 100])
Table.add_row (["Grizzly", 87])
Table.add_row (["Rabbit of Caerbannog", 110])
Table.add_row (["Cat",-1])
Table.add_row (["Platypus", 23])
Table.add_row (["Dolphin", 63])
Table.add_row (["Albatross", 44])
Table.sort_key ("ferocity")
Table.reversesort = True
+-------------------------------+----------+
| Animal | ferocity|
+-------------------------------+----------+
| Rabbit of Caerbannog | 110 |
| Wolverine | 100 |
| Grizzly | 87 |
| Dolphin | 63 |
| Albatross | 44 |
| Platypus | 23 |
| Cat | -1 |
+--------------------------------+----------+


3, Snowballstemmer


Well, I'm also installing the library for the first time. This is a very skinny language conversion library, supported in 15 languages.


From Snowballstemmer import Englishstemmer, Spanishstemmer
Englishstemmer (). Stemword ("Gregory")
# Gregori
Spanishstemmer (). Stemword ("Amarillo")
# Amarill


4, wget


Do you remember that every time you write a web crawler for a purpose, you don't have to do it again, because wget is enough for you to use. Wget is a python version of the web Crawler library, easy to use.


Import wget
Wget.download ("http://www.cnn.com/")
# 100% [... ...]..................... ....................... ........] 280385/280385


5, PYMC


Scikit-learn seems to be the darling of all, but in my opinion, PYMC is more attractive. PYMC is mainly used for Bayesian analysis.


From Pymc.examples import Disaster_model
From PYMC import MCMC
M = MCMC (Disaster_model)
M.sample (iter=10000, burn=1000, thin=10)
[-----------------100%-----------------] 10000 of 10000 complete in 1.4 sec


6, SH


The SH library is used to import shell commands into Python as functions. It is very useful to use in bash, but it is not easy to remember how to use it (i.e. recursively search for files) in Python.


From SH import find
Find ("/tmp")
/tmp/foo
/tmp/foo/file1.json
/tmp/foo/file2.json
/tmp/foo/file3.json
/tmp/foo/bar/file3.json


7, Fuzzywuzzy


Fuzzywuzzy is a library that can be used for fuzzy matching of strings


From Fuzzywuzzy import fuzz
Fuzz.ratio ("Hit me with your best shot", "hits me with your pet shark")
# 85


8, ProgressBar


ProgressBar is a progress bar library that provides a text-mode ProgressBar.


From ProgressBar import ProgressBar
Import time
Pbar = ProgressBar (maxval=10)
For I in range (1, 11):
Pbar.update (i)
Time.sleep (1)
Pbar.finish ()
# 60% |######################################################## |


9, Colorama


Colorama is mainly used to add a variety of colors to text and is very easy to use.


10. UUID


The UUID is a Python-based UUID library that implements the 1,3,4 and 5 versions of the UUID annotations, which is really handy to ensure uniqueness.


Import UUID
Print Uuid.uuid4 ()
# E7bafa3d-274e-4b0a-b9cc-d898957b4b61


11, Bashplotlib


Bashplotlib is a drawing library that allows you to draw histograms and scatter plots using stdin.

$ pip Install Bashplotlib
$ scatter--file data/texas.txt--pch x

11 Python Libraries You may not have heard of

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.