diff options
| author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
|---|---|---|
| committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
| commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
| tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info | |
| parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
| download | gn-ai-master.tar.gz | |
Diffstat (limited to '.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info')
6 files changed, 115 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/INSTALLER b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/LICENSE b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/LICENSE new file mode 100644 index 00000000..35d2671c --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, Joshy Cyriac +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/METADATA b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/METADATA new file mode 100644 index 00000000..7e7df6a4 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/METADATA @@ -0,0 +1,66 @@ +Metadata-Version: 2.1 +Name: striprtf +Version: 0.0.28 +Summary: A simple library to convert rtf to text +Home-page: https://github.com/joshy/striprtf +Author: Joshy Cyriac +Author-email: joshy@posteo.ch +License: BSD-3-Clause +Download-URL: https://github.com/joshy/striprtf/archive/v0.0.28.tar.gz +Keywords: rtf +Platform: UNKNOWN +Classifier: License :: OSI Approved :: BSD License +Description-Content-Type: text/markdown +License-File: LICENSE + +# striprtf + + +## Purpose +This is a simple library to convert Rich Text Format (RTF) files to python strings. +A lot of medical documents are written in RTF format which is not ideal for parsing +and further processing. This library converts it to plain old text. + +## How to use it +```python +from striprtf.striprtf import rtf_to_text +rtf = "some rtf encoded string" +text = rtf_to_text(rtf) +print(text) +``` + +If you want to use a different encoding than `cp1252` you can pass it via the `encoding` +parameter. This is only taken into account if no explicit codepage has been set. +```python +from striprtf.striprtf import rtf_to_text +rtf = "some rtf encoded string in latin1" +text = rtf_to_text(rtf, encoding="latin-1") +print(text) +``` + +Sometimes UnicodeDecodingErrors can happen because of various reasons. +In this case you can try to relax the encoding process like this: +```python +from striprtf.striprtf import rtf_to_text +rtf = "some rtf encoded string" +text = rtf_to_text(rtf, errors="ignore") +print(text) +``` + +## Online version +If you don't want to install or just try it out there is an [online version](https://striprtf.dev) available. + +## PostgreSQL +There is also a [PostgreSQL version](https://github.com/MnhnL/pg_striprtf) available from [Raffael Mancini](https://github.com/raffael-mnhn). + +## History +[Pyth](https://github.com/brendonh/pyth) was not working for the rtf files I +had. The next best thing was this gist: +https://gist.github.com/gilsondev/7c1d2d753ddb522e7bc22511cfb08676 + +~~Very few additions where made, e.g. better formatting of tables. ~~ + +In the meantime some encodings bugs have been fixed. :-) + + + diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/RECORD b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/RECORD new file mode 100644 index 00000000..15c44a50 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/RECORD @@ -0,0 +1,13 @@ +../../../bin/striprtf,sha256=x1YCKKwfWOzHmUvwL3CBjRdk_jePIy2iR8cwaXvszhM,567 +striprtf-0.0.28.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +striprtf-0.0.28.dist-info/LICENSE,sha256=Xj0zmSAs0fgBlqOzODa2fV4n32y-3QWcOqb0rp8FQng,1512 +striprtf-0.0.28.dist-info/METADATA,sha256=SW4is7SK-TQjwvQyFMqiRGxroNzGOBm4sQSMjQ29N9I,2148 +striprtf-0.0.28.dist-info/RECORD,, +striprtf-0.0.28.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92 +striprtf-0.0.28.dist-info/top_level.txt,sha256=vFBSyUeD9KXynnjpIF1co9NM_qobCIF20aA3e1vmX18,9 +striprtf/__init__.py,sha256=ZygAIkX6Nbjag1czWdQa-yP-GM1mBE_9ss21Xh__JFc,34 +striprtf/__pycache__/__init__.cpython-312.pyc,, +striprtf/__pycache__/_version.cpython-312.pyc,, +striprtf/__pycache__/striprtf.cpython-312.pyc,, +striprtf/_version.py,sha256=OxG64Q6SDQQGNb5ggPOgDkHI0rY-RjCF92VCMUiyhOQ,23 +striprtf/striprtf.py,sha256=lJfyw8HSoSNLzFylHxI5_7ntt3RxX9iKRBf0566zv8I,10322 diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/WHEEL b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/WHEEL new file mode 100644 index 00000000..5bad85fd --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/top_level.txt b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/top_level.txt new file mode 100644 index 00000000..12ef5022 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/striprtf-0.0.28.dist-info/top_level.txt @@ -0,0 +1 @@ +striprtf |
