Skip to main content

A python HTML builder library.

Project description

PyML

A python HTML builder library.

Goals

  • Fully functional html builder similar to the javascript node manipulation.
  • Implement an html parser that returns a Document instance with the proper properties and children.
  • Prettify JavaScript to fit in with the prettified html.
  • Add more API methods.
  • Add CSS selector support.
  • Add styling configuration.

Usage

If you have ever manipulated html using JavaScript then this should be really intuitive. You just use the document to create a node. You then modify the node with the properties and children that you want. And insert that node into the document.

from PyML import Document

doc = Document()
title = doc.create_element("title")
title.append_child(doc.create_text_node("Example title!"))

doc.head.append_child(title)
print(doc)

results in

<html>
    <head>
        <title>Example title!</title>
    </head>
    <body></body>
</html>

Contributing

Anybody is free to contribute if they want, just make sure you follow the points listed below:

  • Don't rename/move methods/objects without consulting me first.
  • Don't introduce new functionality without explaining in-depth why we need said functionality (unless its from the Goals section)
  • Your code must be PEP-8 compliable.

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

PyML-0.0.2.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file PyML-0.0.2.tar.gz.

File metadata

  • Download URL: PyML-0.0.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.0

File hashes

Hashes for PyML-0.0.2.tar.gz
Algorithm Hash digest
SHA256 47ca60bc45724318702dedc34ccb174a731ac17aeb4eee14dae93a21d9ae8db1
MD5 bbd396ac344dbaa94db21bee464cf341
BLAKE2b-256 16bd4b05495dab4849979b16f8a28b3f9a2538407febf399fe6aa822c8db7b3a

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