*** IMPORTANT ***

No further development will occur in this package as it has been supeseded by the actively maintained and quite spiffy! epubr package.

pubcrawl

Convert ‘epub’ Files to Text

Description

Convert ‘epub’ Files to Text

The ‘epub’ file format is really just a structured ‘ZIP’ archive with metadata, graphics and (usually) ‘HTML’ text. Tools are provided to turn an ‘epub’ file into a tidy data frame.

What’s Inside The Tin

The following functions are implemented:

epub_to_text: Convert an epub file into a data frame of plaintext chapters

NOTE

There are edge cases I’ve totally not covered yet. Feel free to jump in and make this a real, useful package!

TODO

Refactor so there aren’t so many heavy dependencies

[ ] Try to get

hgr on CRAN so it’s not a GH dep Moved the cleaner code into here

Better docs

Embed some epubs for examples and tests

Setup Travis, Appveyor, code coverage

Installation

devtools::install_github("hrbrmstr/pubcrawl")

Usage

library(pubcrawl)

library(tidyverse)

# current verison

packageVersion("pubcrawl")

## [1] '0.1.0'

An O’Reilly epub

epub_to_text("~/Data/R Packages.epub")

## # A tibble: 26 x 4

## path size date content

##

## 1 OEBPS/cover.html 315 2015-03-24 21:49:16 Cover

## 2 OEBPS/titlepage01.html 466 2015-03-24 21:49:16 "R Packages\n\nHadley Wickham"

## 3 OEBPS/copyright-page01.html 3286 2015-03-24 21:49:16 "R Packages\n\nby Hadley Wickham\n\n\n\nPrinted in the Unite…

## 4 OEBPS/toc01.html 17557 2015-03-24 21:49:16 "navPrefaceIn This Book\n\nConventions Used in This Book\n\nU…

## 5 OEBPS/preface01.html 17784 2015-03-24 21:49:16 "Preface\n\n\nIn This Book\n\nThis book will guide you from b…

## 6 OEBPS/part01.html 444 2015-03-24 21:49:16 Getting Started

## 7 OEBPS/ch01.html 12007 2015-03-24 21:49:16 "Introduction\n\nIn R, the fundamental unit of shareable code…

## 8 OEBPS/ch02.html 28633 2015-03-24 21:49:18 "Package Structure\n\nThis chapter will start you on the road…

## 9 OEBPS/part02.html 454 2015-03-24 21:49:18 Package Components

## 10 OEBPS/ch03.html 28629 2015-03-24 21:49:18 "R Code\n\nThe first principle of using a package is that all…

## # ... with 16 more rows

A Project Gutenberg epub that comes with the package

epub_to_text(system.file("extdat", "augustine.epub", package="pubcrawl")) %>%

mutate(path = abbreviate(path))

## # A tibble: 10 x 4

## path size date content

##

## 1 OEBPS/@@@@@@@3296@3296-@3296--0 63804 2017-10-02 07:00:00 "THE CONFESSIONS\nOF\nSAINT AUGUSTINE\n\nBy Saint Augusti…

## 2 OEBPS/@@@@@@@3296@3296-@3296--1 68504 2017-10-02 07:00:00 "BOOK III\nTo Carthage I came, where there sang all aroun…

## 3 OEBPS/@@@@@@@3296@3296-@3296--2 80192 2017-10-02 07:00:00 "BOOK V\nAccept the sacrifice of my confessions from the …

## 4 OEBPS/@@@@@@@3296@3296-@3296--3 51898 2017-10-02 07:00:00 "O crooked paths! Woe to the audacious soul, which hoped,…

## 5 OEBPS/@@@@@@@3296@3296-@3296--4 80194 2017-10-02 07:00:00 "Anubis, barking Deity, and all         The monster Gods …

## 6 OEBPS/@@@@@@@3296@3296-@3296--5 80718 2017-10-02 07:00:00 "The boy then being stilled from weeping, Euodius took up…

## 7 OEBPS/@@@@@@@3296@3296-@3296--6 65956 2017-10-02 07:00:00 "And Thou knowest how far Thou hast already changed me, w…

## 8 OEBPS/@@@@@@@3296@3296-@3296--7 57022 2017-10-02 07:00:00 "BOOK XII\nMy heart, O Lord, touched with the words of Th…

## 9 OEBPS/@@@@@@@3296@3296-@3296--8 69513 2017-10-02 07:00:00 "BOOK XIII\nI call upon Thee, O my God, my mercy, Who cre…

## 10 OEBPS/@@@@@@@3296@3296-@3296--9 21223 2017-10-02 07:00:00 "The Confessions of Saint Augustine, by Saint Augustine\n…

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

python生成epub文件_将'epub'文件转换为文本相关推荐

  1. pydicom读取头文件_.dcm格式文件软件读取及python处理详解

    要处理一些.dcm格式的焊接缺陷图像,需要读取和显示.dcm格式的图像.通过搜集资料收集到一些医学影像,并通过pydicom模块查看.dcm格式文件. 若要查看dcm格式文件,可下echo viewe ...

  2. python 循环写文件_循环-读写文件-字符编码

    目录: 1.1 while与for循环 1.赋值魔法 #1. 序列解包: 将多个值的序列解开,然后放到序列的变量中. x,y,z = 1,2,3 print(x,y,z) #the result : ...

  3. python 追加写文件_如何往文件中追加文本

    在用python从网站中爬取内容并保存到本地的txt文件中时,发现每次写入都是把txt文件中原来存在的内容覆盖掉了,那么如何才能在原来的基础上继续往里面添加内容呢? 1.原来的打开文件的方式是:fil ...

  4. python 修改pom文件_引用pom文件

    Maven2集成Idea创建多模块项目 创建项目 选择Maven Module,新建一个Maven项目 选择maven-archetype-quickstart选项,点击下一步 顶级项目就创建好啦,把 ...

  5. epub图书_使用EPUB构建数字图书

    epub图书 在你开始前 本教程将指导您创建EPUB格式的电子书. EPUB是一种基于XML的,对开发人员友好的格式,它已成为数字图书的事实上的标准. 但是EPUB不仅适合书籍:有了它,您可以: 捆绑 ...

  6. python生成字符画_使用Python生成ASCII字符画

    使用Python生成ASCII字符画 在很多的网站主页中或者程序的注释中会有一些好看的字符注释画.显得很牛逼的样子 例如: 知乎 _____ _____ _____ _____ /\ \ /\ \ / ...

  7. pdf转换成excel文件_将PDF文件转换为Excel

    pdf转换成excel文件 When I got back to my office after a recent vacation, there was an email from Una, abo ...

  8. python生成词云图_用python生成词云图教程

    闲话不多说,直接上干货! STEP1 安装jieba包 点击桌面菜单栏的开始按钮,输入cmd回车,进入命令窗口. 在命令行输入 pip install jieba回车,安装jieba包. 安装word ...

  9. python生成正态分布矩阵_使用Numpy生成正态分布数据

    如何使用Python生成正态分布的人员身高体重信息? 下面是生成的数据的分布情况,身高数据在各个区间大致呈正态分布. 对应的代码如下,先用pd.cut进行各个区间分桶,然后使用sort_index按照 ...

  10. .so是什么文件_安卓 so 文件解析详解

    so 文件是啥?so 文件是 elf 文件,elf 文件后缀名是.so,所以也被称之为so 文件, elf 文件是 linux 底下二进制文件,可以理解为 windows 下的PE文件,在 Andro ...

最新文章

  1. 2020年AI产业报告:100个岗位抢1个人,计算机视觉成最大缺口
  2. golang--监控goroutine异常退出
  3. 【PAT乙级】1090 危险品装箱 (25 分)
  4. java is alphabetic_JDK之Pattern类探索(一)
  5. QT的QRadioButton类的使用
  6. [Win10]鼠标没用,插入USB口电脑提示USB Optical Mouse找不到驱动程序的解决方案
  7. Nginx基础配置实例配置实现
  8. 过于离谱,我实现憋不住了!
  9. 3d打印主要的切片参数类型_3D打印混凝土工艺参数对成型精度的影响
  10. android属性动画作用范围,Android 属性动画:这是一篇全面 详细的 属性动画 总结攻略...
  11. 互联网产品之百万级高并发技术整体架构
  12. 曾经用过的Cookie
  13. web端前端自定义提示语信息
  14. 智能电子快递面单系统
  15. Python期末考试题库
  16. java实现极简单的 TXT小说阅读器(第四版)
  17. 用html和css画太极图,利用css画一个太极图(阴阳八卦)实例
  18. Dragger2初体验 -- @Inject @Component 使用
  19. OPENGL学习(四)GLUT三维图像绘制
  20. Redis的哨兵机制你知道多少撒

热门文章

  1. 如何实现电压、液位等模拟量信号的无线传输?
  2. php中符号大全,PHP 符号大全
  3. 【毕业设计】【周记】STGCN模型的改进和可视化
  4. 《马克思主义基本原理》复习整理
  5. ps 图片处理技法 怎样使照片看起来更加清晰
  6. 计算机上图片打不开,电脑上打不开jpg格式的图片是怎么回事?
  7. uc看视频显示服务器有点忙,UC3软件常见问题处理方案
  8. 实验五 CA的安装和使用
  9. 某公司的雇员分为以下若干类: Employee:这是所有员工总的父类.属性:员工的姓名,员工的生日月份。 方法:getSalary(intmonth)
  10. 旁路电容、滤波电容、去耦电容的作用与应用原理详解