Pyth3: Python Text Markup and Conversion
Pyth3 (version 0.7) is an incomplete and unmaintained port of the Python 2 `pyth` library, intended for text markup and conversion between formats like RTF and XHTML. The project explicitly states that while some components were partially upgraded for Python 3, many parts, including tests, are known to be broken, and the library is primarily targeted at Python 2.7. The last release was in February 2019, indicating it is no longer actively developed.
Warnings
- breaking The `pyth3` library, despite its name, is primarily a (partially and incompletely) ported Python 2 project. Its PyPI description explicitly states that 'Everything else is unknown (or definitely broken on Python 3: even many of the tests fail)'. It is not expected to work correctly with modern Python 3 versions.
- gotcha The library is unmaintained, with its last release in February 2019. This means there will be no bug fixes, security updates, or compatibility improvements for newer Python versions or related libraries.
- gotcha The PyPI classifiers list 'Programming Language :: Python :: 2.7', which contradicts the 'pyth3' name and the intention of being a Python 3 port. This highlights the foundational incompatibility and lack of proper Python 3 support.
Install
-
pip install pyth3
Imports
- PythDocument
from pyth.document import PythDocument
Quickstart
import os
# NOTE: This library is largely non-functional for Python 3 (as per its own PyPI description).
# The following code demonstrates a hypothetical usage pattern based on the original Python 2 'pyth' library,
# but is NOT expected to work with pyth3 version 0.7 due to its unmaintained and broken state.
# Specific functionality like 'RTF15Reader' or 'XHTMLWriter' would be accessed via submodules.
try:
# In a fully functional library, you might import specific components like this:
# from pyth.plugins.rtf15.reader import RTF15Reader
# from pyth.plugins.xhtml.writer import XHTMLWriter
# For demonstration, a placeholder import structure
from pyth.document import PythDocument
# Attempting to create a document or process text would likely fail or not be supported.
print("Successfully attempted to import PythDocument (unlikely to be fully functional).")
# Example: document = PythDocument.new_document()
# print(document)
except ImportError as e:
print(f"ImportError: {e}. This library is known to have significant issues with Python 3.")
except Exception as e:
print(f"An unexpected error occurred: {e}. The library is likely broken for modern Python.")