jacobbudin / portable-wisdom Goto Github PK
View Code? Open in Web Editor NEWGenerate EPUB files from unread Instapaper articles ๐
License: MIT License
Generate EPUB files from unread Instapaper articles ๐
License: MIT License
--output
For example, 2020-1-21.epub
should be 2020-01-21.epub
.
Portable Wisdom would support Pocket, but its "article view" API is restricted:
Pocket's Article View API will return article content and relevant meta data on any provided URL.
The Pocket Article View API is currently only open to partners that are integrating Pocket specific features or full-fledged Pocket clients. For example, building a Pocket client for X platform.
Since it's unlikely individual users of Portable Wisdom would be provided this special access, using Pocket as a source will not be supported.
E.g., --style=some_file.css
--transformers-file=some_transformers.py
. Depends on #12.
--config=some_file_config.py
Two examples:
strip_links
โ remove <a>
but keep their contentsbeautify_hr
โ replace * * *
and similar with <hr>
Makefile?
$ python3 setup.py sdist
$ twine upload dist/*
--silent
(i.e., no output)
When I executed "portable-wisdom -h" after installing the package via pip, I got the "Module not found" error.
It looks all the codes of this library are located right under "site-packages" directory.
After creating "portable_wisdom" directory under "site-packages" and coping the codes to the directory, it became functional.
Could you confirm if it's reproducible on your side?
My environment is Linux/Python 3.11/venv.
ebooklib._get_nav
fails when any article contains an emoji:
lxml.etree.ParserError: Document is empty
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/portable_wisdom/wisdom.py", line 86, in <module>
main()
File "/portable_wisdom/wisdom.py", line 80, in main
epub.write_epub(filename, book, {})
File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1746, in write_epub
epub.write()
File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1369, in write
self._write_items()
File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1356, in _write_items
self.out.writestr('%s/%s' % (self.book.FOLDER_NAME, item.file_name), self._get_nav(item))
File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1212, in _get_nav
inserted_pages = get_pages_for_items([item for item in self.book.get_items_of_type(ebooklib.ITEM_DOCUMENT) File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 119, in get_pages_for_items
pages_from_docs = [get_pages(item) for item in items]
File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 119, in <listcomp>
pages_from_docs = [get_pages(item) for item in items]
File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 96, in get_pages
body = parse_html_string(item.get_body_content())
File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 48, in parse_html_string
html_tree = html.document_fromstring(s, parser=utf8_parser)
File "/venv/lib/python3.10/site-packages/lxml/html/__init__.py", line 761, in document_fromstring
raise etree.ParserError(
lxml.etree.ParserError: Document is empty
Portable Wisdom depends on the pyinstapaper package. pyinstapaper 0.2.2 has a dependency on lxml<=4
, and lxml 4.0.0 does not build on modern machines.
The workaround:
setup.py
. Replace 'lxml>=3.4,<=4'
with 'lxml>=3.4,<=5'
.$ pip install .
).A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.