diff --git a/CHANGELOG.md b/CHANGELOG.md index 1070a2e..ed0b4fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ the pre-release development history. ## [Unreleased] +## [0.1.1] - 2026-10-10 + +### Changed + +- Use a dedicated PyPI description with runnable examples, optional-extra installation, + Workbook Bundle queries, and absolute documentation links. +- Correct outdated release wording in the repository README; parsing behavior is unchanged. + ## [0.1.0] - 2026-10-10 ### Added diff --git a/CHANGELOG_cn.md b/CHANGELOG_cn.md index 9bdec95..6a9fb29 100644 --- a/CHANGELOG_cn.md +++ b/CHANGELOG_cn.md @@ -6,6 +6,13 @@ ## [未发布] +## [0.1.1] - 2026-10-10 + +### 调整 + +- PyPI 使用独立简介,前置安装、可运行示例、Workbook Bundle 查询及绝对文档链接。 +- 修正仓库 README 的过期发布措辞;解析行为保持不变。 + ## [0.1.0] - 2026-10-10 ### 新增 diff --git a/MANIFEST.in b/MANIFEST.in index 59f9d15..a3bfbd0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,3 +4,4 @@ recursive-include skills/langparse *.md include examples/agent_ingestion.py recursive-include tests/fixtures *.json include docs/RELEASE_0.1.0.md +include docs/PYPI.md diff --git a/README.md b/README.md index 77b4a30..06bbb63 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ where LangParse goes deliberately deeper. --- -## Parsing progress (unreleased) +## Parsing progress Pass `progress_callback` to `AutoParser`, `ParseService`, `PDFParser`, or `BatchParseService.run`. The callback receives immutable `ProgressEvent` objects: @@ -80,7 +80,7 @@ langparse parse docs/ --batch --output-dir out --progress ## Project status -The latest GitHub release is `0.1.0`. Core multi-format parsing, +The latest GitHub release is `0.1.1`. Core multi-format parsing, structured OOXML workbooks, semantic chunking, batch processing, quality checks, and CI are available today. LangParse remains pre-1.0; see [docs/PROGRESS.md](docs/PROGRESS.md) for the module-by-module source of truth and @@ -132,10 +132,10 @@ views derived from it, not replacements for it. ## Installation -Install the current release candidate: +Install the current release: ```bash -pip install "langparse==0.1.0" +pip install "langparse==0.1.1" ``` Install only the optional capabilities you need: diff --git a/README_cn.md b/README_cn.md index 7ddf707..29c3a41 100644 --- a/README_cn.md +++ b/README_cn.md @@ -33,7 +33,7 @@ PDF 和 Word 能力让 LangParse 覆盖完整文档管道;Excel 是项目主 ## 项目状态 -当前 GitHub 正式版本为 `0.1.0`。多格式解析、OOXML 工作簿结构化、语义分块、 +当前 GitHub 正式版本为 `0.1.1`。多格式解析、OOXML 工作簿结构化、语义分块、 批处理、质量检查和 CI 已可用。项目仍处于 pre-1.0;各模块的真实完成度和已知缺口 以 [docs/PROGRESS.md](docs/PROGRESS.md) 为准。正式发布范围见 [发布说明](docs/RELEASE_0.1.0.md)。 @@ -77,7 +77,7 @@ flowchart LR 安装当前候选版本: ```bash -pip install "langparse==0.1.0" +pip install "langparse==0.1.1" ``` 只安装实际需要的可选能力: diff --git a/docs/PYPI.md b/docs/PYPI.md new file mode 100644 index 0000000..28818fb --- /dev/null +++ b/docs/PYPI.md @@ -0,0 +1,154 @@ +# LangParse + +**Documents in. Structure out.** + +LangParse is a developer-friendly Python document parsing toolkit with a +precise, rich Excel parsing engine. It turns documents into structured results +that programs, agents, and data pipelines can consume directly. + +- Parse PDF, DOCX, Excel, CSV, Markdown, and text through one interface. +- Preserve Excel workbook facts, including cells, formulas, formatting, merged + ranges, visibility, and source references. +- Recover workbook structure: logical tables, forms, matrices, text regions, + and cross-sheet relationships. +- Export Markdown, structured JSON, or a queryable Workbook Bundle; optionally + produce chunks for retrieval or analysis. + +Python **3.10+** · **Apache-2.0** · **Zero required core dependencies** + +[GitHub](https://github.com/syw2014/langparse) · +[简体中文](https://github.com/syw2014/langparse/blob/main/README_cn.md) · +[Report an issue](https://github.com/syw2014/langparse/issues) + +## Install + +The core package supports Markdown and text without additional dependencies: + +```bash +pip install langparse +``` + +Install the extras needed by your input formats: + +```bash +pip install "langparse[excel]" # Excel and CSV +pip install "langparse[pdf]" # PDF text and tables +pip install "langparse[docx]" # DOCX +pip install "langparse[excel,pdf,docx]" +``` + +Optional PDF capabilities include `ocr` and `deepdoc`. Workbook model +assistance is available through `model` and requires explicit configuration. +Calling an existing remote MinerU API needs only the core package; the `mineru` +extra installs the package for local API orchestration. See the +[full installation guide](https://github.com/syw2014/langparse/blob/main/README.md#installation) +for backend setup. + +## Quick start + +This example creates its own input and runs with the core installation: + +```python +from pathlib import Path +from langparse import AutoParser + +Path("notes.md").write_text("# Planning\n\nReview the quarterly budget.\n", encoding="utf-8") +result = AutoParser.parse_result("notes.md", chunk=True) + +print(result.markdown_content) +print(result.metadata) +print(len(result.chunks)) +``` + +`ParsedDocumentResult` provides pages, elements, tables, images, metadata, +and diagnostics. Markdown is derived from the structured result. +Use the same entry point for a PDF, DOCX, or workbook after installing its extra: + +```python +result = AutoParser.parse_result("report.docx") # requires langparse[docx] +``` + +## Excel: query and export a Workbook Bundle + +Install `langparse[excel]` first. This example creates a small workbook and +queries its source facts and recovered tables: + +```python +from pathlib import Path +from openpyxl import Workbook +from langparse import AutoParser +from langparse.workbooks import WorkbookBundle + +workbook = Workbook() +sheet = workbook.active +sheet.title = "Data" +sheet.append(["Item", "Amount"]) +sheet.append(["Sales", 100]) +sheet.append(["Total", "=SUM(B2:B2)"]) +workbook.save("budget.xlsx") + +result = AutoParser.parse_result("budget.xlsx", chunk=True, chunk_profile="analysis") +bundle = WorkbookBundle.from_result(result) + +print(bundle.tables(sheet="Data")) +print(bundle.cells(sheet="Data", source_range="A2:B3")) +print(bundle.relations(source_ref="Data!B3")) +print(bundle.diagnostics) +Path("budget.bundle.json").write_text(bundle.to_json(), encoding="utf-8") +``` + +Workbook Bundle v1 separates **facts**, **structures**, **relations**, +**diagnostics**, and **provenance**. Source references connect recovered +structures and formula dependencies to their workbook ranges. + +Default exports omit the full cell snapshot and limit each logical table or +matrix to 200 rows, with explicit omission counts. A bundle built from a live +parse can still query its complete cell snapshot. To export all cells and rows: + +```python +bundle = WorkbookBundle.from_result(result, include_cells=True, max_rows=None) +``` + +Formula text and dependency evidence are preserved; LangParse does not +calculate formulas or fetch external workbooks. Media and source-file binary +content are omitted from Bundle JSON. See the +[Workbook Bundle contract](https://github.com/syw2014/langparse/blob/main/docs/WORKBOOK_BUNDLE.md) +for queries, serialization, and compatibility rules. + +## Command line + +```bash +langparse parse notes.md --format markdown +langparse parse budget.xlsx --format workbook-json --output budget.bundle.json +langparse parse budget.xlsx --chunk --chunk-profile analysis --format json +langparse parse documents/ --batch --format json --output-dir output/ +``` + +Use `--progress` for progress messages on stderr. JSON remains on stdout unless +an output path is supplied. `workbook-json` requires a rich `.xlsx` or `.xlsm` +result; CSV, legacy `.xls`, and other document formats use the standard outputs. + +## Chunking for programs and agents + +For Excel, `retrieval` chunks carry source references and readable table context; +`analysis` chunks include structured records. Semantic, fixed-token, and +sliding-window strategies are also available. The default fixed-token counter +is lexical; it is not a model tokenizer. See the +[chunking guide](https://github.com/syw2014/langparse/blob/main/docs/CHUNKING.md) +and [agent example](https://github.com/syw2014/langparse/blob/main/examples/agent_ingestion.py). + +## Scope and limitations + +LangParse is pre-1.0. Rich workbook parsing targets `.xlsx` and `.xlsm`; +CSV and legacy `.xls` provide compatibility table parsing. Diagnostics expose +partial results and unsupported structures so callers can assess the output. +Independent business holdout validation remains incomplete; regression samples +do not establish production readiness for every workbook layout. + +PDF extraction depends on the selected backend and document quality. OCR, +DeepDoc, and local MinerU may need additional model assets or runtime setup. + +- [Detailed usage and backend configuration](https://github.com/syw2014/langparse/blob/main/README.md) +- [Current capabilities and known gaps](https://github.com/syw2014/langparse/blob/main/docs/PROGRESS.md) +- [0.1.0 release scope](https://github.com/syw2014/langparse/blob/main/docs/RELEASE_0.1.0.md) +- [Changelog](https://github.com/syw2014/langparse/blob/main/CHANGELOG.md) diff --git a/pyproject.toml b/pyproject.toml index b4f1d5f..cde1ed5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta" [project] name = "langparse" -version = "0.1.0" +version = "0.1.1" description = "A developer-friendly document parsing toolkit with precise, source-grounded Excel understanding." -readme = "README.md" +readme = "docs/PYPI.md" requires-python = ">=3.10" license = "Apache-2.0" license-files = ["LICENSE"] diff --git a/uv.lock b/uv.lock index abda6e8..052e405 100644 --- a/uv.lock +++ b/uv.lock @@ -861,7 +861,7 @@ wheels = [ [[package]] name = "langparse" -version = "0.1.0" +version = "0.1.1" source = { editable = "." } [package.optional-dependencies]