python taslate_Python slate包_程序模块 - PyPI - Python中文网

slate是一个python包,它简化了提取过程

PDF文件中的文本。这取决于pdfminer包。

slate提供了一个类,pdf。pdf接受一个类似文件的对象

将从文档中提取所有文本,表示每一页

作为文本字符串:>>> with open('example.pdf') as f:

... doc = slate.PDF(f)

...

>>> doc

[..., ..., ...]

>>> doc[1]

'Text from page 2...'

如果您的pdf受密码保护,请将密码作为

第二个参数:>>> with open('secrets.pdf') as f:

... doc = slate.PDF(f, 'password')

...

>>> doc[0]

"My mother doesn't know this, but..."

更复杂的操作

如果您想访问图像、字体文件和其他

信息,然后花点时间学习pdfminer api。

pdfminer怎么了?Getting simple things done, like extracting the text

is quite complex. The program is not designed to return

Python objects, which makes interfacing things irritating.

It’s an extremely complete set of tools, with multiple

and moderately steep learning curves.

It’s not written with hackability in mind.

欢迎加入QQ群-->: 979659372

推荐PyPI第三方库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值