tidy-byte-tools 0.1.1__py3-none-any.whl

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.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: tidy-byte-tools
3
+ Version: 0.1.1
4
+ Summary: One install and one MCP server for the Tidy Byte Tools lite CLIs: repair JSON, extract PDF tables, convert documents to Markdown, and more. Runs locally. No API key.
5
+ Author: Tidy Byte Tools
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tidybytetools/tidy-byte-tools
8
+ Project-URL: Documentation, https://github.com/tidybytetools/tidy-byte-tools#readme
9
+ Project-URL: Source, https://github.com/tidybytetools/tidy-byte-tools
10
+ Project-URL: Issues, https://github.com/tidybytetools/tidy-byte-tools/issues
11
+ Project-URL: Changelog, https://github.com/tidybytetools/tidy-byte-tools/blob/main/CHANGELOG.md
12
+ Project-URL: Apify, https://apify.com/tidybytetools
13
+ Project-URL: API, https://tidybytetools.tidybytetools.workers.dev
14
+ Project-URL: Website, https://tidybytetools.github.io
15
+ Keywords: mcp,mcp-server,json,markdown,pdf,data-cleaning,developer-tools,cli
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Environment :: Console
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: End Users/Desktop
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Topic :: Text Processing
28
+ Classifier: Topic :: Utilities
29
+ Requires-Python: >=3.10
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: mcp<2,>=1.10
33
+ Requires-Dist: json-shaper-lite>=1.1.2
34
+ Requires-Dist: md-chunk-lite>=1.1.1
35
+ Requires-Dist: doc2md-lite>=1.2.2
36
+ Requires-Dist: pdf-table-pull-lite>=1.3.1
37
+ Requires-Dist: link-check-lite>=1.1.4
38
+ Requires-Dist: json-repair-lite>=1.0.1
39
+ Requires-Dist: base64-lite>=1.0.1
40
+ Requires-Dist: tidy-hash-lite>=1.0.1
41
+ Dynamic: license-file
42
+
43
+ <p>
44
+ <a href="https://github.com/tidybytetools">
45
+ <picture>
46
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tidybytetools/tidy-byte-tools/main/assets/tidybytetools-lockup-dark.png">
47
+ <img alt="Tidy Byte Tools" src="https://raw.githubusercontent.com/tidybytetools/tidy-byte-tools/main/assets/tidybytetools-lockup-light.png" height="44">
48
+ </picture>
49
+ </a>
50
+ </p>
51
+
52
+ # Tidy Byte Tools
53
+
54
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/tidybytetools/tidy-byte-tools/blob/main/LICENSE)
55
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
56
+ [![MCP server](https://img.shields.io/badge/MCP-stdio-purple.svg)](#use-it-from-claude-desktop-cursor-or-vs-code)
57
+ [![Tests](https://github.com/tidybytetools/tidy-byte-tools/actions/workflows/tests.yml/badge.svg)](https://github.com/tidybytetools/tidy-byte-tools/actions/workflows/tests.yml)
58
+ [![Version](https://img.shields.io/badge/version-0.1.0-blue.svg)](https://github.com/tidybytetools/tidy-byte-tools/releases/tag/v0.1.0)
59
+
60
+ One install for our free local tools: fix broken JSON, pull tables out of a PDF, turn documents into Markdown, and more. It also starts **one MCP server** with all of those tools, so an AI assistant can use them on your computer. No API key.
61
+
62
+ This does not replace the individual lite repos. It is a doorway that installs them together.
63
+
64
+ <!-- mcp-name: io.github.tidybytetools/tidy-byte-tools -->
65
+
66
+ ## Try it
67
+
68
+ This command is not valid JSON (the keys have no quotes, and there is a trailing comma):
69
+
70
+ ```bash
71
+ printf '{name: "Ada", city: "Austin",}' | tidy-byte-tools json-repair -q
72
+ ```
73
+
74
+ `-q` hides a one-line tip about the paid cloud version. Real output from that command (0.1.0, 17 Nov 2026):
75
+
76
+ ```json
77
+ {
78
+ "name": "Ada",
79
+ "city": "Austin"
80
+ }
81
+ ```
82
+
83
+ ![A terminal run of tidy-byte-tools json-repair turning messy JSON into valid JSON](docs/demo.gif)
84
+
85
+ ## Install
86
+
87
+ Needs Python 3.10 or newer. Install it from PyPI:
88
+
89
+ ```bash
90
+ pip install tidy-byte-tools
91
+ ```
92
+
93
+ Or use pipx, which keeps it in its own space:
94
+
95
+ ```bash
96
+ pipx install tidy-byte-tools
97
+ ```
98
+
99
+ That also installs the eight lite tools. All of them come from PyPI. (hash-lite's PyPI name is `tidy-hash-lite`.)
100
+
101
+ ## Use it
102
+
103
+ ```bash
104
+ printf '{name: "Ada", city: "Austin",}' | tidy-byte-tools json-repair
105
+ tidy-byte-tools pdf-table-pull report.pdf
106
+ tidy-byte-tools doc2md page.html -o page.md
107
+ tidy-byte-tools --help
108
+ ```
109
+
110
+ `tbt` is a short name for the same command. Installing the package also gives you the original commands (`json-repair-lite`, `doc2md-lite`, and so on).
111
+
112
+ From Python, import a lite package directly:
113
+
114
+ ```python
115
+ from json_repair_lite import repair_one
116
+ repair_one("{name: 'Ada',}")["value"] # {'name': 'Ada'}
117
+ ```
118
+
119
+ ## Use it from Claude Desktop, Cursor, or VS Code
120
+
121
+ The MCP server talks over stdio. After you install the package, add one of these configs. If you would rather not install it first, `uvx` can run it from GitHub.
122
+
123
+ Claude Desktop (`claude_desktop_config.json`) and Cursor (`.cursor/mcp.json`):
124
+
125
+ ```json
126
+ {
127
+ "mcpServers": {
128
+ "tidy-byte-tools": {
129
+ "command": "uvx",
130
+ "args": [
131
+ "--from",
132
+ "tidy-byte-tools",
133
+ "tidy-byte-tools-mcp"
134
+ ]
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ If the package is already installed, you can use `"command": "tidy-byte-tools-mcp"` and leave out `args`.
141
+
142
+ VS Code (`.vscode/mcp.json`):
143
+
144
+ ```json
145
+ {
146
+ "servers": {
147
+ "tidy-byte-tools": {
148
+ "command": "uvx",
149
+ "args": [
150
+ "--from",
151
+ "tidy-byte-tools",
152
+ "tidy-byte-tools-mcp"
153
+ ]
154
+ }
155
+ }
156
+ }
157
+ ```
158
+
159
+ The server exposes 15 tools. Base64 tools are named `base64_convert_text` and `base64_convert_file` so they are not confused with the document converter. Most tools only read. `save_chunks_jsonl`, `convert_to_markdown` (when you set an output path), and `extract_pdf_tables` can write the files you ask for. `check_links` requests the URLs you give it.
160
+
161
+ You can also start the server yourself with `tidy-byte-tools mcp`.
162
+
163
+ ## The tools in this install
164
+
165
+ | Command | What it does | Lite repo |
166
+ | --- | --- | --- |
167
+ | `json-repair` | Repair broken or incomplete JSON, including output from language models | [json-repair-lite](https://github.com/tidybytetools/json-repair-lite) |
168
+ | `json-shaper` | Turn notes, CSV/TSV, or Markdown tables into typed JSON | [json-shaper-lite](https://github.com/tidybytetools/json-shaper-lite) |
169
+ | `base64` | Encode or decode Base64 for text and local files | [base64-lite](https://github.com/tidybytetools/base64-lite) |
170
+ | `hash` | Hash text or files with SHA-256, SHA-1, MD5, and SHA-512 | [hash-lite](https://github.com/tidybytetools/hash-lite) |
171
+ | `md-chunk` | Split Markdown into chunks by heading, for RAG | [md-chunk-lite](https://github.com/tidybytetools/md-chunk-lite) |
172
+ | `doc2md` | Turn a PDF or HTML file into clean Markdown | [doc2md-lite](https://github.com/tidybytetools/doc2md-lite) |
173
+ | `pdf-table-pull` | Pull tables out of a PDF into CSV | [pdf-table-pull-lite](https://github.com/tidybytetools/pdf-table-pull-lite) |
174
+ | `link-check` | Check web links for status codes and redirects | [link-check-lite](https://github.com/tidybytetools/link-check-lite) |
175
+
176
+ ## Paid cloud tools and the API
177
+
178
+ If you want the same kind of work in the cloud, pay per use:
179
+
180
+ - Apify store: [https://apify.com/tidybytetools](https://apify.com/tidybytetools)
181
+ - HTTPS API: [https://tidybytetools.tidybytetools.workers.dev](https://tidybytetools.tidybytetools.workers.dev)
182
+
183
+ The site is [https://tidybytetools.github.io](https://tidybytetools.github.io).
184
+
185
+ ## Limits
186
+
187
+ - These tools run on your computer. They are not a hosted service.
188
+ - `link-check` needs a network. The other tools work offline.
189
+ - The PDF tools read text PDFs. A scanned page with no text layer will not give useful tables or Markdown.
190
+ - This wrapper does not change how each lite tool works. See that tool's README for its flags and limits.
191
+ - Official PyPI and MCP Registry install names for this toolkit are not live yet. Use the GitHub install above until they are.
192
+
193
+ ## License
194
+
195
+ MIT. See [LICENSE](LICENSE). Changes and ideas are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,8 @@
1
+ tidy_byte_tools.py,sha256=-TUXMxk8__KEELDNPt9KuVPSQdNVi56EG8wpUrqYdOU,3211
2
+ tidy_byte_tools_mcp.py,sha256=2yHVH1OlYcYSe8CweTGkUBw0tYj71p9ytSWGPoPpNVg,2711
3
+ tidy_byte_tools-0.1.1.dist-info/licenses/LICENSE,sha256=IpHMoXz-sReyVcPkfbf_wfCz9SMBH18CuE2B6ALlrbI,1065
4
+ tidy_byte_tools-0.1.1.dist-info/METADATA,sha256=Cz0Gd-nRQ0xP85pPyD7kppx_mz02-o5occyFqu21GKk,8113
5
+ tidy_byte_tools-0.1.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
6
+ tidy_byte_tools-0.1.1.dist-info/entry_points.txt,sha256=vV5h70tvBuRaBQ92SAbNxHvJ_oOdW0a5me_XoHaHUFM,131
7
+ tidy_byte_tools-0.1.1.dist-info/top_level.txt,sha256=qOnRdWbVFGr5ewtuHM758EwsbbpnOGs9SFqat7vPT2M,36
8
+ tidy_byte_tools-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ tbt = tidy_byte_tools:main
3
+ tidy-byte-tools = tidy_byte_tools:main
4
+ tidy-byte-tools-mcp = tidy_byte_tools_mcp:main
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tidybyte
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ tidy_byte_tools
2
+ tidy_byte_tools_mcp
tidy_byte_tools.py ADDED
@@ -0,0 +1,99 @@
1
+ """One command for all Tidy Byte Tools lite CLIs, plus the combined MCP server."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import sys
7
+
8
+ __version__ = "0.1.1"
9
+
10
+ # subcommand -> (importable module with main(), argv0 so that tool's own help still makes sense)
11
+ COMMANDS = {
12
+ "json-repair": ("json_repair_lite", "json-repair-lite"),
13
+ "json-shaper": ("json_shaper_lite", "json-shaper-lite"),
14
+ "base64": ("base64_lite", "base64-lite"),
15
+ "hash": ("hash_lite", "hash-lite"),
16
+ "md-chunk": ("md_chunk_lite", "md-chunk-lite"),
17
+ "doc2md": ("doc2md_lite", "doc2md-lite"),
18
+ "pdf-table-pull": ("pdf_table_pull_lite", "pdf-table-pull-lite"),
19
+ "link-check": ("link_check_lite", "link-check-lite"),
20
+ }
21
+
22
+ HELP = f"""tidy-byte-tools {__version__}
23
+
24
+ One install for the free Tidy Byte Tools. Each subcommand is the same as
25
+ that tool's own command. `mcp` starts one MCP server with all of the tools.
26
+
27
+ Usage:
28
+ tidy-byte-tools <command> [args]
29
+ tbt <command> [args]
30
+
31
+ Commands:
32
+ json-repair Repair broken or incomplete JSON
33
+ json-shaper Turn notes, CSV/TSV or Markdown tables into JSON
34
+ base64 Encode or decode Base64
35
+ hash Hash text or files (SHA-256, SHA-1, MD5, SHA-512)
36
+ md-chunk Split Markdown into chunks by heading
37
+ doc2md Turn a PDF or HTML file into Markdown
38
+ pdf-table-pull Pull tables out of a PDF into CSV
39
+ link-check Check web links for status codes and redirects
40
+ mcp Start the combined MCP server (stdio)
41
+
42
+ Examples:
43
+ printf '{{name: "Ada", city: "Austin",}}' | tidy-byte-tools json-repair
44
+ tidy-byte-tools pdf-table-pull report.pdf
45
+ tidy-byte-tools mcp
46
+
47
+ Installing this package also gives you the original commands
48
+ (json-repair-lite, doc2md-lite, and so on).
49
+
50
+ Paid cloud tools: https://apify.com/tidybytetools
51
+ HTTPS API: https://tidybytetools.tidybytetools.workers.dev
52
+ Source: https://github.com/tidybytetools/tidy-byte-tools
53
+ """
54
+
55
+
56
+ def main(argv: list[str] | None = None) -> int:
57
+ argv = list(sys.argv[1:] if argv is None else argv)
58
+ if not argv or argv[0] in ("-h", "--help", "help"):
59
+ print(HELP)
60
+ return 0
61
+ if argv[0] in ("-V", "--version"):
62
+ print(__version__)
63
+ return 0
64
+ cmd, *rest = argv
65
+ if cmd == "mcp":
66
+ from tidy_byte_tools_mcp import main as mcp_main
67
+
68
+ sys.argv = ["tidy-byte-tools-mcp", *rest]
69
+ try:
70
+ mcp_main()
71
+ except SystemExit as exc:
72
+ return _exit_code(exc.code)
73
+ return 0
74
+ if cmd not in COMMANDS:
75
+ print(f"Unknown command: {cmd}", file=sys.stderr)
76
+ print("Try `tidy-byte-tools --help`.", file=sys.stderr)
77
+ return 2
78
+ module_name, prog = COMMANDS[cmd]
79
+ mod = importlib.import_module(module_name)
80
+ sys.argv = [prog, *rest]
81
+ try:
82
+ result = mod.main()
83
+ except SystemExit as exc:
84
+ return _exit_code(exc.code)
85
+ return 0 if result is None else int(result)
86
+
87
+
88
+ def _exit_code(code: object) -> int:
89
+ if code is None or code is False:
90
+ return 0
91
+ if code is True:
92
+ return 1
93
+ if isinstance(code, int):
94
+ return code
95
+ return 1
96
+
97
+
98
+ if __name__ == "__main__":
99
+ raise SystemExit(main())
tidy_byte_tools_mcp.py ADDED
@@ -0,0 +1,84 @@
1
+ """One MCP server that exposes the Tidy Byte Tools lite tools over stdio.
2
+
3
+ Run: uvx --from tidy-byte-tools tidy-byte-tools mcp
4
+ or: uvx --from tidy-byte-tools tidy-byte-tools-mcp
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import base64_lite_mcp
10
+ import doc2md_lite_mcp
11
+ import hash_lite_mcp
12
+ import json_repair_lite_mcp
13
+ import json_shaper_lite_mcp
14
+ import link_check_lite_mcp
15
+ import md_chunk_lite_mcp
16
+ import pdf_table_pull_lite_mcp
17
+ from mcp.server.fastmcp import FastMCP
18
+
19
+ # Names that would collide or be unclear next to the other tools.
20
+ RENAME = {
21
+ "convert_text": "base64_convert_text",
22
+ "convert_file": "base64_convert_file",
23
+ }
24
+
25
+ # Explicit list so a new lite tool is not added by surprise. Metadata
26
+ # (title, description, annotations) is reused from each lite MCP server.
27
+ EXPOSE: tuple[tuple[object, str], ...] = (
28
+ (json_repair_lite_mcp, "repair_json_text"),
29
+ (json_repair_lite_mcp, "repair_json_file"),
30
+ (json_shaper_lite_mcp, "shape_text_to_json"),
31
+ (json_shaper_lite_mcp, "shape_file_to_json"),
32
+ (base64_lite_mcp, "convert_text"),
33
+ (base64_lite_mcp, "convert_file"),
34
+ (hash_lite_mcp, "hash_text"),
35
+ (hash_lite_mcp, "hash_file"),
36
+ (md_chunk_lite_mcp, "chunk_markdown"),
37
+ (md_chunk_lite_mcp, "outline_markdown"),
38
+ (md_chunk_lite_mcp, "get_section"),
39
+ (md_chunk_lite_mcp, "save_chunks_jsonl"),
40
+ (doc2md_lite_mcp, "convert_to_markdown"),
41
+ (pdf_table_pull_lite_mcp, "extract_pdf_tables"),
42
+ (link_check_lite_mcp, "check_links"),
43
+ )
44
+
45
+ INSTRUCTIONS = (
46
+ "Local tools from Tidy Byte Tools. They clean messy data on this computer: "
47
+ "repair JSON, turn notes or tables into JSON, encode or decode Base64, "
48
+ "hash text and files, split Markdown into chunks, convert PDFs and HTML "
49
+ "to Markdown, pull tables out of a PDF, and check web links. "
50
+ "Most tools only read. save_chunks_jsonl, convert_to_markdown (when you "
51
+ "set output_path), and extract_pdf_tables can write the files you ask for. "
52
+ "check_links makes HTTP requests to the URLs you give it. No API key."
53
+ )
54
+
55
+ mcp = FastMCP(
56
+ "tidy-byte-tools",
57
+ instructions=INSTRUCTIONS,
58
+ website_url="https://github.com/tidybytetools/tidy-byte-tools",
59
+ )
60
+
61
+
62
+ def _load_tools() -> None:
63
+ for mod, src_name in EXPOSE:
64
+ tool = mod.mcp._tool_manager.get_tool(src_name)
65
+ if tool is None:
66
+ raise RuntimeError(f"lite MCP tool missing: {mod.__name__}.{src_name}")
67
+ mcp.add_tool(
68
+ tool.fn,
69
+ name=RENAME.get(src_name, src_name),
70
+ title=tool.title,
71
+ description=tool.description,
72
+ annotations=tool.annotations,
73
+ )
74
+
75
+
76
+ _load_tools()
77
+
78
+
79
+ def main() -> None:
80
+ mcp.run()
81
+
82
+
83
+ if __name__ == "__main__":
84
+ main()