perusal 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- perusal-0.0.5/LICENSE +21 -0
- perusal-0.0.5/MANIFEST.in +1 -0
- perusal-0.0.5/PKG-INFO +92 -0
- perusal-0.0.5/README.md +58 -0
- perusal-0.0.5/VERSION +1 -0
- perusal-0.0.5/pyproject.toml +64 -0
- perusal-0.0.5/setup.cfg +4 -0
- perusal-0.0.5/src/perusal/__init__.py +15 -0
- perusal-0.0.5/src/perusal/__main__.py +3 -0
- perusal-0.0.5/src/perusal/browser.py +2374 -0
- perusal-0.0.5/src/perusal/cli.py +162 -0
- perusal-0.0.5/src/perusal/core.py +323 -0
- perusal-0.0.5/src/perusal/devtools.py +309 -0
- perusal-0.0.5/src/perusal/mcp.py +49 -0
- perusal-0.0.5/src/perusal.egg-info/PKG-INFO +92 -0
- perusal-0.0.5/src/perusal.egg-info/SOURCES.txt +18 -0
- perusal-0.0.5/src/perusal.egg-info/dependency_links.txt +1 -0
- perusal-0.0.5/src/perusal.egg-info/entry_points.txt +2 -0
- perusal-0.0.5/src/perusal.egg-info/requires.txt +10 -0
- perusal-0.0.5/src/perusal.egg-info/top_level.txt +1 -0
perusal-0.0.5/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 byteface
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include README.md LICENSE VERSION
|
perusal-0.0.5/PKG-INFO
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: perusal
|
|
3
|
+
Version: 0.0.5
|
|
4
|
+
Summary: Read the web as Markdown: a CLI, a reader-browser GUI, and an optional MCP server, on the domonic Readability + Turndown ports
|
|
5
|
+
Author-email: byteface <byteface@googlemail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/byteface/domonic-libs/tree/master/src/perusal
|
|
8
|
+
Project-URL: Source, https://github.com/byteface/domonic-libs
|
|
9
|
+
Project-URL: Documentation, https://github.com/byteface/domonic-libs/blob/master/docs/perusal.md
|
|
10
|
+
Project-URL: Tracker, https://github.com/byteface/domonic-libs/issues
|
|
11
|
+
Keywords: readability,turndown,markdown,reader,browser,web,domonic,mcp
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
22
|
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: domonic-libs>=0.0.5
|
|
27
|
+
Provides-Extra: mcp
|
|
28
|
+
Requires-Dist: mcp<2,>=1.12; extra == "mcp"
|
|
29
|
+
Provides-Extra: browser
|
|
30
|
+
Requires-Dist: pywebview>=5.0; extra == "browser"
|
|
31
|
+
Provides-Extra: js
|
|
32
|
+
Requires-Dist: myjs>=0.0.5; extra == "js"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# perusal
|
|
36
|
+
|
|
37
|
+
The internet without all the 💩
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install perusal
|
|
41
|
+
|
|
42
|
+
perusal https://en.wikipedia.org/wiki/Domino # -> clean Markdown on stdout
|
|
43
|
+
perusal ./saved-page.html # a local HTML file works too
|
|
44
|
+
perusal report https://example.com # HTML-vs-Markdown size / token savings
|
|
45
|
+
perusal url1 url2 url3 # -> one combined Markdown digest
|
|
46
|
+
echo '<h1>hi</h1>' | perusal - # read HTML from stdin
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Pages pass through the domonic Readability and Turndown ports: fetch →
|
|
50
|
+
readable-article extraction → Markdown → cleanup, with optional relevance
|
|
51
|
+
ranking (`--query`) and a hard character budget (`--max-chars`).
|
|
52
|
+
|
|
53
|
+
Pages that render client-side (an empty server response, "Enable JavaScript
|
|
54
|
+
to view this content") need their own JavaScript actually run first:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install 'perusal[js]'
|
|
58
|
+
perusal https://example.com/app --js # runs the page's <script>s via myjs first
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## The reader-browser
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install 'perusal[browser]'
|
|
65
|
+
perusal browse # tabbed webview reader
|
|
66
|
+
perusal browse https://en.wikipedia.org/wiki/Domino
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
A small tabbed reader-browser (history, incognito tabs, bookmarks, DevTools,
|
|
70
|
+
adjustable type, Wikipedia math rendering, "save page as Markdown") with
|
|
71
|
+
keyboard shortcuts: `⌘/Ctrl+T` new tab, `W` close tab, `R` reload, `D`
|
|
72
|
+
bookmark, `B` toggle bookmarks, `U` view page source, `L` focus the URL bar.
|
|
73
|
+
|
|
74
|
+
**DevTools** (the `</>` button): raw page **Source**, a static **Resources**
|
|
75
|
+
inventory (every referenced script/stylesheet/image/iframe, each viewable in
|
|
76
|
+
turn), and an **Info** tab with IP / reverse DNS / WHOIS / DNS records
|
|
77
|
+
(hand-rolled clients, no new dependency) plus certificate-transparency-log
|
|
78
|
+
subdomain discovery via crt.sh. Purely passive and manually triggered — no
|
|
79
|
+
port scanning, no active brute-forcing, nothing sent to the site itself
|
|
80
|
+
beyond the page fetch perusal already made.
|
|
81
|
+
|
|
82
|
+
## MCP server (optional)
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install 'perusal[mcp]'
|
|
86
|
+
perusal mcp # stdio MCP server
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
One read-only, idempotent tool — `web_read(url, query?, max_chars?, timeout?)` —
|
|
90
|
+
built on the official Python MCP SDK. Point an MCP client at `perusal mcp`.
|
|
91
|
+
|
|
92
|
+
See the [full documentation](https://github.com/byteface/domonic-libs/blob/master/docs/perusal.md).
|
perusal-0.0.5/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# perusal
|
|
2
|
+
|
|
3
|
+
The internet without all the 💩
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install perusal
|
|
7
|
+
|
|
8
|
+
perusal https://en.wikipedia.org/wiki/Domino # -> clean Markdown on stdout
|
|
9
|
+
perusal ./saved-page.html # a local HTML file works too
|
|
10
|
+
perusal report https://example.com # HTML-vs-Markdown size / token savings
|
|
11
|
+
perusal url1 url2 url3 # -> one combined Markdown digest
|
|
12
|
+
echo '<h1>hi</h1>' | perusal - # read HTML from stdin
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Pages pass through the domonic Readability and Turndown ports: fetch →
|
|
16
|
+
readable-article extraction → Markdown → cleanup, with optional relevance
|
|
17
|
+
ranking (`--query`) and a hard character budget (`--max-chars`).
|
|
18
|
+
|
|
19
|
+
Pages that render client-side (an empty server response, "Enable JavaScript
|
|
20
|
+
to view this content") need their own JavaScript actually run first:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install 'perusal[js]'
|
|
24
|
+
perusal https://example.com/app --js # runs the page's <script>s via myjs first
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## The reader-browser
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install 'perusal[browser]'
|
|
31
|
+
perusal browse # tabbed webview reader
|
|
32
|
+
perusal browse https://en.wikipedia.org/wiki/Domino
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A small tabbed reader-browser (history, incognito tabs, bookmarks, DevTools,
|
|
36
|
+
adjustable type, Wikipedia math rendering, "save page as Markdown") with
|
|
37
|
+
keyboard shortcuts: `⌘/Ctrl+T` new tab, `W` close tab, `R` reload, `D`
|
|
38
|
+
bookmark, `B` toggle bookmarks, `U` view page source, `L` focus the URL bar.
|
|
39
|
+
|
|
40
|
+
**DevTools** (the `</>` button): raw page **Source**, a static **Resources**
|
|
41
|
+
inventory (every referenced script/stylesheet/image/iframe, each viewable in
|
|
42
|
+
turn), and an **Info** tab with IP / reverse DNS / WHOIS / DNS records
|
|
43
|
+
(hand-rolled clients, no new dependency) plus certificate-transparency-log
|
|
44
|
+
subdomain discovery via crt.sh. Purely passive and manually triggered — no
|
|
45
|
+
port scanning, no active brute-forcing, nothing sent to the site itself
|
|
46
|
+
beyond the page fetch perusal already made.
|
|
47
|
+
|
|
48
|
+
## MCP server (optional)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install 'perusal[mcp]'
|
|
52
|
+
perusal mcp # stdio MCP server
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
One read-only, idempotent tool — `web_read(url, query?, max_chars?, timeout?)` —
|
|
56
|
+
built on the official Python MCP SDK. Point an MCP client at `perusal mcp`.
|
|
57
|
+
|
|
58
|
+
See the [full documentation](https://github.com/byteface/domonic-libs/blob/master/docs/perusal.md).
|
perusal-0.0.5/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.5
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Build config for the standalone `perusal` distribution.
|
|
2
|
+
#
|
|
3
|
+
# `src` here is a symlink to ../../src, so src/perusal is the single source of
|
|
4
|
+
# truth and this project packages only `perusal*`.
|
|
5
|
+
|
|
6
|
+
[build-system]
|
|
7
|
+
requires = ["setuptools>=77"]
|
|
8
|
+
build-backend = "setuptools.build_meta"
|
|
9
|
+
|
|
10
|
+
[project]
|
|
11
|
+
name = "perusal"
|
|
12
|
+
dynamic = ["version"]
|
|
13
|
+
description = "Read the web as Markdown: a CLI, a reader-browser GUI, and an optional MCP server, on the domonic Readability + Turndown ports"
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
license = "MIT"
|
|
16
|
+
license-files = ["LICENSE"]
|
|
17
|
+
authors = [
|
|
18
|
+
{ name = "byteface", email = "byteface@googlemail.com" },
|
|
19
|
+
]
|
|
20
|
+
requires-python = ">=3.10"
|
|
21
|
+
keywords = ["readability", "turndown", "markdown", "reader", "browser", "web", "domonic", "mcp"]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 3 - Alpha",
|
|
24
|
+
"Environment :: Console",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
33
|
+
"Topic :: Text Processing :: Markup :: HTML",
|
|
34
|
+
]
|
|
35
|
+
dependencies = [
|
|
36
|
+
"domonic-libs>=0.0.5",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
# `perusal mcp` -- the stdio MCP server
|
|
41
|
+
mcp = ["mcp>=1.12,<2"]
|
|
42
|
+
# `perusal browse` -- the reader-browser GUI
|
|
43
|
+
browser = ["pywebview>=5.0"]
|
|
44
|
+
# `perusal md --js` -- render a page's own JavaScript (via myjs) before reading it
|
|
45
|
+
js = ["myjs>=0.0.5"]
|
|
46
|
+
|
|
47
|
+
[project.scripts]
|
|
48
|
+
perusal = "perusal.cli:main"
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/byteface/domonic-libs/tree/master/src/perusal"
|
|
52
|
+
Source = "https://github.com/byteface/domonic-libs"
|
|
53
|
+
Documentation = "https://github.com/byteface/domonic-libs/blob/master/docs/perusal.md"
|
|
54
|
+
Tracker = "https://github.com/byteface/domonic-libs/issues"
|
|
55
|
+
|
|
56
|
+
[tool.setuptools]
|
|
57
|
+
package-dir = { "" = "src" }
|
|
58
|
+
|
|
59
|
+
[tool.setuptools.packages.find]
|
|
60
|
+
where = ["src"]
|
|
61
|
+
include = ["perusal*"]
|
|
62
|
+
|
|
63
|
+
[tool.setuptools.dynamic]
|
|
64
|
+
version = { file = "VERSION" }
|
perusal-0.0.5/setup.cfg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""perusal -- read the web as Markdown.
|
|
2
|
+
|
|
3
|
+
A CLI (``perusal <url>``), a reader-browser GUI (``perusal browse``), and an
|
|
4
|
+
optional MCP server (``perusal mcp``), all standing on the domonic Readability
|
|
5
|
+
and Turndown ports.
|
|
6
|
+
|
|
7
|
+
``core`` holds the fetch -> Readability -> Turndown -> Markdown pipeline shared
|
|
8
|
+
by the CLI and the MCP tool. ``browser`` is the standalone GUI (it keeps its
|
|
9
|
+
own richer, interactive extraction) and is imported lazily so the base package
|
|
10
|
+
has no pywebview dependency.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from .core import ReaderResult, web_read
|
|
14
|
+
|
|
15
|
+
__all__ = ["ReaderResult", "web_read"]
|