Skip to main content

Python text markup and conversion

Project description

Pyth is intended to make it easy to convert marked-up text between different common formats.

Marked-up text means text which has:

  • Paragraphs

  • Headings

  • Bold, italic, and underlined text

  • Hyperlinks

  • Bullet lists

  • Simple tables

  • Very little else

Formats I initially want to support are:

  • xhtml

  • rtf

  • pdf (output)

These three formats cover web, Word / OpenOffice, and print.

Design principles

  • Ignore unsupported information in input formats (e.g. page layout)

  • Ignore font issues – output in a single font.

  • Ignore specific text sizes – support relative sizes (bigger, littler) only. Output in a single base size.

  • Have no dependencies unless they are written in Python, and work

  • Make it easy to add support for new formats, by using an architecture based on plugins and adapters.

Examples

See http://github.com/brendonh/pyth/tree/master/examples/

Unit tests

The sources contains some unit tests (written using python unittest module) in the ‘tests’ directory.

To run the tests we can either run them individually as python script, either use python nose. If using nose then we just need to go into the tests directory and invoke nosetest from there (make sure that pyth module is in PYTHONPATH).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyth-0.5.6.tar.gz (24.1 kB view details)

Uploaded Source

File details

Details for the file pyth-0.5.6.tar.gz.

File metadata

  • Download URL: pyth-0.5.6.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyth-0.5.6.tar.gz
Algorithm Hash digest
SHA256 0f6b19a6739f56111e6dd1e67b61d171e98b91190d21de48b55639507409e584
MD5 e80fe3858a306a6d5f58e18c4d2c1c3a
BLAKE2b-256 9cfb489f35bd27074d02333e2e1c3a7ad511c63c56aa00c555ac9399f6637df4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page