djangosnippets.org: Latest snippets tagged with 'parser'http://djangosnippets.org/tags/parser/2019-08-11T17:23:52.066397-05:00parse json string
2019-08-11T17:23:52.066397-05:00agusmakmunhttp://djangosnippets.org/snippets/10676/<p>function to parse the string text into json format</p>
Freely redistributabletweetparser filter
2015-06-28T08:02:32.094796-05:00VincentLoyhttp://djangosnippets.org/snippets/10504/<p>Django Template Filter that parse a tweet in plain text and turn it with working Urls</p>
<p>Ceck it on <a href="https://github.com/VincentLoy/tweetparser-django-template-filter">GitHub</a></p>
<h1>tweetParser Django Template Filter</h1>
<p>this is a port of <a href="https://github.com/VincentLoy/tweetParser.js">tweetParser.js</a> to work as a Django template filter</p>
<h2>How does it work ?</h2>
<p>Once installed, just :
<code><p>{{ your_tweet|tweetparser }}</p></code></p>
<h2>Installation …</h2>
Freely redistributableGet typed dictionary from request GET or POST prameters (MergeDict)
2013-02-01T14:41:22.480002-06:00pahazhttp://djangosnippets.org/snippets/2886/<p>Позволяет получить типизированный словарь из входных параметров.</p>
<p>Может быть использован, например, для дальнейшей передаче параметров в objects.filter(**rez).</p>
Freely redistributableultralize
2011-08-24T14:54:31.949032-05:00catellarhttp://djangosnippets.org/snippets/2525/<p>This is a function based on django's urlize modified to show different media based on their url. It supports images, links, mp3/ogg links, youtube videos, vimeo videos and dailymotion videos.</p>
<p>I added a switch called mini to have two modes to show things in different places. When mini is activated …</p>
Freely redistributableurlize HTML
2010-06-18T18:51:01.277575-05:00maguspkhttp://djangosnippets.org/snippets/2072/<p>The default Django urlize filter does not work with html nicely so here I've used an HTML parser <a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> to quickly search through each text node and run the django urlize filter on it. </p>
<p>Optimizations could be made to include a regex in the soup.findAll() method's text argument to only …</p>
Freely redistributableFloatField with safe expression parsing
2010-03-15T19:21:35.761081-05:00joelegnerhttp://djangosnippets.org/snippets/1959/<p>This FloatField replacement allows users to enter math expressions, such as:</p>
<p>4/5 + sqrt(32)</p>
<p>And will evaluate them safely when the field's clean() function is called. In the example above, it will evaluate to a float value of about 6.457.</p>
<p>Reference:</p>
<p><a href="http://lybniz2.sourceforge.net/safeeval.html">http://lybniz2.sourceforge.net/safeeval.html</a></p>
<p>The available functions are listed herein. Note that …</p>
Freely redistributablePledgie data parser
2008-07-31T03:41:51.930417-05:00bramhttp://djangosnippets.org/snippets/931/<p>This one uses - and is very similar to - http://www.djangosnippets.org/snippets/852/</p>
<p>It gets the data from a pledgie.com campaign and parses it.</p>
Freely redistributable