patpubrender 0.1.0__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.
Files changed (66) hide show
  1. patpubrender-0.1.0/.github/workflows/ci.yml +46 -0
  2. patpubrender-0.1.0/.github/workflows/release.yml +82 -0
  3. patpubrender-0.1.0/.gitignore +7 -0
  4. patpubrender-0.1.0/CHANGELOG.md +23 -0
  5. patpubrender-0.1.0/Cargo.lock +855 -0
  6. patpubrender-0.1.0/Cargo.toml +34 -0
  7. patpubrender-0.1.0/LICENSE +201 -0
  8. patpubrender-0.1.0/NOTICE +17 -0
  9. patpubrender-0.1.0/PKG-INFO +63 -0
  10. patpubrender-0.1.0/README.md +110 -0
  11. patpubrender-0.1.0/examples/roundtrip_xml.rs +62 -0
  12. patpubrender-0.1.0/pyproject.toml +32 -0
  13. patpubrender-0.1.0/python/Cargo.lock +342 -0
  14. patpubrender-0.1.0/python/Cargo.toml +25 -0
  15. patpubrender-0.1.0/python/README.md +44 -0
  16. patpubrender-0.1.0/python/build.rs +12 -0
  17. patpubrender-0.1.0/python/patpubrender.pyi +42 -0
  18. patpubrender-0.1.0/python/src/lib.rs +185 -0
  19. patpubrender-0.1.0/rust-toolchain.toml +4 -0
  20. patpubrender-0.1.0/src/bin/patpubrender.rs +416 -0
  21. patpubrender-0.1.0/src/error.rs +62 -0
  22. patpubrender-0.1.0/src/extract.rs +64 -0
  23. patpubrender-0.1.0/src/ingest.rs +621 -0
  24. patpubrender-0.1.0/src/json.rs +21 -0
  25. patpubrender-0.1.0/src/lib.rs +128 -0
  26. patpubrender-0.1.0/src/model/bibliographic.rs +159 -0
  27. patpubrender-0.1.0/src/model/claims.rs +30 -0
  28. patpubrender-0.1.0/src/model/description.rs +124 -0
  29. patpubrender-0.1.0/src/model/document.rs +36 -0
  30. patpubrender-0.1.0/src/model/mod.rs +6 -0
  31. patpubrender-0.1.0/src/model/opaque.rs +49 -0
  32. patpubrender-0.1.0/src/model/runs.rs +41 -0
  33. patpubrender-0.1.0/src/render/biblio.rs +127 -0
  34. patpubrender-0.1.0/src/render/markdown.rs +1127 -0
  35. patpubrender-0.1.0/src/render/mod.rs +3 -0
  36. patpubrender-0.1.0/src/render/template.rs +223 -0
  37. patpubrender-0.1.0/src/shard.rs +230 -0
  38. patpubrender-0.1.0/src/source/aps.rs +969 -0
  39. patpubrender-0.1.0/src/source/detect.rs +303 -0
  40. patpubrender-0.1.0/src/source/mod.rs +5 -0
  41. patpubrender-0.1.0/src/source/traits.rs +7 -0
  42. patpubrender-0.1.0/src/source/uspto/application_v15.rs +1214 -0
  43. patpubrender-0.1.0/src/source/uspto/application_v16.rs +18 -0
  44. patpubrender-0.1.0/src/source/uspto/application_v40.rs +18 -0
  45. patpubrender-0.1.0/src/source/uspto/application_v41.rs +18 -0
  46. patpubrender-0.1.0/src/source/uspto/application_v42.rs +18 -0
  47. patpubrender-0.1.0/src/source/uspto/application_v43.rs +18 -0
  48. patpubrender-0.1.0/src/source/uspto/application_v44.rs +18 -0
  49. patpubrender-0.1.0/src/source/uspto/application_v45.rs +18 -0
  50. patpubrender-0.1.0/src/source/uspto/application_v46.rs +18 -0
  51. patpubrender-0.1.0/src/source/uspto/application_v4x.rs +1144 -0
  52. patpubrender-0.1.0/src/source/uspto/grant_v25.rs +943 -0
  53. patpubrender-0.1.0/src/source/uspto/grant_v40.rs +18 -0
  54. patpubrender-0.1.0/src/source/uspto/grant_v41.rs +18 -0
  55. patpubrender-0.1.0/src/source/uspto/grant_v42.rs +18 -0
  56. patpubrender-0.1.0/src/source/uspto/grant_v43.rs +18 -0
  57. patpubrender-0.1.0/src/source/uspto/grant_v44.rs +18 -0
  58. patpubrender-0.1.0/src/source/uspto/grant_v45.rs +18 -0
  59. patpubrender-0.1.0/src/source/uspto/grant_v46.rs +18 -0
  60. patpubrender-0.1.0/src/source/uspto/grant_v47.rs +18 -0
  61. patpubrender-0.1.0/src/source/uspto/grant_v4x.rs +1140 -0
  62. patpubrender-0.1.0/src/source/uspto/mod.rs +20 -0
  63. patpubrender-0.1.0/src/source/xml.rs +335 -0
  64. patpubrender-0.1.0/tests/application_number.rs +77 -0
  65. patpubrender-0.1.0/tests/smoke_crate.rs +15 -0
  66. patpubrender-0.1.0/tests/template.rs +69 -0
@@ -0,0 +1,46 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ rust:
13
+ name: Rust (fmt, clippy, test)
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ with:
19
+ components: rustfmt, clippy
20
+ - uses: Swatinem/rust-cache@v2
21
+ - name: Format
22
+ run: cargo fmt --all --check
23
+ - name: Clippy (all features)
24
+ run: cargo clippy --all-features --all-targets -- -D warnings
25
+ - name: Test (default)
26
+ run: cargo test
27
+ - name: Test (all features)
28
+ run: cargo test --all-features
29
+
30
+ python:
31
+ name: Python bindings (build + smoke test)
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: dtolnay/rust-toolchain@stable
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.13"
39
+ - name: Build + install wheel
40
+ working-directory: python
41
+ run: |
42
+ pip install maturin
43
+ maturin build --release --out dist
44
+ pip install --no-index --find-links dist patpubrender
45
+ - name: Import smoke test
46
+ run: python -c "import patpubrender; print(patpubrender.__version__)"
@@ -0,0 +1,82 @@
1
+ name: Release
2
+
3
+ # Tag the core crate / SDK release, e.g. `git tag v0.1.0 && git push --tags`.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ # Publish the Rust crate to crates.io.
13
+ crate:
14
+ name: Publish crate (crates.io)
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: dtolnay/rust-toolchain@stable
19
+ - run: cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"
20
+
21
+ # Build abi3 wheels for all platforms + an sdist.
22
+ wheels:
23
+ name: Wheels (${{ matrix.platform.target }})
24
+ runs-on: ${{ matrix.platform.runner }}
25
+ strategy:
26
+ matrix:
27
+ platform:
28
+ - { runner: ubuntu-latest, target: x86_64 }
29
+ - { runner: ubuntu-latest, target: aarch64 }
30
+ - { runner: macos-14, target: aarch64 }
31
+ - { runner: macos-13, target: x86_64 }
32
+ - { runner: windows-latest, target: x64 }
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.13"
38
+ - name: Build wheels
39
+ uses: PyO3/maturin-action@v1
40
+ with:
41
+ working-directory: python
42
+ target: ${{ matrix.platform.target }}
43
+ args: --release --out dist
44
+ manylinux: auto
45
+ - uses: actions/upload-artifact@v4
46
+ with:
47
+ name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
48
+ path: python/dist
49
+
50
+ sdist:
51
+ name: sdist
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - name: Build sdist
56
+ uses: PyO3/maturin-action@v1
57
+ with:
58
+ working-directory: python
59
+ command: sdist
60
+ args: --out dist
61
+ - uses: actions/upload-artifact@v4
62
+ with:
63
+ name: wheels-sdist
64
+ path: python/dist
65
+
66
+ # Publish all wheels + sdist to PyPI via Trusted Publishing (OIDC).
67
+ pypi:
68
+ name: Publish to PyPI
69
+ needs: [wheels, sdist]
70
+ runs-on: ubuntu-latest
71
+ environment: pypi
72
+ permissions:
73
+ id-token: write
74
+ steps:
75
+ - uses: actions/download-artifact@v4
76
+ with:
77
+ pattern: wheels-*
78
+ path: dist
79
+ merge-multiple: true
80
+ - uses: pypa/gh-action-pypi-publish@release/v1
81
+ with:
82
+ packages-dir: dist
@@ -0,0 +1,7 @@
1
+ # Build artifacts (root crate and the python/ binding crate)
2
+ target/
3
+
4
+ # Python
5
+ *.whl
6
+ __pycache__/
7
+ .venv/
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.1.0] - Unreleased
8
+
9
+ Initial release.
10
+
11
+ ### Added
12
+ - Parse USPTO patent grant/application XML and Green Book "APS" plain text into
13
+ a canonical document model (`parse_patent_xml`, `parse_patent_aps`).
14
+ - Render compact, front-mattered Markdown (`render_markdown`).
15
+ - User-overridable output via section-placeholder templates
16
+ (`render_markdown_with_template`; `{{frontmatter}}`, `{{title}}`,
17
+ `{{abstract}}`, `{{description}}`, `{{claims}}`, `{{body}}`).
18
+ - Structured field extraction (`extract::claims`, `extract::abstract_text`,
19
+ `render::biblio::extract_biblio`).
20
+ - Optional `shard` feature: the `.zst` + `.idx` codec (write and read).
21
+ - Optional `ingest` feature: bulk USPTO weekly-ZIP rendering into shards.
22
+ - `patpubrender` CLI: `render`, `shard write`, `shard read`.
23
+ - Python SDK (PyPI) with structured `Document` access and `to_markdown`.