Skip to main content

A Python module for parsing and rendering PawML

Project description

Pawser

Pawser is a lightweight Python parser for PAWML (Pawso Markup Language).
It allows you to read, parse, and convert .pawml files into a tree of nodes or instruction lists.

Installation

Install via pip through PyPI

pip install pawser

This is the most common method, however if you do not have pip and/or would like to download this without or for other reasons, you can;

Clone the repository and install locally:

git clone https://github.com/komoriiwakura/pawser
cd file:///home/komori/Desktop/PAW/pawser/README.md
pawser
pip install -e .

PAWML Syntax

PAWML supports the following elements:

  • #h1, #h2, #h3 - Headers with text
  • #p - Paragraphs with text
  • #li - List container
  • #it - List items
  • #ol - Open links with URL and link text
  • #mdata - Metadata, supports title, and desc

Convert PAWML to Instructions

from pawser import pawml2instructions, printInstructions

# Parse PAWML file and convert to instructions
instructions = pawml2instructions("example.pawml")

# Print instructions
if instructions:
    printInstructions(instructions)

# Or use the instructions list programmatically
if instructions:
    for instruction in instructions:
        print(instruction)
        # Process each instruction as needed

Available Functions

  • parsePawml(filePath) - Parse a PAWML file into a tree structure
  • pawml2domtree(filePath) - Parse a PAWML file and return the DOM tree
  • pawml2instructions(filePath) - Parse a PAWML file and convert to instruction list
  • printTree(node) - Print the tree structure in a readable format
  • printInstructions(instructions) - Print instructions in a readable format

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

pawser-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pawser-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pawser-1.0.0.tar.gz.

File metadata

  • Download URL: pawser-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pawser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 883064ec863c2b0d835b19681a87cd3fc2bbd6d25716bd41849d8185fc461f90
MD5 84d30fbe6226528ac9ed53198c21f706
BLAKE2b-256 27153310d6ba56203febb693c5bedfe0c267fe65a833fcf906b090154111652e

See more details on using hashes here.

File details

Details for the file pawser-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pawser-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pawser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4dce5c94d2e235741a1f079f8555782e9aad634d514df5ca6bfe92bc758da621
MD5 36e657210ecda56c6cd0fafca746a536
BLAKE2b-256 bb0f8f82050f4f4b4059a3187242e5f6e191faceed95e82290e374875b6b35e0

See more details on using hashes here.

Supported by

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