Pyth3: Python Text Markup and Conversion

0.7 · abandoned · verified Mon Apr 13

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

Install

Imports

Quickstart

This quickstart illustrates a hypothetical import and usage pattern for `pyth3`, based on common Python library conventions and mentions from its Python 2 predecessor. However, it's crucial to understand that `pyth3` is explicitly stated by its maintainers as largely broken and unmaintained for Python 3. The provided code is therefore expected to fail or not function as intended, serving primarily as an example of *how* one might attempt to use such a library if it were functional.

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.")

view raw JSON →