推荐11个实用Python库
2018-03-02 09:27
1301 查看
1.delorea
非常酷的日期/时间库
2.prettytable
可以在浏览器或终端构建很不错的输出
3.snowballstemmer
非常瘦小的语言转换库,支持15种语言
4.wget
Python 的网络爬虫库
5.PyMC
PyMC,一个用于贝叶斯分析的函数库
6.sh
将 shell 命令作为函数导入 Python 脚本
7.fuzzywuzzy
用于字符串匹配率、令牌匹配等
8.progressbar
如其名,一个滚动条函数库
9.colorama
一个色彩库,可以为文本添加丰富的色彩
10.uuid
一个可以产生唯一 uuid 的库
11.bashplotlib
Python 的绘图控件,可以绘制直方图、散点图等
以上就是本文推荐的11个实用的 Python 库了,也许有些你没有见过,但都是些非常棒的 Python 库,希望大家能够喜欢。
作者丨raquant
原文地址:https://segmentfault.com/a/1190000008786933
非常酷的日期/时间库
from delorean import Delorean EST = "US/Eastern"d = Delorean(timezone=EST)
2.prettytable
可以在浏览器或终端构建很不错的输出
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
非常瘦小的语言转换库,支持15种语言
from snowballstemmer import EnglishStemmer, SpanishStemmer EnglishStemmer().stemWord("Gregory") # Gregori SpanishStemmer().stemWord("amarillo") # amarill
4.wget
Python 的网络爬虫库
import wget wget.download("#100% [............................................................................] 280385 / 280385
5.PyMC
PyMC,一个用于贝叶斯分析的函数库
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
将 shell 命令作为函数导入 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
用于字符串匹配率、令牌匹配等
from fuzzywuzzy import fuzz fuzz.ratio("Hit me with your best shot", "Hit me with your pet shark") # 85
8.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
一个色彩库,可以为文本添加丰富的色彩
10.uuid
一个可以产生唯一 uuid 的库
import uuid print uuid.uuid4() # e7bafa3d-274e-4b0a-b9cc-d898957b4b61
11.bashplotlib
Python 的绘图控件,可以绘制直方图、散点图等
$ pip install bashplotlib $ scatter --file data/texas.txt --pch x
以上就是本文推荐的11个实用的 Python 库了,也许有些你没有见过,但都是些非常棒的 Python 库,希望大家能够喜欢。
作者丨raquant
原文地址:https://segmentfault.com/a/1190000008786933
相关文章推荐
- 推荐11个实用Python库
- 推荐11个实用Python库
- 推荐11个实用Python库
- 11个非常实用的 Python 程序库
- 转:11个实用但你可能不知道的Python程序库
- 11个实用但你可能不知道的Python程序库
- 实用又强大,6 款 Python 时间日期库推荐
- 11个实用但你可能不知道的Python程序库
- 实用又好用,6 款 Python 特殊文本格式处理库推荐
- 11个实用但你可能不知道的Python程序库
- 推荐11个实用的JavaScript库
- Python开发工程师超实用工具推荐
- 11个实用但你可能不知道的Python程序库
- [zz]很详细,涵盖了多数场景!推荐 - python 的日志logging模块学习
- 偶然发现的https的实用代理工具:sni_proxy 推荐
- python IDE比较与推荐
- python编辑器对比和推荐
- 使用python构建基于hadoop的mapreduce日志分析平台 推荐
- python中的列表推导式的简单实用
- 推荐一个很不错的python IDE----------wing IDE