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()
doc.title = "Example title!"
print(doc)
results in
<html>
<head>
<title>Example title!</title>
</head>
<body></body>
</html>
Parsing html as a Document
Note: The parser is very experimental, that means that it might not be able to properly parse some html.
from PyML.parser import doc_from_string
html = """
<html>
<head>
<title>Example title!</title>
</head>
<body>
<div class="heh">
<img src="myImage.png">
</div>
</body>
</html>
"""
doc = doc_from_string(html)
print(doc.title)
print(doc.find("img").properties["src"])
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.
Metadata
Release files for PyML 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyML-0.0.5.tar.gz | 7.1 kB | Without provenance | Details for PyML-0.0.5.tar.gz |
Release files / PyML-0.0.5.tar.gz
| Download URL | PyML-0.0.5.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbfcc000ee8ba9330e0a8e0f51f6b454da25cb253f55c34be7a761b73e0a313f
|
|
BLAKE2b-256 checksum How to use checksums |
c181e8faa9d27eb0fbf04264f089d06a1678b46c49359aa736cf71d0bdad16a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for PyML 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.