- domonic 0.9.11
- Навигация
- Ссылки проекта
- Статистика
- Метаданные
- Сопровождающие
- Классификаторы
- Описание проекта
- 𖤐 domonic 𖤐
- A DOM for making HTML with python 3! (and more)
- Install
- Creating HTML with Python 3
- More
- Namespace
- DOM
- createElement
- data-tags
- JSON (utils)
- SVG
- terminal
- DOCS
- CLI
- Join-In
- running examples
- run tests
- Disclaimer
- Creating and Viewing HTML Files with Python
- edited by
- reviewed by
- published
- modified
- difficulty
- Donate today!
- Contents
- Lesson Goals
- Files Needed For This Lesson
- Creating HTML with Python
- “Hello World” in HTML using Python
- Using Python to Control Firefox
- Mac Instructions
- Windows Instructions
- Suggested Readings
- Code Syncing
- About the authors
- Suggested Citation
- Donate today!
domonic 0.9.11
Generate html with python 3. DOM API, Javascript API and more.
Навигация
Ссылки проекта
Статистика
Метаданные
Лицензия: MIT License (MIT)
Метки html, generate, templating, dom, vdom, terminal, json, web, template, javascript, DOM, GUI, render, website, apps, html5, framework, SVG, x3d, events, geom
Требует: Python >=3.6
Сопровождающие
Классификаторы
- Development Status
- 4 — Beta
- Web Environment
- Developers
- Other Audience
- OSI Approved :: MIT License
- English
- OS Independent
- JavaScript
- Python
- Python :: 3
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Internet
- Internet :: WWW/HTTP
- Internet :: WWW/HTTP :: Dynamic Content
- Multimedia :: Graphics :: Presentation
- Software Development
- Software Development :: Code Generators
- Software Development :: Libraries :: Python Modules
- Terminals
- Text Processing :: Markup :: HTML
- Utilities
Описание проекта
𖤐 domonic 𖤐
A DOM for making HTML with python 3! (and more)
Install
python3 -m pip install domonic
Creating HTML with Python 3
or to pretty format and insert the doctype, use an f-string:
from domonic import domonic To quickly parse a webapge try the window module.
from domonic.window import window window.location Also try the xpath or css selectors on command line.
More
- html : Generate html with python 3 😎
- dom : DOM API in python 3 😲
- javascript : js API in python 3 😳 + (dQuery, d3)
- JSON : utils for loading / decorating / transforming
- SVG || mathml || aframe || x3d tags — generators for popular tags
- terminal || cmd : call terminal commands with python3 😱
See the docs/code for more features.
Namespace
Use the tags packaage if you want a namespace. i.e.
or just import what you need.
prepend attributes with an underscore ( avoids clashing with python keywords )
domonic is a pure python dom whos tree is composed of objects. i.e
cast str() on any element to render it without formatting.
There’s also a render method that takes 2 parameters, some domonic and an optional output file.
There’s a few new rendering options. See DOMConfig.
DOM
DOM manipulation with python.
createElement
to create your own elements use the DOM API
There’s an evolving DOM API. To learn more about the webAPI click here.
And check the code/docs to see what’s currently been implemented.
To use the DOM either reference your root 'html' node or import the dom modules global 'document'
There is a javascript package that mimics the js API:
Use setInterval and clearInterval with params
Or for a single delayed function call use setTimeout, clearTimeout
You can call () on a stringvar to transform it into a Node
For writing and using regular javascript, load from a src.
or do inline js by opening triple quotes.
Styling is supported. Styles get passed to the style tag on render.
To use css use a link tag as you usually would.
or use triple quotes to open style tag.
use decorators to wrap elements around function results
hi!