plasmapdf 0.1.2__tar.gz → 0.2.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.
@@ -1,4 +1,4 @@
1
- .venv
2
- *.pyc
3
- */__pycache__/*
1
+ .venv
2
+ *.pyc
3
+ */__pycache__/*
4
4
  dist/
@@ -1,9 +1,9 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-present John Scrudato IV
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present John Scrudato IV
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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: plasmapdf
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Annotation generator and search tools for PDF
5
5
  Project-URL: Documentation, https://github.com/JSv4/plasmapdf#readme
6
6
  Project-URL: Issues, https://github.com/JSv4/plasmapdf/issues
@@ -157,7 +157,24 @@ span_annotation = SpanAnnotation(span=span, annotation_label="GREETING")
157
157
  oc_annotation = pdf_data_layer.create_opencontract_annotation_from_span(span_annotation)
158
158
  ```
159
159
 
160
- ### 5. Accessing Document Information
160
+ ### 5. Look-alike Character Folding
161
+
162
+ `build_translation_layer` folds a few OCR look-alikes to their common equivalents before building `doc_text`
163
+ (right single quotation mark `’` and acute accent `´` to `'`, dot operator `⋅` to `.`). The set is
164
+ `EQUIVALENT_CHARS` in `plasmapdf/models/PdfDataLayer.py`.
165
+
166
+ Every fold maps one character to one character, so folding never changes a string's length. To compare text
167
+ from a layer with text produced elsewhere (or by a release with a different set), fold both sides:
168
+
169
+ ```python
170
+ from plasmapdf.models.PdfDataLayer import consolidate_common_equivalent_chars as fold
171
+
172
+ fold(pdf_data_layer.doc_text[start:end]) == fold(candidate_text) # offsets stay valid
173
+ ```
174
+
175
+ Releases 0.1.1–0.1.3 folded only `´` and `⋅`; 0.0.1, 0.1.0 and 0.2.0+ also fold `’`.
176
+
177
+ ### 6. Accessing Document Information
161
178
 
162
179
  You can access various pieces of information about the document:
163
180
 
@@ -317,6 +334,15 @@ hatch test
317
334
 
318
335
  This will run all the tests in the `tests` directory.
319
336
 
337
+ ## Publishing
338
+
339
+ PyPI Trusted Publishing uses project `plasmapdf`, GitHub owner `JSv4`, repository `PlasmaPDF`, workflow
340
+ `publish.yml`, and environment `pypi`.
341
+
342
+ Publish a GitHub release tagged with the version in `plasmapdf/__about__.py` prefixed by `v`, such as `v0.2.0`. The
343
+ workflow runs the test workflow on that commit, builds and checks the wheel and source distribution, then uploads them
344
+ to PyPI using OIDC. Run the workflow manually to build and check the distributions without publishing.
345
+
320
346
  ## Conclusion
321
347
 
322
348
  This quick start guide covers the basics of using PlasmaPDF. For more detailed information, refer to the tests or explore the source code. If you encounter any issues or have questions, please refer to the project's issue tracker or documentation.