<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: domonic</title>
    <description>The latest articles on DEV Community by domonic (@domonic).</description>
    <link>https://dev.to/domonic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F653408%2F92f875d1-dab7-4a78-9de7-e31a438e691c.jpg</url>
      <title>DEV Community: domonic</title>
      <link>https://dev.to/domonic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/domonic"/>
    <language>en</language>
    <item>
      <title>python DOM. pip install domonic. 0.9.10 python. create html with python DOM for html generation. python3 python html</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Sun, 10 Apr 2022 19:44:20 +0000</pubDate>
      <link>https://dev.to/domonic/python-dom-pip-install-domonic-0910-python-create-html-with-python-dom-for-html-generation-python3-python-html-4d9g</link>
      <guid>https://dev.to/domonic/python-dom-pip-install-domonic-0910-python-create-html-with-python-dom-for-html-generation-python3-python-html-4d9g</guid>
      <description>&lt;p&gt;Have you tried domonic?&lt;/p&gt;

&lt;p&gt;A dom made for python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install domonic

python3

from domonic.html import *
mydom = html(body(h1('Hello, World!'), a("somelink", _href="somepage.html")))

print(f"{mydom}")

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
        &amp;lt;a href="somepage.html"&amp;gt;somelink&amp;lt;/a&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/byteface/domonic/"&gt;https://github.com/byteface/domonic/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>html</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>python3 -m pip install domonic</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Tue, 01 Mar 2022 09:03:29 +0000</pubDate>
      <link>https://dev.to/domonic/python3-m-pip-install-domonic-51g4</link>
      <guid>https://dev.to/domonic/python3-m-pip-install-domonic-51g4</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/byteface/domonic/"&gt;https://github.com/byteface/domonic/&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  A DOM for making HTML with python 3! (and more)
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;domonic
&lt;span class="c"&gt;# python3 -m pip install domonic --upgrade &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating HTML with Python 3
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;domonic.html&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Hello, World!'&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;
&lt;span class="c1"&gt;# &amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or to pretty format and insert the doctype, use an f-string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;mydom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Hello, World!'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"somelink"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"somepage.html"&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mydom&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello, World!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"somepage.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;somelink&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  parsing html
&lt;/h3&gt;

&lt;p&gt;Basic useage...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;from domonic import domonic
mydom &lt;span class="o"&gt;=&lt;/span&gt; domonic.parseString&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;somehtml...'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To quickly parse a webapge try the window module...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;from domonic.window import window
window.location &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"http://www.google.com"&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;window.document.title&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also try the xpath or css selectors on command line...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;domonic &lt;span class="nt"&gt;-x&lt;/span&gt; https://google.com &lt;span class="s1"&gt;'//a[@class]'&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;domonic &lt;span class="nt"&gt;-q&lt;/span&gt; https://google.com &lt;span class="s1"&gt;'a'&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/byteface/domonic/"&gt;https://github.com/byteface/domonic/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>html</category>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>css queries from terminal</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Tue, 15 Feb 2022 13:20:13 +0000</pubDate>
      <link>https://dev.to/domonic/css-queries-from-terminal-1ifb</link>
      <guid>https://dev.to/domonic/css-queries-from-terminal-1ifb</guid>
      <description>&lt;p&gt;domonic -q &lt;a href="https://google.com"&gt;https://google.com&lt;/a&gt; 'a'&lt;/p&gt;

&lt;p&gt;pip install domonic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/byteface/domonic/"&gt;https://github.com/byteface/domonic/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>A python 3 DOM for creating HTML</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Thu, 10 Feb 2022 07:47:19 +0000</pubDate>
      <link>https://dev.to/domonic/a-python-3-dom-for-creating-html-ia5</link>
      <guid>https://dev.to/domonic/a-python-3-dom-for-creating-html-ia5</guid>
      <description>&lt;h3&gt;
  
  
  htmlx
&lt;/h3&gt;

&lt;p&gt;In response to emails I've been receiving about a lightweight version of domonic that uses no parsing packages. (Purely for html creation.) Here is htmlx...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/byteface/htmlx/"&gt;https://github.com/byteface/htmlx/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will have the same aims as domonic but without including other packages and is just a stripped down version.&lt;/p&gt;

&lt;h3&gt;
  
  
  domonic
&lt;/h3&gt;

&lt;p&gt;Is pure python...&lt;/p&gt;

&lt;p&gt;It has lots of features due to being 2 years old now and geared towards creating html content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/byteface/domonic/"&gt;https://github.com/byteface/domonic/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Generally use this for rapid prototypes.&lt;/p&gt;

&lt;h3&gt;
  
  
  adom
&lt;/h3&gt;

&lt;p&gt;Is not pure python. It uses cython and c++ libraries under the hood...&lt;/p&gt;

&lt;p&gt;It has less features and will be more geared towards parsing html...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/byteface/adom/"&gt;https://github.com/byteface/adom/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>pyhton</category>
      <category>html</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>metawurst. have u used gitcoin?. .. https://gitcoin.co/</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Sun, 06 Feb 2022 13:06:39 +0000</pubDate>
      <link>https://dev.to/domonic/metawurst-have-u-used-gitcoin-httpsgitcoinco-17lb</link>
      <guid>https://dev.to/domonic/metawurst-have-u-used-gitcoin-httpsgitcoinco-17lb</guid>
      <description>&lt;p&gt;I started a new dom wrapper...&lt;br&gt;
&lt;a href="https://github.com/byteface/adom/"&gt;https://github.com/byteface/adom/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;join-in if you want. It's only 2 commits old.&lt;/p&gt;

&lt;p&gt;or should I try buy some of these gitcoins and raise an issue?&lt;/p&gt;

</description>
      <category>python</category>
      <category>devjournal</category>
      <category>html</category>
      <category>opensource</category>
    </item>
    <item>
      <title>organise python imports with isort</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Sat, 22 Jan 2022 15:37:43 +0000</pubDate>
      <link>https://dev.to/domonic/organise-python-imports-with-isort-5hko</link>
      <guid>https://dev.to/domonic/organise-python-imports-with-isort-5hko</guid>
      <description>&lt;p&gt;I discovered isort which sorts the python imports... &lt;a href="https://pycqa.github.io/isort/"&gt;https://pycqa.github.io/isort/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and used it on my lib yesterday...&lt;br&gt;
&lt;a href="https://github.com/byteface/domonic/commit/96a91bbf3ee6f672bc1c0e5978f55e45706392aa"&gt;https://github.com/byteface/domonic/commit/96a91bbf3ee6f672bc1c0e5978f55e45706392aa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Seems like a cool util and will save me manually shifting imports around.&lt;/p&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>using vscode online with vscode.dev</title>
      <dc:creator>domonic</dc:creator>
      <pubDate>Thu, 21 Oct 2021 07:04:59 +0000</pubDate>
      <link>https://dev.to/domonic/using-vscode-online-with-vscodedev-4e67</link>
      <guid>https://dev.to/domonic/using-vscode-online-with-vscodedev-4e67</guid>
      <description>&lt;p&gt;Did you know you can use vscode online?&lt;/p&gt;

&lt;p&gt;just visit &lt;a href="https://vscode.dev/"&gt;https://vscode.dev/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and connect to your git repo!&lt;/p&gt;

&lt;p&gt;here's mine...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vscode.dev/github/byteface/domonic"&gt;https://vscode.dev/github/byteface/domonic&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
